Skip to content

Preserve exact locale matches - #1910

Closed
peepsii wants to merge 1 commit into
PaperMC:dev/4.0.0from
peepsii:fix/exact-locale-matching
Closed

peepsii wants to merge 1 commit into
PaperMC:dev/4.0.0from
peepsii:fix/exact-locale-matching

Conversation

@peepsii

@peepsii peepsii commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #1909.

When both US English and Pirate English are registered, the last registered locale currently replaces both exact matches. Keep the full set of known locales and check it before falling back to a locale with the same language.

Remove the lookup cache so a locale registered after an earlier lookup takes effect immediately. Keep the existing fallback choice for unknown regional variants and the existing handling of Chinese locales.

Validation:

  • Added seven regression cases covering both registration orders, same-language fallback, unknown languages, late registration, and Chinese regional variants.
  • Four of these cases fail before the fix and all seven pass after it.
  • ./gradlew build passes with JDK 25, including all 227 proxy tests and the style checks.

@peepsii peepsii closed this by deleting the head repository Oct 30, 2026
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.

ClosestLocaleMatcher replaces exact locales with the last registered variant (en_US / en_PT)

1 participant