-
-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fallbackLng as default lng #1552
Comments
It's just a fallback behaviour if no language and language detector is defined... |
btw: you may also define ru as fallbackLng here: https://github.com/ogarich89/iso/blob/feature/i18next/src/shared/libs/i18n.ts#L11 |
I define language here: https://github.com/ogarich89/iso/blob/feature/i18next/src/server/middleware/i18next.ts#L24 Before version 19.8.5 everything worked fine |
The problem is this: https://github.com/ogarich89/iso/blob/feature/i18next/src/server/middleware/i18next.ts#L13 You are defining a fallbackLng, but i18next does not know this... it know 'en' from here: https://github.com/ogarich89/iso/blob/feature/i18next/src/shared/libs/i18n.ts#L11 in init it is 'en' and outside of i18next you define 'ru' and call changeLanguage afterwards... So if you want ru to be the fallbackLng i18next needs to know it here: https://github.com/ogarich89/iso/blob/feature/i18next/src/shared/libs/i18n.ts#L11 The i18nextMiddleware only runs on server side, so I suspect there is some sort of timing issue |
I suspect the changeLanguage call is done before i18next has finished to initialize |
It did not help =( |
what did not help? |
Before update i18next before.movAfter update to 19.8.5 after.mov |
i18next.isInitialized return true before call changeLanguage |
on server side probably it's initialized, but on client side I don't think so |
Should be better with v19.8.8 |
Why did you change the behavior in the patch version?
19.8.5 - "use fallbackLng as default lng"
After update, language is always taken from "fallbackLng"
![image](https://user-images.githubusercontent.com/11867673/107884659-3899f480-6f07-11eb-97dd-fcea5ab1a4f4.png)
The behavior can be viewed in this repository
https://github.com/ogarich89/iso/tree/feature/i18next
The text was updated successfully, but these errors were encountered: