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() {
decorate: function() {
var welcomeScreen = $('oobe-welcome-md');
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(
CONTEXT_KEY_INPUT_METHOD, function(inputMethodId) {
$('oobe-welcome-md').setSelectedKeyboard(inputMethodId);
});
this.updateLocalizedContent();
},
onLanguageSelected_: function(languageId) {
......
......@@ -75,34 +75,32 @@
</hd-iron-icon>
<h1 slot="title">[[i18nDynamic(locale, 'languageSectionTitle')]]</h1>
<div slot="footer" class="layout vertical">
<template is="dom-if" if="[[enabled]]">
<div id="languageDropdownContainer"
class="flex layout center horizontal justified
language-selection-entry">
<div class=
"language-selection-title layout vertical center-justified">
[[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 id="languageDropdownContainer"
class="flex layout center horizontal justified
language-selection-entry">
<div class=
"language-selection-title layout vertical center-justified">
[[i18nDynamic(locale, 'languageDropdownTitle')]]
</div>
<div id="keyboardDropdownContainer"
class="flex layout center horizontal justified
language-selection-entry">
<div class=
"language-selection-title layout vertical center-justified">
[[i18nDynamic(locale, 'keyboardDropdownTitle')]]
</div>
<oobe-i18n-dropdown id="keyboardSelect" items="[[keyboards]]"
on-select-item="onKeyboardSelected_"
label-for-aria=
"[[i18nDynamic(locale, 'keyboardDropdownLabel')]]">
</oobe-i18n-dropdown>
<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 id="keyboardDropdownContainer"
class="flex layout center horizontal justified
language-selection-entry">
<div class=
"language-selection-title layout vertical center-justified">
[[i18nDynamic(locale, 'keyboardDropdownTitle')]]
</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 slot="bottom-buttons" class="layout horizontal end-justified">
<oobe-text-button inverse on-tap="closeLanguageSection_">
......
......@@ -46,14 +46,6 @@ Polymer({
observer: 'onKeyboardsChanged_',
},
/**
* Flag that enables MD-OOBE.
*/
enabled: {
type: Boolean,
value: false,
},
/**
* Accessibility options status.
* @type {!OobeTypes.A11yStatuses}
......@@ -111,6 +103,11 @@ Polymer({
* This is called when UI strings are changed.
*/
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.$.welcomeScreen.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