debian-mirror-gitlab/spec/frontend/__helpers__/locale_helper.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
235 B
JavaScript
Raw Normal View History

2021-03-08 18:12:59 +05:30
export const setLanguage = (languageCode) => {
2019-07-07 11:18:12 +05:30
const htmlElement = document.querySelector('html');
if (languageCode) {
htmlElement.setAttribute('lang', languageCode);
} else {
htmlElement.removeAttribute('lang');
}
};