mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
load lang from chrome.i18n.getUILanguage()
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: 3f17b642b4...7d8143b288
@@ -2,6 +2,7 @@ require('./bar.scss');
|
|||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
var i18n = {};
|
var i18n = {};
|
||||||
|
var lang = window.navigator.language;
|
||||||
if (typeof safari !== 'undefined') {
|
if (typeof safari !== 'undefined') {
|
||||||
const responseCommand = 'notificationBarFrameDataResponse';
|
const responseCommand = 'notificationBarFrameDataResponse';
|
||||||
sendPlatformMessage({
|
sendPlatformMessage({
|
||||||
@@ -25,6 +26,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
i18n.notificationAddDesc = chrome.i18n.getMessage('notificationAddDesc');
|
i18n.notificationAddDesc = chrome.i18n.getMessage('notificationAddDesc');
|
||||||
i18n.notificationChangeSave = chrome.i18n.getMessage('notificationChangeSave');
|
i18n.notificationChangeSave = chrome.i18n.getMessage('notificationChangeSave');
|
||||||
i18n.notificationChangeDesc = chrome.i18n.getMessage('notificationChangeDesc');
|
i18n.notificationChangeDesc = chrome.i18n.getMessage('notificationChangeDesc');
|
||||||
|
lang = chrome.i18n.getUILanguage();
|
||||||
|
|
||||||
// delay 50ms so that we get proper body dimensions
|
// delay 50ms so that we get proper body dimensions
|
||||||
setTimeout(load, 50);
|
setTimeout(load, 50);
|
||||||
@@ -36,7 +38,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
bodyRect = body.getBoundingClientRect();
|
bodyRect = body.getBoundingClientRect();
|
||||||
|
|
||||||
// i18n
|
// i18n
|
||||||
body.classList.add('lang-' + window.navigator.language.slice(0, 2));
|
body.classList.add('lang-' + lang.slice(0, 2));
|
||||||
|
|
||||||
document.getElementById('logo-link').title = i18n.appName;
|
document.getElementById('logo-link').title = i18n.appName;
|
||||||
closeButton.title = i18n.close;
|
closeButton.title = i18n.close;
|
||||||
|
|||||||
Reference in New Issue
Block a user