summaryrefslogtreecommitdiff
path: root/spec/frontend/__helpers__/locale_helper.js
blob: bb4a2eccf4e95b035bd212b32a03012f2cece6ff (plain)
1
2
3
4
5
6
7
8
9
export const setLanguage = (languageCode) => {
  const htmlElement = document.querySelector('html');

  if (languageCode) {
    htmlElement.setAttribute('lang', languageCode);
  } else {
    htmlElement.removeAttribute('lang');
  }
};