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

Filter out bad locales and fail gracefully #239

Merged
merged 2 commits into from
Mar 10, 2025
Merged

Conversation

bearfriend
Copy link
Contributor

@bearfriend bearfriend commented Mar 10, 2025

GAUD-7600: intl: Filter bad locales and fail gracefully

In addition to the invalid en-US@posix locale, some environments have an empty string. This fix is in addition to setting the LANG env var, which is preferable to these fallbacks and failures.

  • Fall back to defaultLocale
  • Filter out invalid locales
  • Fail gracefully via try-catch

@bearfriend bearfriend requested a review from a team as a code owner March 10, 2025 20:38
@bearfriend bearfriend requested review from a team and removed request for a team March 10, 2025 20:48
@bearfriend bearfriend merged commit 00bc79d into main Mar 10, 2025
2 checks passed
@bearfriend bearfriend deleted the dgleckler/filter-locales branch March 10, 2025 20:50
@nathankoop
Copy link

Can we add some tests to this code?
Not needing it to block this merge, but as a task for us to do tomorrow?

@bearfriend
Copy link
Contributor Author

Can we add some tests to this code? Not needing it to block this merge, but as a task for us to do tomorrow?

Yep, that's on the agenda

Copy link

🎉 This PR is included in version 3.25.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants