11 lines
286 B
JavaScript
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');
|
|
}
|
|
};
|