summaryrefslogtreecommitdiff
path: root/spec/frontend/helpers/locale_helper.js
blob: 283d9bc14c9609b766217db205c7155ee7e899a0 (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');
  }
};