Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: chrome/browser/resources/options2/language_options.js

Issue 10442128: Make UI language change work on chromeos. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/language_options.js
diff --git a/chrome/browser/resources/options2/language_options.js b/chrome/browser/resources/options2/language_options.js
index fa6067e9a796dba4acf73a0abcc817a6a0ffb635..8caf629b5bd30066be70c6a1012dd7075e21b0c7 100644
--- a/chrome/browser/resources/options2/language_options.js
+++ b/chrome/browser/resources/options2/language_options.js
@@ -40,9 +40,12 @@ cr.define('options', function() {
LanguageOptions.prototype = {
__proto__: OptionsPage.prototype,
+ // For recording the prospective language (the next locale after relaunch).
Dan Beam 2012/06/01 17:45:13 /** * For recording the prospective language (the
+ prospectiveUiLanguageCode_: null,
+
/**
* Initializes LanguageOptions page.
- * Calls base class implementation to starts preference initialization.
+ * Calls base class implementation to start preference initialization.
*/
initializePage: function() {
OptionsPage.prototype.initializePage.call(this);
@@ -55,6 +58,8 @@ cr.define('options', function() {
languageOptionsList.addEventListener('save',
this.handleLanguageOptionsListSave_.bind(this));
+ this.prospectiveUiLanguageCode_ =
+ loadTimeData.getString('prospectiveUiLanguageCode');
this.addEventListener('visibleChange',
this.handleVisibleChange_.bind(this));
@@ -113,7 +118,9 @@ cr.define('options', function() {
if (cr.isChromeOS) {
$('language-options-ui-restart-button').onclick =
Dan Beam 2012/06/01 17:45:13 you don't need to wrap this
kochi 2012/06/02 22:39:14 Done.
- chrome.send.bind(chrome, 'uiLanguageRestart');
Evan Stade 2012/06/01 17:21:17 is this change necessary/related? I don't really c
kochi 2012/06/02 22:39:14 This line caused a NOTREACHED(). - so this also fi
+ function(e) {
+ chrome.send('uiLanguageRestart');
+ };
}
$('language-confirm').onclick =
@@ -370,7 +377,7 @@ cr.define('options', function() {
// hidden by a language change.
uiLanguageButton.hidden = false;
- if (languageCode == loadTimeData.getString('prospectiveUiLanguageCode')) {
+ if (languageCode == this.prospectiveUiLanguageCode_) {
uiLanguageMessage.textContent =
loadTimeData.getString('is_displayed_in_this_language');
showMutuallyExclusiveNodes(
@@ -580,7 +587,7 @@ cr.define('options', function() {
*/
languageIsDeletable: function(languageCode) {
// Don't allow removing the language if it's a UI language.
- if (languageCode == loadTimeData.getString('prospectiveUiLanguageCode'))
+ if (languageCode == this.prospectiveUiLanguageCode_)
return false;
return (!cr.isChromeOS ||
this.canDeleteLanguage_(languageCode));
@@ -824,7 +831,7 @@ cr.define('options', function() {
* @param {string} languageCode The newly selected language to use.
*/
LanguageOptions.uiLanguageSaved = function(languageCode) {
- loadTimeData.getString('prospectiveUiLanguageCode') = languageCode;
+ this.prospectiveUiLanguageCode_ = languageCode;
// If the user is no longer on the same language code, ignore.
if ($('language-options-list').getSelectedLanguageCode() != languageCode)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698