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

Removed unnecessary "en-US" CultureInfo #174

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

Blaisor
Copy link
Contributor

@Blaisor Blaisor commented Jul 12, 2024

Removed unnecessary instantiation of "en-US" CultureInfo to allow globalization invariant mode.
See: https://aka.ms/GlobalizationInvariantMode

@bradymholt
Copy link
Owner

I read the docs in the link you provided and am still not sure what the implications of this change are. Can you elaborate on the implications and reason for this change?

@Blaisor
Copy link
Contributor Author

Blaisor commented Jul 13, 2024

Sure. Now if you enable globalization invariant mode in a .NET project, once it tries to use ExpressionParser, it throws an exception:

Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name') en-US is an invalid culture identifier.

What I did is to remove that particular CultureInfo instance which is only used in generating month names, but in this case the invariant culture could produce exact same names. But with this small change, any project can enable <InvariantGlobalization> without any issues.

@phillip-haydon
Copy link

I happen to have this exact same issue. Deploying to linux with <InvariantGlobalization>true</InvariantGlobalization> causes an exception. I thought I could override this using the options locale but line 40 causes it to throw up :(

@phillip-haydon
Copy link

As a work-around for this I had to install the locales on linux; icu for it to work. Bit of a hassle when I don't need globalization support.

@bradymholt bradymholt merged commit 1a6f1ad into bradymholt:master Jul 15, 2024
3 checks passed
@bradymholt
Copy link
Owner

Thanks!

Copy link

The changes in PR were just released in 2.36.0 🎉.

@Blaisor Blaisor deleted the invariant-culture branch July 16, 2024 00:47
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.

3 participants