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

CultureInfo support for errors #1040

Merged
merged 2 commits into from
Jan 30, 2023
Merged

CultureInfo support for errors #1040

merged 2 commits into from
Jan 30, 2023

Conversation

MikeStall
Copy link
Contributor

@MikeStall MikeStall commented Jan 29, 2023

Allow Errors to be in separate culture info that parser.
Fix #918, and also #1039. Sets up a fix for #990.

Make ExpressionError.Message localize lazily.

  • Callers can get the localized message in any culture after the parse/bind
  • just checking IsSuccess can then avoid localization since that doesn't read the message property

Add test to ensure we're not using Thread.CurrentCulture when a culture is provided.

  • Update a bunch of usages. StartsWith(), EndsWith() ,etc require StringComparison.Ordinal, else they will check current culture.
  • RegEx required CultureInvariant

Add more tests

  • add ExpressionErrorTests to get 100% code coverage on ExpressionError.
  • add MultiCulture* tests to demonstrate how we can set Parse/ErrorMessage/Runtime cultures independently
  • remove parserOptions usage in LSP that wasn't being used.

@LucGenetier
Copy link
Contributor

✅ No public API change.

LucGenetier
LucGenetier previously approved these changes Jan 30, 2023
Copy link
Contributor

@LucGenetier LucGenetier left a comment

Choose a reason for hiding this comment

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

:shipit:

LSP update - remove unused field

code coverage

pass tests

SPLIT into separate PR: Fix other bug in Eval

Passing all existing tests

Locale tests w/ BombCulture.
@LucGenetier
Copy link
Contributor

✅ No public API change.

Copy link
Contributor

@anderson-joyle anderson-joyle left a comment

Choose a reason for hiding this comment

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

:shipit:

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.

Texl errors are not localized
3 participants