fix(i18n): better filtering and search for preferred locales#9019
Merged
ematipico merged 2 commits intofeat/i18n-routingfrom Nov 8, 2023
Merged
fix(i18n): better filtering and search for preferred locales#9019ematipico merged 2 commits intofeat/i18n-routingfrom
ematipico merged 2 commits intofeat/i18n-routingfrom
Conversation
|
2127491 to
267cdcf
Compare
Contributor
|
Looks like there are some conflicts, can you update? |
148264f to
f8b68d8
Compare
Member
Author
|
@matthewp that's done |
bluwy
approved these changes
Nov 8, 2023
matthewp
approved these changes
Nov 8, 2023
ematipico
added a commit
that referenced
this pull request
Nov 8, 2023
ematipico
added a commit
that referenced
this pull request
Nov 8, 2023
ematipico
added a commit
that referenced
this pull request
Nov 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR fixes some edge cases that could happen when looking for the preferred locales.
Since this feature doesn't enforce a restriction on how the locales should be written, this could be a problem when reading the locales coming from the browser. This will become a problem with the four-letter locales, e.g.
pt_BR.The
Accept-Languageheader has a value like thispt-BR, but a user might have their routes and folders like this:src/pages/pt-br/index.astroandexample.com/pt-br.This PR fixes this issue by:
Testing
Added a new test case
Docs
N/A