9 lines
235 B
JavaScript
9 lines
235 B
JavaScript
export const setLanguage = (languageCode) => {
|
|
const htmlElement = document.querySelector('html');
|
|
|
|
if (languageCode) {
|
|
htmlElement.setAttribute('lang', languageCode);
|
|
} else {
|
|
htmlElement.removeAttribute('lang');
|
|
}
|
|
};
|