Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!