debian-mirror-gitlab/spec/frontend/helpers/locale_helper.js

10 lines
233 B
JavaScript
Raw Normal View History

2019-07-07 11:18:12 +05:30
export const setLanguage = languageCode => {
const htmlElement = document.querySelector('html');
if (languageCode) {
htmlElement.setAttribute('lang', languageCode);
} else {
htmlElement.removeAttribute('lang');
}
};