Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/oobe_welcome.js |
| diff --git a/chrome/browser/resources/chromeos/login/oobe_welcome.js b/chrome/browser/resources/chromeos/login/oobe_welcome.js |
| index aeaba1a63b61b01e7d01a541a52fe440aeee76c6..8c72b290ac3a5ef7fb688fb996b357cf531e29c5 100644 |
| --- a/chrome/browser/resources/chromeos/login/oobe_welcome.js |
| +++ b/chrome/browser/resources/chromeos/login/oobe_welcome.js |
| @@ -32,7 +32,7 @@ Polymer({ |
| */ |
| languages: { |
| type: Array, |
| - observer: "onLanguagesChanged_", |
| + observer: 'onLanguagesChanged_', |
| }, |
| /** |
| @@ -41,7 +41,7 @@ Polymer({ |
| */ |
| keyboards: { |
| type: Array, |
| - observer: "onKeyboardsChanged_", |
| + observer: 'onKeyboardsChanged_', |
| }, |
| /** |
| @@ -77,6 +77,12 @@ Polymer({ |
| value: '', |
| }, |
| + /* |
| + * Dynamically change languages. |
| + * @private |
| + */ |
| + i18n_: Object, |
| + |
| /** |
| * True when connected to a network. |
| * @private |
| @@ -89,7 +95,7 @@ Polymer({ |
| /** |
| * Controls displaying of "Enable debugging features" link. |
| */ |
| - debuggingLinkVisible: Boolean, |
| + debuggingLinkVisible: Boolean, |
| }, |
| /** |
| @@ -130,6 +136,29 @@ Polymer({ |
| addWiFiNetworkMenuName: loadTimeData.getString('addWiFiNetworkMenuName'), |
| proxySettingsMenuName: loadTimeData.getString('proxySettingsMenuName'), |
| }; |
| + |
| + // I18n tags in this list are updated in the i18n_ object to reflect the |
| + // current i18n locale selected by the user. |
| + var i18nTags = [ |
| + 'accessibilitySectionHint', 'accessibilitySectionTitle', |
| + 'highContrastOption', 'highContrastOptionOff', |
| + 'highContrastOptionOn', 'keyboardDropdownTitle', |
| + 'languageDropdownTitle', 'languageSectionTitle', |
| + 'largeCursorOption', 'largeCursorOptionOff', |
| + 'largeCursorOptionOn', 'networkSectionHint', |
| + 'networkSectionTitle', 'oobeOKButtonText', |
| + 'screenMagnifierOption', 'screenMagnifierOptionOff', |
| + 'screenMagnifierOptionOn', 'spokenFeedbackOption', |
| + 'spokenFeedbackOptionOff', 'spokenFeedbackOptionOn', |
| + 'timezoneDropdownTitle', 'timezoneSectionTitle', |
| + 'virtualKeyboardOption', 'virtualKeyboardOptionOff', |
| + 'virtualKeyboardOptionOn', |
| + ]; |
| + var i18n = {}; |
| + i18nTags.forEach(function(tag) { |
| + i18n[tag] = loadTimeData.getString(tag); |
| + }); |
| + this.i18n_ = i18n; |
|
Alexander Alekseev
2017/05/19 23:57:29
Is this an example of what could be done, or a fin
dschuyler
2017/05/20 00:04:56
I see it as working, potentially final code. I'm g
dschuyler
2017/05/20 00:26:43
dbeam@ suggested an improvement that may eliminate
dschuyler
2017/05/20 00:56:09
WDYT of patch #3
|
| }, |
| /** |
| @@ -139,7 +168,7 @@ Polymer({ |
| hideAllScreens_: function() { |
| this.$.welcomeScreen.hidden = true; |
| - var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog') |
| + var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog'); |
| for (var i = 0; i < screens.length; ++i) { |
| screens[i].hidden = true; |
| } |
| @@ -164,7 +193,7 @@ Polymer({ |
| * @private |
| */ |
| getActiveScreen_: function() { |
| - var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog') |
| + var screens = Polymer.dom(this.root).querySelectorAll('oobe-dialog'); |
| for (var i = 0; i < screens.length; ++i) { |
| if (!screens[i].hidden) |
| return screens[i]; |
| @@ -207,21 +236,27 @@ Polymer({ |
| customItemName: 'proxySettingsMenuName', |
| polymerIcon: 'oobe-welcome-20:add-proxy', |
| customData: { |
| - onTap: function() { self.OpenProxySettingsDialog_(); }, |
| + onTap: function() { |
| + self.OpenProxySettingsDialog_(); |
| + }, |
| }, |
| }, |
| { |
| customItemName: 'addWiFiNetworkMenuName', |
| polymerIcon: 'oobe-welcome-20:add-wifi', |
| customData: { |
| - onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, |
| + onTap: function() { |
| + self.OpenAddWiFiNetworkDialog_(); |
| + }, |
| }, |
| }, |
| { |
| customItemName: 'addMobileNetworkMenuName', |
| polymerIcon: 'oobe-welcome-20:add-cellular', |
| customData: { |
| - onTap: function() { self.OpenAddWiFiNetworkDialog_(); }, |
| + onTap: function() { |
| + self.OpenAddWiFiNetworkDialog_(); |
| + }, |
| }, |
| }, |
| ]; |
| @@ -275,7 +310,7 @@ Polymer({ |
| }, |
| /** |
| - * Handle Networwork Setup screen "Proxy settings" button. |
| + * Handle Network Setup screen "Proxy settings" button. |
| * |
| * @private |
| */ |
| @@ -284,7 +319,7 @@ Polymer({ |
| }, |
| /** |
| - * Handle Networwork Setup screen "Add WiFi network" button. |
| + * Handle Network Setup screen "Add WiFi network" button. |
| * |
| * @private |
| */ |
| @@ -293,7 +328,7 @@ Polymer({ |
| }, |
| /** |
| - * Handle Networwork Setup screen "Add cellular network" button. |
| + * Handle Network Setup screen "Add cellular network" button. |
| * |
| * @private |
| */ |