diff --git a/guacamole/pom.xml b/guacamole/pom.xml index 705009360..74c601aab 100644 --- a/guacamole/pom.xml +++ b/guacamole/pom.xml @@ -493,6 +493,14 @@ + + + + org.webjars.npm + jstz + 1.0.10 + + diff --git a/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js b/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js index 71e7af73e..4aeef47f4 100644 --- a/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js +++ b/guacamole/src/main/webapp/app/settings/directives/guacSettingsPreferences.js @@ -38,6 +38,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe // Required services var $translate = $injector.get('$translate'); var authenticationService = $injector.get('authenticationService'); + var formService = $injector.get('formService'); var guacNotification = $injector.get('guacNotification'); var languageService = $injector.get('languageService'); var permissionService = $injector.get('permissionService'); diff --git a/guacamole/src/main/webapp/app/settings/services/preferenceService.js b/guacamole/src/main/webapp/app/settings/services/preferenceService.js index bcd86336b..38241e1c6 100644 --- a/guacamole/src/main/webapp/app/settings/services/preferenceService.js +++ b/guacamole/src/main/webapp/app/settings/services/preferenceService.js @@ -98,6 +98,17 @@ angular.module('settings').provider('preferenceService', ['$injector', return language.replace(/-/g, '_'); }; + + /** + * Return the timezone detected for the current browser session + * by the JSTZ timezone library. + * + * @returns String + * The name of the currently-detected timezone. + */ + var getDetectedTimezone = function getDetectedTimezone() { + return jstz.determine().name(); + }; /** * All currently-set preferences, as name/value pairs. Each property name @@ -128,7 +139,13 @@ angular.module('settings').provider('preferenceService', ['$injector', * * @type String */ - language : getDefaultLanguageKey() + language : getDefaultLanguageKey(), + + /** + * The timezone set by the uesr. + * @type String + */ + timezone : getDetectedTimezone() }; diff --git a/guacamole/src/main/webapp/app/settings/styles/preferences.css b/guacamole/src/main/webapp/app/settings/styles/preferences.css index ed8460dd4..9a966b552 100644 --- a/guacamole/src/main/webapp/app/settings/styles/preferences.css +++ b/guacamole/src/main/webapp/app/settings/styles/preferences.css @@ -18,7 +18,7 @@ */ .preferences .update-password .form, -.preferences .language .form { +.preferences .locale .form { padding-left: 0.5em; border-left: 3px solid rgba(0, 0, 0, 0.125); } \ No newline at end of file diff --git a/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html b/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html index 826a5cd20..8c924539b 100644 --- a/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html +++ b/guacamole/src/main/webapp/app/settings/templates/settingsPreferences.html @@ -1,8 +1,8 @@
- -
-

{{'SETTINGS_PREFERENCES.HELP_LANGUAGE' | translate}}

+ +
+

{{'SETTINGS_PREFERENCES.HELP_LOCALE' | translate}}

@@ -13,6 +13,15 @@
+ + +
+ + +
diff --git a/guacamole/src/main/webapp/index.html b/guacamole/src/main/webapp/index.html index 1d51606a9..e675546c6 100644 --- a/guacamole/src/main/webapp/index.html +++ b/guacamole/src/main/webapp/index.html @@ -85,6 +85,9 @@ + + + diff --git a/guacamole/src/main/webapp/translations/en.json b/guacamole/src/main/webapp/translations/en.json index 8815dd975..e0e42214f 100644 --- a/guacamole/src/main/webapp/translations/en.json +++ b/guacamole/src/main/webapp/translations/en.json @@ -755,6 +755,7 @@ "FIELD_HEADER_PASSWORD_OLD" : "Current Password:", "FIELD_HEADER_PASSWORD_NEW" : "New Password:", "FIELD_HEADER_PASSWORD_NEW_AGAIN" : "Confirm New Password:", + "FIELD_HEADER_TIMEZONE" : "Timezone:", "FIELD_HEADER_USERNAME" : "Username:", "HELP_DEFAULT_INPUT_METHOD" : "The default input method determines how keyboard events are received by Guacamole. Changing this setting may be necessary when using a mobile device, or when typing through an IME. This setting can be overridden on a per-connection basis within the Guacamole menu.", @@ -762,7 +763,7 @@ "HELP_INPUT_METHOD_NONE" : "@:CLIENT.HELP_INPUT_METHOD_NONE", "HELP_INPUT_METHOD_OSK" : "@:CLIENT.HELP_INPUT_METHOD_OSK", "HELP_INPUT_METHOD_TEXT" : "@:CLIENT.HELP_INPUT_METHOD_TEXT", - "HELP_LANGUAGE" : "Select a different language below to change the language of all text within Guacamole. Available choices will depend on which languages are installed.", + "HELP_LOCALE" : "Options below are related to the locale of the user and will impact how various parts of the interface are displayed.", "HELP_MOUSE_MODE_ABSOLUTE" : "@:CLIENT.HELP_MOUSE_MODE_ABSOLUTE", "HELP_MOUSE_MODE_RELATIVE" : "@:CLIENT.HELP_MOUSE_MODE_RELATIVE", "HELP_UPDATE_PASSWORD" : "If you wish to change your password, enter your current password and the desired new password below, and click \"Update Password\". The change will take effect immediately.",