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

docs: customRoutes clarification #3036

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
docs: customRoutes clarification
  • Loading branch information
BobbieGoede committed Jul 21, 2024
commit 67a7cedbd98f447b26516e63cc571e2b292041c3
6 changes: 4 additions & 2 deletions docs/content/docs/2.guide/3.custom-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ title: Custom Route Paths
description: Customize the names of the paths for specific locale.
---

In some cases, you might want to translate URLs in addition to having them prefixed with the locale code. There are 2 ways of configuring custom paths for your [Module configuration](#module-configuration) or your pages [Page component](#page-component).
In some cases, you might want to translate URLs in addition to having them prefixed with the locale code. There are two methods of configuring custom paths, through [Module configuration](#module-configuration) or from within each [Page component](#page-component).

Which method is used is configured by setting the [`customRoutes` options](/docs/options/routing#customroutes) this is set to `'page'` by default. Using both methods at the same time is not possible.

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Custom paths are not supported when using the `no-prefix` [strategy](/docs/guide).
Expand Down Expand Up @@ -192,7 +194,7 @@ Note for those updating to `v8.0.1` or higher
Path parameters parsing has been changed to match that of [Nuxt 3](https://nuxt.com/docs/guide/directory-structure/pages#dynamic-routes), you will have to update your custom paths (e.g. `/example/:param` should now be `/example/[param]`)
::

You can use the `defineI18nRoute` compiler macro to set some custom paths for each page component.
You can use the `defineI18nRoute` compiler macro to set custom paths for each page component.

```html {}[pages/about.vue]
<script setup>
Expand Down
6 changes: 4 additions & 2 deletions docs/content/docs/5.v9/2.guide/3.custom-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ title: Custom Route Paths
description: Customize the names of the paths for specific locale.
---

In some cases, you might want to translate URLs in addition to having them prefixed with the locale code. There are 2 ways of configuring custom paths for your [Module configuration](#module-configuration) or your pages [Page component](#page-component).
In some cases, you might want to translate URLs in addition to having them prefixed with the locale code. There are two methods of configuring custom paths, through [Module configuration](#module-configuration) or from within each [Page component](#page-component).

Which method is used is configured by setting the [`customRoutes` options](/docs/options/routing#customroutes) this is set to `'page'` by default. Using both methods at the same time is not possible.

::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
Custom paths are not supported when using the `no-prefix` [strategy](/docs/guide).
Expand Down Expand Up @@ -192,7 +194,7 @@ Note for those updating to `v8.0.1` or higher
Path parameters parsing has been changed to match that of [Nuxt 3](https://nuxt.com/docs/guide/directory-structure/pages#dynamic-routes), you will have to update your custom paths (e.g. `/example/:param` should now be `/example/[param]`)
::

You can use the `defineI18nRoute` compiler macro to set some custom paths for each page component.
You can use the `defineI18nRoute` compiler macro to set custom paths for each page component.

```html {}[pages/about.vue]
<script setup>
Expand Down