mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-29 18:08:28 +00:00
是包名取错了,应该是zh而不是zh-cn.这样仍用原来的代码逻辑是对的。
This commit is contained in:
parent
90a54781ef
commit
61453fb63e
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"en": "english",
|
"en": "english",
|
||||||
"ru": "русский",
|
"ru": "русский",
|
||||||
"zh-CN": "中文"
|
"zh": "中文"
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ for (const [path, loader] of Object.entries(locFiles)) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultLocale = 'zh-cn';
|
const defaultLocale = 'en';
|
||||||
const languages: Record<string, string> = _languages;
|
const languages: Record<string, string> = _languages;
|
||||||
|
|
||||||
const config: Config<{
|
const config: Config<{
|
||||||
|
@ -12,9 +12,12 @@ export const load: Load = async ({ url }) => {
|
|||||||
const { pathname } = url;
|
const { pathname } = url;
|
||||||
|
|
||||||
let preferredLocale = defaultLocale;
|
let preferredLocale = defaultLocale;
|
||||||
|
console.log("preferredLocale 1=========>", preferredLocale);
|
||||||
|
|
||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
preferredLocale = get((await import('$lib/i18n/locale')).default);
|
preferredLocale = get((await import('$lib/i18n/locale')).default);
|
||||||
|
console.log("preferredLocale 2=========>", preferredLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
await loadTranslations(preferredLocale, pathname);
|
await loadTranslations(preferredLocale, pathname);
|
||||||
|
Loading…
Reference in New Issue
Block a user