GUAC-1053 Fixed problems highlighted in pull request comments.

This commit is contained in:
James Muehlner
2015-04-22 22:52:23 -07:00
parent c2b2302708
commit 8e3e27b8cd
5 changed files with 10 additions and 11 deletions

View File

@@ -62,7 +62,7 @@ public class LanguageRESTService {
/** /**
* The path to the translation folder within the webapp. * The path to the translation folder within the webapp.
*/ */
private static final String TRANSLATION_PATHS = "/translations"; private static final String TRANSLATION_PATH = "/translations";
/** /**
* The JSON property for the human readable display name. * The JSON property for the human readable display name.
@@ -92,8 +92,8 @@ public class LanguageRESTService {
* The ServletContext associated with the request. * The ServletContext associated with the request.
* *
* @return * @return
* A list of languages defined in the system, consisting of * A map of languages defined in the system, of language key to
* language display name and key. * display name.
* *
* @throws GuacamoleException * @throws GuacamoleException
* If an error occurs while retrieving the available languages. * If an error occurs while retrieving the available languages.
@@ -104,7 +104,7 @@ public class LanguageRESTService {
@Context ServletContext servletContext) throws GuacamoleException { @Context ServletContext servletContext) throws GuacamoleException {
// Get the paths of all the translation files // Get the paths of all the translation files
Set<String> resourcePaths = servletContext.getResourcePaths(TRANSLATION_PATHS); Set<String> resourcePaths = servletContext.getResourcePaths(TRANSLATION_PATH);
// If no translation files found, return an empty map // If no translation files found, return an empty map
if (resourcePaths == null) if (resourcePaths == null)
@@ -113,7 +113,7 @@ public class LanguageRESTService {
Map<String, String> languageMap = new HashMap<String, String>(); Map<String, String> languageMap = new HashMap<String, String>();
// Iterate through all the found language files and add them to the return map // Iterate through all the found language files and add them to the return map
for(String resourcePath : resourcePaths) { for (String resourcePath : resourcePaths) {
// Get input stream for language file // Get input stream for language file
InputStream languageFileStream = servletContext.getResourceAsStream(resourcePath); InputStream languageFileStream = servletContext.getResourceAsStream(resourcePath);

View File

@@ -49,7 +49,7 @@ angular.module('rest').factory('languageService', ['$injector',
token : authenticationService.getCurrentToken() token : authenticationService.getCurrentToken()
}; };
// Retrieve available protocols // Retrieve available languages
return $http({ return $http({
cache : cacheService.languages, cache : cacheService.languages,
method : 'GET', method : 'GET',

View File

@@ -200,6 +200,4 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
}] }]
}; };
}]); }]);

View File

@@ -20,7 +20,8 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
.preferences .update-password .form { .preferences .update-password .form,
.preferences .language .form {
padding-left: 0.5em; padding-left: 0.5em;
border-left: 3px solid rgba(0, 0, 0, 0.125); border-left: 3px solid rgba(0, 0, 0, 0.125);
} }

View File

@@ -22,7 +22,7 @@
--> -->
<!-- Language settings --> <!-- Language settings -->
<div class="settings section language update-password"> <div class="settings section language">
<p>{{'SETTINGS_PREFERENCES.HELP_LANGUAGE' | translate}}</p> <p>{{'SETTINGS_PREFERENCES.HELP_LANGUAGE' | translate}}</p>
<!-- Language selection --> <!-- Language selection -->