Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Bug 1135144 - additionallanguageschange event should trigger language…
Browse files Browse the repository at this point in the history
… negotiation. r=gandalf
  • Loading branch information
stasm committed Mar 2, 2015
1 parent 1bcf284 commit 0617c43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bindings/l20n/runtime.js
Expand Up @@ -189,6 +189,8 @@ function initResources() {
// …and listen to langpacks being added and removed
document.addEventListener('additionallanguageschange', function(evt) {
registerLocales.call(this, meta, evt.detail);
this.ctx.requestLocales.apply(
this.ctx, navigator.languages || [navigator.language]);
}.bind(this));
} else {
additionalLanguagesPromise = Promise.resolve();
Expand Down
6 changes: 5 additions & 1 deletion lib/l20n/context.js
Expand Up @@ -226,7 +226,11 @@ Context.prototype.requestLocales = function requestLocales() {
this.availableLocales.concat(this.qps),
requested,
this.defaultLocale);
freeze.call(this, supported);

// freeze only if the first language in the fallback chain is new
if (this.supportedLocales[0] !== supported[0]) {
freeze.call(this, supported);
}
};


Expand Down

0 comments on commit 0617c43

Please sign in to comment.