Skip to content
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

Fix loading non-default language files leaving runtime in wrong locale #3225

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

knolleary
Copy link
Member

  • Bugfix (non-breaking change which fixes an issue)

https://discourse.nodered.org/t/2-0-6-shows-different-node-errors-in-different-languages/51693

In some rare occasions, the runtime was randomly emitting log messages in the wrong locale.

This could happen if someone requests a message catalog in the a non-default locale (eg http://localhost:1880/locales/node-red?lng=ja). The slightly hacky way these requests were handled, meant the i18n subsystem was switched to the desired language, the catalog loaded, then switched back to the primary runtime language.

However the restore of the language was happening in parallel which could leave it in an inconsistent state.

This improves the sequencing to reduce the chances of this happening. However the overall logic is not ideal and we do need a way to load non-default catalogues without modifying the current default.

@knolleary knolleary merged commit fb15375 into master Oct 25, 2021
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.007%) to 67.387% when pulling 4f175fc on i18n-fix into 2d4ca7c on master.

@knolleary knolleary deleted the i18n-fix branch May 3, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants