Fix: Use full browser provided language tag

instead of limiting to only the primary tag

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-11-23 18:48:44 +01:00
parent fde887bb6a
commit ff91301acc
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

View file

@ -18,7 +18,7 @@ const cookieSet = Object.fromEntries(document.cookie.split('; ')
.map(el => decodeURIComponent(el))))
const i18n = new VueI18n({
locale: cookieSet.lang?.split(/[_-]/)[0] || navigator?.language?.split(/[_-]/)[0] || 'en',
locale: cookieSet.lang || navigator?.language || 'en',
fallbackLocale: 'en',
messages,
})