Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #173 from crdlc/bug-1080356
Browse files Browse the repository at this point in the history
Bug 1080356 - [Loop] "You're logged in as" string is not localized
  • Loading branch information
Cristian Rodriguez committed Oct 9, 2014
2 parents cdff871 + 8f04cc8 commit 8c3a588
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
35 changes: 23 additions & 12 deletions js/screens/settings.js
Expand Up @@ -36,6 +36,7 @@
};

var _;
var _identity;
var Settings = {
reset: function s_clear() {
var settingNames = Object.keys(_SETTING_DEFAULTS);
Expand All @@ -52,6 +53,7 @@
},

init: function s_init(identity) {
_identity = identity;
if (!_settingsPanel) {
// Cache mozL10n functionality
_ = navigator.mozL10n.get;
Expand Down Expand Up @@ -181,18 +183,10 @@
);
}

// Set the value taking into account the identity
_loggedAs.innerHTML = _(
'loggedInAs',
{
username: identity || _('unknown')
}
);

// Set the commit based on the version
if (_commitHashTag && Version.id) {
_commitHashTag.textContent = Version.id || _('unknown');
}
this.localize();
// In this point the code is localized, but we want to listen new change
// in language in order to update it properly.
window.addEventListener('localized', this.localize.bind(this));

// Set the value of the default mode (video/audio)
// Set settings values.
Expand Down Expand Up @@ -225,6 +219,23 @@
);
},

localize: function s_localize() {
// Set the value taking into account the identity
if (_loggedAs) {
_loggedAs.innerHTML = _(
'loggedInAs',
{
username: _identity || _('unknown')
}
);
}

// Set the commit based on the version
if (_commitHashTag && Version.id) {
_commitHashTag.textContent = Version.id || _('unknown');
}
},

show: function s_show() {
if (!_settingsPanel) {
return;
Expand Down
2 changes: 1 addition & 1 deletion js/version.js
@@ -1 +1 @@
Version = { id: 'ce63886' };
Version = { id: 'b513867' };

0 comments on commit 8c3a588

Please sign in to comment.