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(app): do not crash when you get a "C" locale #16716

Merged
merged 4 commits into from
Nov 7, 2024

Conversation

sfoster1
Copy link
Member

@sfoster1 sfoster1 commented Nov 6, 2024

Some linux systems are configured with one of the POSIX default locales, like "C" or "POSIX", and for some reason this will be returned by electron's getSystemPreferredLanguages() api directly. Unfortunately, passing this to the browser js standard Intl.Locale() will make it throw, and that would whitescreen the app. Instead, catch the error and treat it as an unmatched system language.

Note that this crashes even if the feature flag isn't on.

Some linux systems are configured with one of the POSIX default locales,
like "C" or "POSIX", and for some reason this will be returned by
electron's getSystemPreferredLanguages() api directly. Unfortunately,
passing this to the browser js standard Intl.Locale() will make it
throw, and that would whitescreen the app. Instead, catch the error and
treat it as an unmatched system language.
@sfoster1 sfoster1 requested review from smb2268 and mjhuff November 6, 2024 22:33
@sfoster1 sfoster1 requested a review from a team as a code owner November 6, 2024 22:33
Copy link
Contributor

@mjhuff mjhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad someone is testing Linux!

@sfoster1 sfoster1 merged commit 78f6791 into chore_release-8.2.0 Nov 7, 2024
30 checks passed
@sfoster1 sfoster1 deleted the fix-app-locale-crashes-linux branch November 7, 2024 13:36
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.

2 participants