Skip to content

refactor fallback locale 🌋#739

Open
darcywong00 wants to merge 1 commit into
stagingfrom
fix/redirect-fallback
Open

refactor fallback locale 🌋#739
darcywong00 wants to merge 1 commit into
stagingfrom
fix/redirect-fallback

Conversation

@darcywong00
Copy link
Copy Markdown
Contributor

Addresses review comment #733 (comment) by taking a subset of those changes

I think we want our URLs to redirect if a fallback is encountered, rather than accepting es-Fooo-BA as a substitute for es. And we don't want case insensitivity either; we don't want es, eS, Es, and ES all to return the same document, because URLs are case sensitive. So ...

  • Locale::setLocaleFromURL() changes
    • tweak the regex to be case-sensitive (capitalize script and region)
    • redirect to the fallback locale (if found)

This way, es-Fooo-BA and es-ES redirect to es.

Unspecified locale still redirects to en

Test-bot: skip

If a specified locale like `es-ES` is given in the path, handle the fallback to redirect to `es`
@darcywong00 darcywong00 added this to the A19S29 milestone May 14, 2026
@darcywong00 darcywong00 requested a review from mcdurdin May 14, 2026 08:41
@keymanapp-test-bot
Copy link
Copy Markdown

User Test Results

Test specification and instructions

User tests are not required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants