mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-27 01:06:29 +01:00
Change Intl.Locale to basic string
Safari < 14 cannot use Intl.Locale
This commit is contained in:
parent
96ddf54859
commit
c38c469fdd
1 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ $locale.subscribe((value) => {
|
||||||
currentLocale = value;
|
currentLocale = value;
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
localStorage.setItem('locale', new Intl.Locale(value).language);
|
localStorage.setItem('locale', value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ export function startClient() {
|
||||||
|
|
||||||
init({
|
init({
|
||||||
...INIT_OPTIONS,
|
...INIT_OPTIONS,
|
||||||
initialLocale: savedLocale !== null ? savedLocale : getLocaleFromNavigator(),
|
initialLocale: savedLocale !== null ? savedLocale : getLocaleFromNavigator().substring(0, 2),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ export function i18nMiddleware() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locale != null && locale !== currentLocale) {
|
if (locale != null && locale !== currentLocale) {
|
||||||
$locale.set(locale);
|
$locale.set(locale.substring(0, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|
Loading…
Reference in a new issue