chore(config): add defaultI18nConfig to avoid state issue

This commit is contained in:
JiPai
2024-11-13 13:54:36 +08:00
parent b376ead7b5
commit fb0308fd60

View File

@@ -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,
},
),
);