-
Notifications
You must be signed in to change notification settings - Fork 158
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
feat: use user's preferred language on first launch if available #2490
Conversation
@danielweck any feedback on this? Our users would love to have this feature in a future release. |
I agree with @ddfreiling that this is very useful, but I would advise against using just the first language found through It's important to check for all BCP 47 language tags returned by
Since Thorium 3.1 will introduce improvements to voice selection based on system languages, this would be a nice addition for this release as well. |
…launch * upstream/develop: feat (reader): save/apply/reset preferred reading settings (Fixes edrlab#2530 Fixes edrlab#2532 PR edrlab#2533) fix (main): initialize missing keys from reader.defaultConfig in memory.ts preloadedState chore (refactor): comment session.state unused and disable the force reset of the global defaultConfig at start
prevents edge-case issue with 3-letter language lang codes
@danielweck this should be ready for review |
I think we need to check the double default locale initialization set to "en" value in first. Maybe I'm wrong, I will check an eye quickly on your PR if you allows me. Or Daniel will do, if he prefers. here :
and here :
|
Yes, there are definitely some optimizations, so that "en" is not set just before another locale match is. This PR was meant to get the ball rolling on that. I'm not a saga wiz :) |
good point Pierre, we need to check the initialisation lifecycle. |
Should I just check that a matched locale is not the default at start-up? So that we don't set |
Hello ddfreiling, I refactor the translator to rely mostly on the redux locale value to update/trigger the translator function and refresh all the react components if needed. I've setup the PR in draft mode to review it. I took advantage of it to refactor the initialization of both renderer processes (library and reader). FYI: This is the chunk of code to initialize the locale value with the preferred system language : |
Seems like a good refactor, but I don't see how my locale will be matched if my system returns |
On Mac os :
same on Linux and I cannot test on windows machine So like you suggest I propose to check from the array for the first match of the entire bcp47 code and otherwise the 2 digits code lang only. |
Yes I agree this would be the way to go 👍 |
Hi EDRLab.
During our testing of our LCP implementation in Nota, our users complained that Thorium Reader wasn't using the same language as their OS when first launching it. I have tried to implement this, but do not have much experience with using Electron and saga.
Please feel free to recommend a more optimal way to do this. The logic around doing this on first launch, using a dummy file, feels a little rudimentary.