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

Stricter Locale parsing #597

Merged
merged 6 commits into from
Apr 22, 2022

Conversation

lukellmann
Copy link
Member

@lukellmann lukellmann commented Apr 17, 2022

See #594 (comment) (only allow - as separator between language and country)

Additional changes:

  • only allow [a-z] for language and [A-Z] for country (is this actually desirable?)
  • throw IllegalArgumentException instead of IllegalStateException
  • coerce empty country to null for unknown Locales and JLocale to Locale conversion

@lukellmann lukellmann requested a review from DRSchlaubi April 17, 2022 03:10
common/src/main/kotlin/Locale.kt Outdated Show resolved Hide resolved
common/src/main/kotlin/Locale.kt Outdated Show resolved Hide resolved
Co-authored-by: Michael Rittmeister <[email protected]>
@lukellmann lukellmann requested a review from DRSchlaubi April 18, 2022 19:01
@HopeBaron HopeBaron merged commit 6334d7e into kordlib:0.8.x Apr 22, 2022
@lukellmann lukellmann deleted the changes/stricter-locale-parsing branch April 23, 2022 00:43
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