gitlab-org--gitlab-foss/spec/javascripts/helpers/locale_helper.js
2017-12-18 11:13:41 +01:00

11 lines
286 B
JavaScript

/* eslint-disable import/prefer-default-export */
export const setLanguage = (languageCode) => {
const htmlElement = document.querySelector('html');
if (languageCode) {
htmlElement.setAttribute('lang', languageCode);
} else {
htmlElement.removeAttribute('lang');
}
};