diff --git a/src/i18n.ts b/src/i18n.ts index e778ad7..86433b4 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -10,18 +10,13 @@ const supportedLngs = { const getLanguageToUse = () => { const languages = navigator.languages - console.log('preferred language order:', JSON.stringify(languages)) for (const language of languages) { for (const pair of Object.entries(supportedLngs)) { const code = pair[0] const regex = pair[1] - if (regex.test(language)) { - console.log('using language:', code) - return code - } + if (language.match(regex)) return code } } - console.log('using fallback language: en') return 'en' }