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

✨Fallback to invariant culture if cultures are not found #1266

Merged
merged 1 commit into from
Jun 18, 2023

Conversation

angularsen
Copy link
Owner

@angularsen angularsen commented Jun 18, 2023

Fixes #1238

Applications crashed when running on Linux or Raspberry PI systems if .NET cultures were not installed.

Specifically, UnitAbbreviationsCache.Default threw an exception trying to instantiate the fallback CultureInfo with en-US.

Changes

  • Change fallback culture to InvariantCulture
  • Add CultureHelper.GetCultureOrInvariant() to handle CultureNotFoundException
  • Change UnitInfo to map invariant culture to en-US localization

Applications crashed when running on Linux or Raspberry PI systems if .NET cultures were not installed.
Specifically, `UnitAbbreviationsCache.Default` threw an exception trying to instantiate "en-US" `CultureInfo`.

### Changes
- Change fallback culture to `InvariantCulture`
- Add `CultureHelper.GetCultureOrInvariant()` to handle `CultureNotFoundException`
@angularsen
Copy link
Owner Author

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