From fb0308fd608960d946e23f5f0da0c59ec8c309cb Mon Sep 17 00:00:00 2001 From: JiPai Date: Wed, 13 Nov 2024 13:54:36 +0800 Subject: [PATCH] chore(config): add defaultI18nConfig to avoid state issue --- apps/dokploy/pages/_app.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/dokploy/pages/_app.tsx b/apps/dokploy/pages/_app.tsx index c8e00aca..b5fcb131 100644 --- a/apps/dokploy/pages/_app.tsx +++ b/apps/dokploy/pages/_app.tsx @@ -61,4 +61,21 @@ const MyApp = ({ ); }; -export default api.withTRPC(appWithTranslation(MyApp)); +export default api.withTRPC( + appWithTranslation( + MyApp, + // keep this in sync with next-i18next.config.js + // if you want to know why don't just import the config file, this because next-i18next.config.js must be a CJS, but the rest of the code is ESM. + // Add the config here is due to the issue: https://github.com/i18next/next-i18next/issues/2259 + // if one day every page is translated, we can safely remove this config. + { + i18n: { + defaultLocale: "en", + locales: ["en", "zh-Hans"], + localeDetection: false, + }, + fallbackLng: "en", + keySeparator: false, + }, + ), +);