Skip to content

Commit

Permalink
Consistently use browser.i18n language
Browse files Browse the repository at this point in the history
Make the language used for date formatting and document lang attribute
consistent with the language used for strings by using browser.i18n for
both mechanisms (instead of something relying on navigator.language
which is a different setting).

Also fixes the problems when navigator.language is not specified, see #487 and #274.
  • Loading branch information
Cimbali committed Aug 11, 2020
1 parent 495e1fd commit ba7e22d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion background.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const Brief = {
let relativeDate = new this.common.RelativeDate(lastUpdateTime);
let time, pluralForms, form;
let lang = Brief.window.navigator.language;
let lang = browser.i18n.getUILanguage();
switch (true) {
case relativeDate.deltaMinutes === 0:
Expand Down
2 changes: 1 addition & 1 deletion ui/brief.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function init() {
Commands.applyStyle();

let doc = contentIframe.contentDocument;
doc.documentElement.setAttribute('lang', navigator.language);
doc.documentElement.setAttribute('lang', browser.i18n.getUILanguage());

SplitterModule.init();
document.getElementById('sidebar-splitter').addEventListener(
Expand Down

0 comments on commit ba7e22d

Please sign in to comment.