mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 21:51:23 +00:00
GUAC-1053 Fixed problems highlighted in pull request comments.
This commit is contained in:
@@ -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);
|
||||||
|
@@ -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',
|
||||||
|
@@ -200,6 +200,4 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
|
|||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
@@ -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);
|
||||||
}
|
}
|
@@ -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 -->
|
||||||
|
Reference in New Issue
Block a user