-
Notifications
You must be signed in to change notification settings - Fork 87
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
frontend: lazy-load languages #2993
base: master
Are you sure you want to change the base?
Conversation
6221394
to
58af16b
Compare
58af16b
to
8ac388b
Compare
Fixed the loading of the language, but not that happy with the implementation with the changing boolean. |
68e8970
to
94f9b63
Compare
Fixed the test and squashed my commits. Should work now. |
Thank you so much @cstenglein ! One thing please change the prefix in the commit message from |
94f9b63
to
91d7407
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @cstenglein
// This is ok since we're just checking for a truthy value in the language detector. | ||
return getNativeLocale().then((nativeLocale) => { | ||
// load the default language first | ||
loadLanguage(defaultLang); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a small bug in the Qt app:
When the userLanguage in config.json is an empty string (or not defined) the Qt BBApp will always start with English instead of using the native language.
We purposely store an empty string in case the user changes the language to be the same as the system.
How to test:
- change system to something else than English, i.e. German
- change userLanguage to empty string in
~/Library/Application\ Support/bitbox/config.json
- open the Qt app, English loads, but expected is that the BBapp loads in German
I can't reproduce this well in webdev as native-locale gives me an empty string on webdev so it always goes to En for me in webdev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played a bit around and the 2nd commit in #3053 fixes the issue for me. Could you test with this and if it works for you squash it into your commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes #1547
Before
After
Shouldn't have that much impact though since the languages are loaded locally.