gitlab-org--gitlab-foss/spec/frontend/__helpers__/locale_helper.js

10 lines
235 B
JavaScript
Raw Normal View History

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