Skip to content

Commit

Permalink
Allow i18n with "-"
Browse files Browse the repository at this point in the history
  • Loading branch information
aguingand committed Jan 22, 2024
1 parent 962318f commit fee3403
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/formoj/src/util/i18n.js
Expand Up @@ -17,6 +17,11 @@ export function createI18nConfig(customs = {}) {

export function getDefaultLocale() {
const langAttribute = document.documentElement.getAttribute('lang');

if(langAttribute in i18n) {
return langAttribute;
}

return langAttribute
? langAttribute.split('-')[0]
: 'en';
Expand Down

0 comments on commit fee3403

Please sign in to comment.