diff --git a/web/i18n/languages.json b/web/i18n/languages.json index 0ef3695e..eebe07d4 100644 --- a/web/i18n/languages.json +++ b/web/i18n/languages.json @@ -1,5 +1,5 @@ { "en": "english", "ru": "русский", - "zh-CN": "中文" + "zh": "中文" } diff --git a/web/i18n/zh-cn/a11y/dialog.json b/web/i18n/zh/a11y/dialog.json similarity index 100% rename from web/i18n/zh-cn/a11y/dialog.json rename to web/i18n/zh/a11y/dialog.json diff --git a/web/i18n/zh-cn/a11y/donate.json b/web/i18n/zh/a11y/donate.json similarity index 100% rename from web/i18n/zh-cn/a11y/donate.json rename to web/i18n/zh/a11y/donate.json diff --git a/web/i18n/zh-cn/a11y/general.json b/web/i18n/zh/a11y/general.json similarity index 100% rename from web/i18n/zh-cn/a11y/general.json rename to web/i18n/zh/a11y/general.json diff --git a/web/i18n/zh-cn/a11y/save.json b/web/i18n/zh/a11y/save.json similarity index 100% rename from web/i18n/zh-cn/a11y/save.json rename to web/i18n/zh/a11y/save.json diff --git a/web/i18n/zh-cn/a11y/tabs.json b/web/i18n/zh/a11y/tabs.json similarity index 100% rename from web/i18n/zh-cn/a11y/tabs.json rename to web/i18n/zh/a11y/tabs.json diff --git a/web/i18n/zh-cn/about.json b/web/i18n/zh/about.json similarity index 100% rename from web/i18n/zh-cn/about.json rename to web/i18n/zh/about.json diff --git a/web/i18n/zh-cn/about/credits.md b/web/i18n/zh/about/credits.md similarity index 100% rename from web/i18n/zh-cn/about/credits.md rename to web/i18n/zh/about/credits.md diff --git a/web/i18n/zh-cn/about/general.md b/web/i18n/zh/about/general.md similarity index 100% rename from web/i18n/zh-cn/about/general.md rename to web/i18n/zh/about/general.md diff --git a/web/i18n/zh-cn/about/privacy.md b/web/i18n/zh/about/privacy.md similarity index 100% rename from web/i18n/zh-cn/about/privacy.md rename to web/i18n/zh/about/privacy.md diff --git a/web/i18n/zh-cn/about/terms.md b/web/i18n/zh/about/terms.md similarity index 100% rename from web/i18n/zh-cn/about/terms.md rename to web/i18n/zh/about/terms.md diff --git a/web/i18n/zh-cn/button.json b/web/i18n/zh/button.json similarity index 100% rename from web/i18n/zh-cn/button.json rename to web/i18n/zh/button.json diff --git a/web/i18n/zh-cn/dialog.json b/web/i18n/zh/dialog.json similarity index 100% rename from web/i18n/zh-cn/dialog.json rename to web/i18n/zh/dialog.json diff --git a/web/i18n/zh-cn/donate.json b/web/i18n/zh/donate.json similarity index 100% rename from web/i18n/zh-cn/donate.json rename to web/i18n/zh/donate.json diff --git a/web/i18n/zh-cn/error.json b/web/i18n/zh/error.json similarity index 100% rename from web/i18n/zh-cn/error.json rename to web/i18n/zh/error.json diff --git a/web/i18n/zh-cn/general.json b/web/i18n/zh/general.json similarity index 100% rename from web/i18n/zh-cn/general.json rename to web/i18n/zh/general.json diff --git a/web/i18n/zh-cn/notification.json b/web/i18n/zh/notification.json similarity index 100% rename from web/i18n/zh-cn/notification.json rename to web/i18n/zh/notification.json diff --git a/web/i18n/zh-cn/receiver.json b/web/i18n/zh/receiver.json similarity index 100% rename from web/i18n/zh-cn/receiver.json rename to web/i18n/zh/receiver.json diff --git a/web/i18n/zh-cn/remux.json b/web/i18n/zh/remux.json similarity index 100% rename from web/i18n/zh-cn/remux.json rename to web/i18n/zh/remux.json diff --git a/web/i18n/zh-cn/save.json b/web/i18n/zh/save.json similarity index 100% rename from web/i18n/zh-cn/save.json rename to web/i18n/zh/save.json diff --git a/web/i18n/zh-cn/settings.json b/web/i18n/zh/settings.json similarity index 100% rename from web/i18n/zh-cn/settings.json rename to web/i18n/zh/settings.json diff --git a/web/i18n/zh-cn/tabs.json b/web/i18n/zh/tabs.json similarity index 100% rename from web/i18n/zh-cn/tabs.json rename to web/i18n/zh/tabs.json diff --git a/web/i18n/zh-cn/updates.json b/web/i18n/zh/updates.json similarity index 100% rename from web/i18n/zh-cn/updates.json rename to web/i18n/zh/updates.json diff --git a/web/src/lib/i18n/translations.ts b/web/src/lib/i18n/translations.ts index 91c36315..9a65c761 100644 --- a/web/src/lib/i18n/translations.ts +++ b/web/src/lib/i18n/translations.ts @@ -21,7 +21,7 @@ for (const [path, loader] of Object.entries(locFiles)) { }; } -const defaultLocale = 'zh-cn'; +const defaultLocale = 'en'; const languages: Record = _languages; const config: Config<{ diff --git a/web/src/routes/+layout.ts b/web/src/routes/+layout.ts index 69311c7e..c9bd1572 100644 --- a/web/src/routes/+layout.ts +++ b/web/src/routes/+layout.ts @@ -12,9 +12,12 @@ export const load: Load = async ({ url }) => { const { pathname } = url; let preferredLocale = defaultLocale; + console.log("preferredLocale 1=========>", preferredLocale); + if (browser) { preferredLocale = get((await import('$lib/i18n/locale')).default); + console.log("preferredLocale 2=========>", preferredLocale); } await loadTranslations(preferredLocale, pathname);