node.js - i18next changes language without any input -


i trying set i18next on node.js app. have 2 languages : fr-ca , en-us.

i have fr-ca default language. set in app.js, before configuration, :

i18next.init({   debug: true,    lng: 'fr-ca',    ignoreroutes: [    'img/',     'public/',      'stylesheets/',      'js/'   ] }); 

here folder structure

locales/   dev/     translation.json   en/     translation.json   fr-ca/     translation.json   fr/     translation.json 

i console log on server launch see what's i18next.lng() value, , says fr-ca. however, load page, console says currentlng set to: en-us. tries load locales/en/translation.json file.

the debug shows when launching server loads fr-ca, fr , dev files. page launches loads en file , it's forgot fr-ca. browser in english guess takes value there. can't seem find why changes.

did miss here?

thanks

defining fallbacklanguage done setting fallbacklng not lng!

i18next.init({   debug: true,    fallbacklng: 'fr-ca',    ignoreroutes: [    'img/',     'public/',      'stylesheets/',      'js/'   ] }); 

Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

How to mention the localhost in android -

php - Calling a template part from a post -