You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: redirect from 404 to defaultLocale if there is matching route
Changes the `setLocale` logic to, in case current route is 404, to
try to find a matching one for current locale. This is for situations
when using `prefix` strategy where the root (`/`) route doesn't exist.
We will try to find and redirect to prefixed route matching resolved locale.
Also worked around Nuxt issue (nuxt/nuxt#4491 )
with `redirect` not working when called from a plugin in SPA mode.
Required for the above fix above to be functional in SPA.
Resolves#677Resolves#491
Copy file name to clipboardexpand all lines: docs/es/routing.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -63,8 +63,8 @@ Con esta estrategia, todas las rutas tendrán un prefijo de configuración local
63
63
64
64
Esta estrategia combina los comportamientos de ambas estrategias anteriores, lo que significa que obtendrá URL con prefijos para cada idioma, pero las URL para el idioma predeterminado también tendrán una versión sin prefijo.
65
65
66
-
Para configurar la estrategia, use la opción `strategy`. Asegúrese de tener un `defaultLocale` definido si usa **prefix_except_default**, **prefix_and_default** o la estrategia **no_prefix**.
67
-
66
+
Para configurar la estrategia, use la opción `strategy`.
67
+
Make sure that you have a `defaultLocale` defined, especially if using **prefix_except_default**, **prefix_and_default** or **no_prefix** strategy. For other strategies it's also recommended to set it as it's gonna be used as a fallback when attempting to redirect from 404 page.
Copy file name to clipboardexpand all lines: docs/routing.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -66,8 +66,8 @@ This strategy combines both previous strategies behaviours, meaning that you wil
66
66
67
67
### Configuration
68
68
69
-
To configure the strategy, use the `strategy` option. Make sure that you have a `defaultLocale` defined if using **prefix_except_default**, **prefix_and_default** or **no_prefix** strategy.
70
-
69
+
To configure the strategy, use the `strategy` option.
70
+
Make sure that you have a `defaultLocale` defined, especially if using **prefix_except_default**, **prefix_and_default** or **no_prefix** strategy. For other strategies it's also recommended to set it as it's gonna be used as a fallback when attempting to redirect from 404 page.
0 commit comments