Fix logic for setting the locale when using System Default#4570
Merged
FreeTubeBot merged 1 commit intoFreeTubeApp:developmentfrom Jan 19, 2024
Merged
Conversation
PikachuEXE
approved these changes
Jan 18, 2024
Member
PikachuEXE
left a comment
There was a problem hiding this comment.
To avoid logging out to test this
I stub the result by adding return 'en-US' & return 'en-GB' before return app.getSystemLocale()
kommunarr
approved these changes
Jan 18, 2024
absidue
reviewed
Jan 19, 2024
|
|
||
| ipcMain.handle(IpcChannels.GET_SYSTEM_LOCALE, () => { | ||
| return app.getLocale() | ||
| // we should switch to getPreferredSystemLanguages at some point and iterate through until we find a supported locale |
Member
There was a problem hiding this comment.
For the non-electron fallback we can use navigator.languages instead of navigator.language.
absidue
approved these changes
Jan 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix logic for setting the locale when using
System DefaultPull Request Type
Related issue
closes #3360
Description
The comparison being done was incorrect and didn't check the country code.
Testing
Test 1 - en-US as system locale
en-USSystem Default)Test 2 - en-UK as system locale
en-USen-UKSystem default)Desktop
Additional context
Bug was introduced in #2271