Skip to content

fix: case-insensitive locale tag comparison in resolveLocale - #13

Merged
Anty0 merged 1 commit into
masterfrom
jirikuchynka/fix-locale-case-sensitivity
Feb 24, 2026
Merged

fix: case-insensitive locale tag comparison in resolveLocale#13
Anty0 merged 1 commit into
masterfrom
jirikuchynka/fix-locale-case-sensitivity

Conversation

@Anty0

@Anty0 Anty0 commented Feb 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix resolveLocale() to use case-insensitive locale tag matching instead of Locale.equals(), which compares fields case-sensitively and fails for locales with region/script like zh-Hans or pt-BR
  • Fix preloadAll() filter to use the same case-insensitive comparison for consistency
  • Add ResolveLocaleTest with 8 test cases covering exact match, case-insensitive script/region, fallback chains, default language, and edge cases

Closes #12

Locale tags with region or script (e.g. zh-Hans, pt-BR) failed to match
because Locale.equals() compares fields case-sensitively. Use lowercase
tag-based lookup instead, preserving the original locale casing for CDN
file paths.

Closes #12

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Anty0
Anty0 merged commit 28cba7b into master Feb 24, 2026
4 checks passed
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.

Setting locales with region or script doesn't work due to case sensitive locale tag comparison

1 participant