set html lang by browser language

This commit is contained in:
Thomas Rupprecht 2023-01-04 23:21:40 +01:00
parent 4de8c9c1cb
commit c2cc850e1f
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,7 @@
import Config from './config.js';
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
/**
* @param {string} url
* @returns {Promise<any>}

View File

@ -20,6 +20,8 @@ const doorOpenSVG = `
const dateTimeFormat = Intl.DateTimeFormat([], {dateStyle: 'medium', timeStyle: 'short'});
function setL10n() {
document.querySelector('html').setAttribute('lang', browser.i18n.getUILanguage());
const loadingText = browser.i18n.getMessage('loading');
document.getElementById('state').textContent = loadingText;
document.getElementById('calendar').textContent = loadingText;