Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

162
Vistas
i18next mapping en-US locale to en namespace folder/file

Sorry if I am not asking this question correctly, currently, our system uses i18next with the i18next-http-backend and i18next-browser-languagedetector. The browser, using i18next-browser-languagedetector returns en-US when the browser is using an English locale setting. However the nodejs app is set up with the i18next-http-backend in a way where the translations are set up in english for /public/locales/en/language.json. Now the problem is, the i18next package relies on the fallback language because, en-US does not map to the en (/public/locales/en/) namespace/folder location.

I know, it would be very simple enough to just rename the folder or simple enough to change the fallback language to en.

But I feel like there is a way to map this or an alternative way that i can't figure out and can't find in the docs so I am wondering if its possible, that when the languagedetector detects en-US locale, it will map to the /public/locales/en/ location

any help is appreciated, thanks in advance!

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You have to add: nonExplicitSupportedLngs: true, in the i18next config file, for example:

i18next
    ...
    .use(LanguageDetector)
    .init({
        supportedLngs: ['en', 'es'],
        nonExplicitSupportedLngs: true, //support language variation
        ...
    });
over 4 years ago · Santiago Trujillo Denunciar

0

Alternatively, set the load option to 'languageOnly': https://www.i18next.com/overview/configuration-options#languages-namespaces-resources enter image description here

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda