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

12 lines
286 B
JavaScript
Raw Normal View History

2017-12-12 06:39:31 -05:00
/* 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');
}
};