feat(i18n): Set the page language according to the browser default language
This commit is contained in:
parent
7d9790ad5a
commit
2999b9b50a
@ -3,9 +3,11 @@ import { get } from '@vueuse/core';
|
|||||||
import type { Plugin } from 'vue';
|
import type { Plugin } from 'vue';
|
||||||
import { createI18n } from 'vue-i18n';
|
import { createI18n } from 'vue-i18n';
|
||||||
|
|
||||||
|
const localeLang = navigator.language || navigator.languages[0] || 'en';
|
||||||
|
|
||||||
const i18n = createI18n({
|
const i18n = createI18n({
|
||||||
legacy: false,
|
legacy: false,
|
||||||
locale: 'en',
|
locale: localeLang.split('-')[0],
|
||||||
fallbackLocale: 'en',
|
fallbackLocale: 'en',
|
||||||
messages,
|
messages,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user