-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixed ReferenceError caused by undefined lang variable in i18next #4947
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
base: master
Are you sure you want to change the base?
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
6e333bd to
cd77e78
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
cd77e78 to
2eb6ef7
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
Fix ReferenceError by defining default language for i18next
2eb6ef7 to
3781aaa
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender I ran npm run lint and npx prettier --check locally and both pass without any issues. The ESLint failure in CI seems to be related to the workflow trying to lint a file path that doesn’t resolve correctly in the GitHub Actions environment (Linux), not due to a linting or formatting error in this PR’s code. |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender Yes I was testing on local server , maybe the issue was that my earlier code made i18next initialization blocking. When locales/en.json failed to load over file://, the promise never resolved, so MB never reached requirejs(["utils/utils", "activity/activity"]). I’ve updated the code so i18next always resolves (errors are logged), restoring the old behavior. Could you please check if MB is opening now? |


Description
This PR fixes a runtime ReferenceError caused by an undefined lang variable during i18next initialization.
The application previously called i18next.changeLanguage(lang, ...) without defining lang, which resulted in a console error and interrupted the language initialization flow.
Changes Made
Defined a default language ("en") before calling i18next.changeLanguage
Ensured the language change occurs only after i18next is successfully initialized
Expected Behavior
The application initializes i18next without throwing any runtime errors, and translations load correctly using the default language.
closes #4946