1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

load lang from chrome.i18n.getUILanguage()

This commit is contained in:
Kyle Spearrin
2020-01-22 08:10:35 -05:00
parent 972a21a685
commit 70eb421e7a
2 changed files with 4 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ require('./bar.scss');
document.addEventListener('DOMContentLoaded', () => {
var i18n = {};
var lang = window.navigator.language;
if (typeof safari !== 'undefined') {
const responseCommand = 'notificationBarFrameDataResponse';
sendPlatformMessage({
@@ -25,6 +26,7 @@ document.addEventListener('DOMContentLoaded', () => {
i18n.notificationAddDesc = chrome.i18n.getMessage('notificationAddDesc');
i18n.notificationChangeSave = chrome.i18n.getMessage('notificationChangeSave');
i18n.notificationChangeDesc = chrome.i18n.getMessage('notificationChangeDesc');
lang = chrome.i18n.getUILanguage();
// delay 50ms so that we get proper body dimensions
setTimeout(load, 50);
@@ -36,7 +38,7 @@ document.addEventListener('DOMContentLoaded', () => {
bodyRect = body.getBoundingClientRect();
// 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;
closeButton.title = i18n.close;