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

9 lines
233 B
JavaScript

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