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

165
Vistas
i18Next: use locale only for some languages and use language + location for rest

I have a question for the i18next library. If I have these set of locales that are possible to be detected from the browser,

de
en-US
es
fr
it
ja
ko
pt-br
zh-cn
zh-tw

Is there a way to configure it where it respects the language only for some locales and not the other? for example, when it comes to en-US, I wish for the loaded language to be en so when I call the .language or .languages method, it will contain en instead of en-US. However, for the other locales that have a dash like pt-br, zh-cn, and zh-tw, they will remain untouched, (so NOT return just zh).

Is this possible?

thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Yes, make use of the configuration options: https://www.i18next.com/overview/configuration-options

With the load option set to "all", it will first check for "en-US" and if not found, it will use "en"... and the i18next.resolvedLanguage value will be "en"

There are also other configuration options, like supportedLngs, or fallbackLng you could use to tune your use case.

about 4 years ago · Juan Pablo Isaza 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