debian-mirror-gitlab/spec/frontend/__helpers__/locale_helper.js
2021-03-08 18:12:59 +05:30

9 lines
235 B
JavaScript

export const setLanguage = (languageCode) => {
const htmlElement = document.querySelector('html');
if (languageCode) {
htmlElement.setAttribute('lang', languageCode);
} else {
htmlElement.removeAttribute('lang');
}
};