From 26058c2b9460d09f097561c31c528e042e848516 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 4 Dec 2023 14:18:01 +0000 Subject: [PATCH 1/3] chore: address feedback --- proposals/{0041-i18n-routing.md => 0045-i18n-routing.md} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename proposals/{0041-i18n-routing.md => 0045-i18n-routing.md} (97%) diff --git a/proposals/0041-i18n-routing.md b/proposals/0045-i18n-routing.md similarity index 97% rename from proposals/0041-i18n-routing.md rename to proposals/0045-i18n-routing.md index 5452d161..703123f9 100644 --- a/proposals/0041-i18n-routing.md +++ b/proposals/0045-i18n-routing.md @@ -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. ## Adapters and Astro features @@ -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. 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. From 37b718c07aa42686e2edfcf5e84d04f6a946734b Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 4 Dec 2023 14:23:20 +0000 Subject: [PATCH 2/3] fix phrase --- proposals/0045-i18n-routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/0045-i18n-routing.md b/proposals/0045-i18n-routing.md index 703123f9..5c1c265b 100644 --- a/proposals/0045-i18n-routing.md +++ b/proposals/0045-i18n-routing.md @@ -100,7 +100,7 @@ The localized directories must inside the `pages/` directory. Other than this re Most of the logic will leverage the [middleware](https://docs.astro.build/en/guides/middleware/) system. -If a user has a `middleware.ts` file when the i18n routing is enabled, Astro will place its i18n middleware right after the one of the user: +If a user has a `middleware.ts` file when the i18n routing is enabled, Astro will place its i18n middleware right before the one of the user: ```js pipeline.setMiddlewareFunction( From 96904cd1678ec0834dfe661e8f9928ad7e61d569 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Mon, 4 Dec 2023 14:27:21 +0000 Subject: [PATCH 3/3] better explanation --- proposals/0045-i18n-routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/0045-i18n-routing.md b/proposals/0045-i18n-routing.md index 5c1c265b..131ddd53 100644 --- a/proposals/0045-i18n-routing.md +++ b/proposals/0045-i18n-routing.md @@ -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 configuration, 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 part of `Accept-Language` header even though it's configured, and `en` isn't supported by the website even though it is part of the `Accept-Langauge` header. `de` comes first because it has a highest quality value. 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.