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.
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(guides): experimental i18n routing #5187
feat(guides): experimental i18n routing #5187
Changes from 13 commits
32ab8ab
843a472
a17a09d
9771e2e
dcf643a
9b7ce6e
5c16659
bdfb901
cccb25d
d0954fe
005b5c1
bdc15e4
34d2aee
18cb22b
70ba4f6
43eb738
54f26f9
b74f640
840b382
8d1ae7b
1b7a33b
dd4e916
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@ematipico Just checking on a case like:
prefix-other-locales
so that a default locale URL route isexample.com/blog/
href="/blog/"
??? <-- if this is true, then I should NOT say write a localized URLIs the above example correct? should I change the wording?
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.
That's correct. The URL
/blog
should be reflected in the filesrc/pages/blog/index.astro
. Withprefix-other-locales
, it's assumed that the content outside of a localized folder belongs to the default locale.I think so, we should mention "localized URL" only for those locales that aren't the default locale.
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 isn't correct. With the
'prefix-other-locales'
, developers must havesrc/pages/blog.astro
in their file system, because it's "assumed" that pages outside of a lang/locale folder belong to the default locale. This is related to my comment above.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.
I am not sure if it's worth mentioning it, but I leave the information here, and you decide: the locales coming from
Accept-Language
have their format, e.g.pt-BR
, although it's possible that developers decide to use a different format insidei18n.locales
, e.g.pt_BR
,pt-br
.Astro under to hood does some transformations (no need to mention this) and eventually will return the format specified in
i18n.locales
.So if
Accept-Language
isfr-CA;q=0.1, pt-BR;q=0.5"
, andi18n.locales
is["fr_CA", "pt_BR"]
:Astro.preferredLocale
is"pt_BR"
;Astro.preferredLocaleList
is["pt_BR", "fr_CA"]
, the order is important because it's kept fromAccept-Language
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.
Let me see what I can do here!