fix: regional languages not matching correctly

This commit is contained in:
Matt Kilgore
2024-09-05 15:48:00 -04:00
committed by GitHub
parent 0ab95fb670
commit 7c855cf55d

View File

@@ -7,7 +7,7 @@ export default defineNuxtPlugin(({ vueApp }) => {
let matched = null;
const languages = Object.getOwnPropertyNames(messages())
languages.forEach(lang => {
if (lang === navigator.language) {
if (lang === navigator.language.replace('-', '_')) {
matched = lang;
}
});