-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
feat(i18n): refined locales #9200
Conversation
🦋 Changeset detectedLatest commit: 89239a3 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
dab8bef
to
098a676
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is blocked because it contains a minor
changeset. A reviewer will merge this at the next release if approved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise looks good to me!
// const fallbackFromLocale = getPathByLocale(_fallbackFromLocale, i18n.locales); | ||
// if (!fallbackFromLocale) { | ||
// continue; | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these left in on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall, I just have a few minor suggestions, and questions.
Co-authored-by: Happydev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so exciting to see this all take shape, @ematipico ! Here are some comments that I think will help make the docs a little more clear for readers! 🙌
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Sarah Rainsberger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has docs approval!
Got approval to land the feature
Changes
Relevant RFC change: withastro/roadmap@dc277b5
This PR adds a new way to configure locales. This new configuration allows users to map certain codes to a "path" that is more user-friendly.
Example:
With this configuration, the user will have
/portugues/
in their URLs, and a folder namedportugues/
. However, when leveraging the SSRAccept-Language
header, Astro will use thecodes
when asking forAstro.preferredLocale
.Testing
I added various cases to handle this new configuration, let me know if there are other cases to handle.
Docs
/cc @withastro/maintainers-docs for feedback!