Skip to content

Commit

Permalink
feat(i18n): current locale
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Nov 14, 2023
1 parent ab1ce15 commit 5222480
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/content/docs/en/guides/internationalization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,8 @@ Astro's i18n routing combined with one of Astro's [on-demand server rendering m
These combine the browser's `Accept-Langauge` header, and your `locales` to automatically respect your visitor's preferred languages.

- `Astro.preferredLocale`: Astro can compute a **preferred locale** for your visitor if their browser's preferred locale is included in your `locales` array. This value is undefined if no such match exists.


- `Astro.preferredLocaleList`: An array of all locales that are both requested by the browser and supported by your website. This produces a list of all compatible languages between your site and your visitor. The value is `[]` if none of the browser's requested languages are found in your `locales` array. If the browser does not specify any preferred languages, then this value will be [`i18n.locales`].
- `Astro.currentLocale`: The locale computed from the current URL, that matches what's configured in [`i18n.locales`]. When the `routingStrategy` is set to `"prefix-other-locales"`, the value will be `i18n.defaultLocale` for any URL that doesn't contain any locale.


### Fallback
Expand Down

0 comments on commit 5222480

Please sign in to comment.