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

12 lines
284 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
/* eslint-disable import/prefer-default-export */
2018-12-13 13:39:08 +05:30
export const setLanguage = languageCode => {
2018-03-17 18:26:18 +05:30
const htmlElement = document.querySelector('html');
if (languageCode) {
htmlElement.setAttribute('lang', languageCode);
} else {
htmlElement.removeAttribute('lang');
}
};