Commit c27f46b4 authored by Alexander Alekseev's avatar Alexander Alekseev Committed by Commit Bot

Chrome OS OOBE: Fix locale switching.

This Cl fixed bug introduced in
https://chromium-review.googlesource.com/1077099, when OOBE Welcome
stopped receiving updated strings on localizedStrings update.


Bug: 850444
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Id8e53ed1a193c6e59df744500470cbeb2ed2d84b
Reviewed-on: https://chromium-review.googlesource.com/1142732Reviewed-by: default avatarWenzhao (Colin) Zang <wzang@chromium.org>
Commit-Queue: Alexander Alekseev <alemate@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576326}
parent 73bedbe3
...@@ -23,24 +23,13 @@ login.createScreen('WelcomeScreen', 'connect', function() { ...@@ -23,24 +23,13 @@ login.createScreen('WelcomeScreen', 'connect', function() {
decorate: function() { decorate: function() {
var welcomeScreen = $('oobe-welcome-md'); var welcomeScreen = $('oobe-welcome-md');
welcomeScreen.screen = this; welcomeScreen.screen = this;
welcomeScreen.enabled = true;
var languageList = loadTimeData.getValue('languageList');
welcomeScreen.languages = languageList;
var inputMethodsList = loadTimeData.getValue('inputMethodsList');
welcomeScreen.keyboards = inputMethodsList;
var timezoneList = loadTimeData.getValue('timezoneList');
welcomeScreen.timezones = timezoneList;
welcomeScreen.highlightStrength =
loadTimeData.getValue('highlightStrength');
this.context.addObserver( this.context.addObserver(
CONTEXT_KEY_INPUT_METHOD, function(inputMethodId) { CONTEXT_KEY_INPUT_METHOD, function(inputMethodId) {
$('oobe-welcome-md').setSelectedKeyboard(inputMethodId); $('oobe-welcome-md').setSelectedKeyboard(inputMethodId);
}); });
this.updateLocalizedContent();
}, },
onLanguageSelected_: function(languageId) { onLanguageSelected_: function(languageId) {
......
...@@ -75,34 +75,32 @@ ...@@ -75,34 +75,32 @@
</hd-iron-icon> </hd-iron-icon>
<h1 slot="title">[[i18nDynamic(locale, 'languageSectionTitle')]]</h1> <h1 slot="title">[[i18nDynamic(locale, 'languageSectionTitle')]]</h1>
<div slot="footer" class="layout vertical"> <div slot="footer" class="layout vertical">
<template is="dom-if" if="[[enabled]]"> <div id="languageDropdownContainer"
<div id="languageDropdownContainer" class="flex layout center horizontal justified
class="flex layout center horizontal justified language-selection-entry">
language-selection-entry"> <div class=
<div class= "language-selection-title layout vertical center-justified">
"language-selection-title layout vertical center-justified"> [[i18nDynamic(locale, 'languageDropdownTitle')]]
[[i18nDynamic(locale, 'languageDropdownTitle')]]
</div>
<oobe-i18n-dropdown id="languageSelect" items="[[languages]]"
on-select-item="onLanguageSelected_" class="focus-on-show"
label-for-aria=
"[[i18nDynamic(locale, 'languageDropdownLabel')]]">
</oobe-i18n-dropdown>
</div> </div>
<div id="keyboardDropdownContainer" <oobe-i18n-dropdown id="languageSelect" items="[[languages]]"
class="flex layout center horizontal justified on-select-item="onLanguageSelected_" class="focus-on-show"
language-selection-entry"> label-for-aria=
<div class= "[[i18nDynamic(locale, 'languageDropdownLabel')]]">
"language-selection-title layout vertical center-justified"> </oobe-i18n-dropdown>
[[i18nDynamic(locale, 'keyboardDropdownTitle')]] </div>
</div> <div id="keyboardDropdownContainer"
<oobe-i18n-dropdown id="keyboardSelect" items="[[keyboards]]" class="flex layout center horizontal justified
on-select-item="onKeyboardSelected_" language-selection-entry">
label-for-aria= <div class=
"[[i18nDynamic(locale, 'keyboardDropdownLabel')]]"> "language-selection-title layout vertical center-justified">
</oobe-i18n-dropdown> [[i18nDynamic(locale, 'keyboardDropdownTitle')]]
</div> </div>
</template> <oobe-i18n-dropdown id="keyboardSelect" items="[[keyboards]]"
on-select-item="onKeyboardSelected_"
label-for-aria=
"[[i18nDynamic(locale, 'keyboardDropdownLabel')]]">
</oobe-i18n-dropdown>
</div>
</div> </div>
<div slot="bottom-buttons" class="layout horizontal end-justified"> <div slot="bottom-buttons" class="layout horizontal end-justified">
<oobe-text-button inverse on-tap="closeLanguageSection_"> <oobe-text-button inverse on-tap="closeLanguageSection_">
......
...@@ -46,14 +46,6 @@ Polymer({ ...@@ -46,14 +46,6 @@ Polymer({
observer: 'onKeyboardsChanged_', observer: 'onKeyboardsChanged_',
}, },
/**
* Flag that enables MD-OOBE.
*/
enabled: {
type: Boolean,
value: false,
},
/** /**
* Accessibility options status. * Accessibility options status.
* @type {!OobeTypes.A11yStatuses} * @type {!OobeTypes.A11yStatuses}
...@@ -111,6 +103,11 @@ Polymer({ ...@@ -111,6 +103,11 @@ Polymer({
* This is called when UI strings are changed. * This is called when UI strings are changed.
*/ */
updateLocalizedContent: function() { updateLocalizedContent: function() {
this.languages = loadTimeData.getValue('languageList');
this.keyboards = loadTimeData.getValue('inputMethodsList');
this.timezones = loadTimeData.getValue('timezoneList');
this.highlightStrength = loadTimeData.getValue('highlightStrength');
this.$.networkSelectionScreen.i18nUpdateLocale(); this.$.networkSelectionScreen.i18nUpdateLocale();
this.$.welcomeScreen.i18nUpdateLocale(); this.$.welcomeScreen.i18nUpdateLocale();
this.i18nUpdateLocale(); this.i18nUpdateLocale();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment