You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to change the language with the using of the LanguageDetector package, When i set the fallback langauge as en or ar it works pretty fine but after it is being set if i try to change the language that doesn't work even tho i see this log when i set debug: true
// logs on each request that i have Accept-Language Header set to ar
i18next: languageChanged en
i18next: languageChanged ar
i18next::translator: missingKey en zod email email
Config
// configure dotenv before every thing, even importsimport*asdotenvfrom'dotenv';import{join,resolve}from'path';dotenv.config({path: resolve(__dirname,'.env')});import{NestFactory}from'@nestjs/core';import{AppModule}from'./app.module';importi18nextfrom'i18next';importenTranslationsfrom'zod-i18n-map/locales/en/zod.json';import{z}from'zod';import{makeZodI18nMap}from'zod-i18n-map';importlanguageDetectorfrom'i18next-http-middleware';importi18nextBackendfrom'i18next-fs-backend';importarTranslationsfrom'zod-i18n-map/locales/ar/zod.json';importenTranslationsfrom'zod-i18n-map/locales/en/zod.json';asyncfunctionbootstrap(){constapp=awaitNestFactory.create(AppModule);app.use(languageDetector.handle(i18next));awaiti18next.use(i18nextBackend).use(languageDetector.LanguageDetector).init({debug: true,supportedLngs: ['en','ar'],fallbackLng: 'en',resources: {ar: {zod: arTranslations},en: {zod: enTranslations},},});z.setErrorMap(makeZodI18nMap({ns: 'zod',t: i18next.t}));app.use(compression());awaitapp.listen(3000);}bootstrap();
Expected behavior
to return the message as 'ar' instead of the fallbackLng
💥 Regression Report
I am unable to change the language with the using of the LanguageDetector package, When i set the fallback langauge as en or ar it works pretty fine but after it is being set if i try to change the language that doesn't work even tho i see this log when i set
debug: true
Config
Expected behavior
to return the message as 'ar' instead of the fallbackLng
Your Environment
Debug
The text was updated successfully, but these errors were encountered: