gitlab-org--gitlab-foss/spec/frontend/helpers/locale_helper.js
Winnie Hellmann 2e7486681a Copy missing helpers from Karma to Jest
Copy missing helpers from Karma to Jest
2019-03-28 20:07:40 +01:00

11 lines
284 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');
}
};