Skip to content
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

chore: address feedback #786

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pipeline.setMiddlewareFunction(
)
```

By placing the middleware **after** the one of the user, Astro allows users to apply their business logic to the emitted `Response` of the i18n middleware.
The middleware is placed **before** the one of the user.
bluwy marked this conversation as resolved.
Show resolved Hide resolved

## Adapters and Astro features

Expand Down Expand Up @@ -312,7 +312,7 @@ This information is available through the global object `Astro`:
- `Astro.preferredLocaleList: string[] | undefined`

For example, if `i18n.locales` contains `['pt', 'fr', 'de']`, and the value of the `Accept-Header` value is `en, fr;q=0.2, de;q=0.8, *;q=0.5`, then
`Astro.preferredLocaleList` will be `['de', 'fr']` because `pt` isn't inside the header, and `en` isn't supported by the website. `de` comes first because it has a highest quality value.
`Astro.preferredLocaleList` will be `['de', 'fr']` because `pt` isn't inside the configuration, and `en` isn't supported by the website. `de` comes first because it has a highest quality value.
bluwy marked this conversation as resolved.
Show resolved Hide resolved

The property might be `undefined` if the developer isn't using their site in SSR. When `Accept-Header` is `*`, the list contained in `i18n.locales` is returned. `*` means that no preferences have been set, so all the original locales are supported and preferred.

Expand Down