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
Copy file name to clipboardExpand all lines: docs/content/docs/1.getting-started/6.integrations/4.i18n/1.nuxt.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,22 @@ const { locale } = useI18n()
161
161
</template>
162
162
```
163
163
164
+
#### Automatic link localization :badge{label="Soon"class="align-text-top"}
165
+
166
+
When `@nuxtjs/i18n` is installed, the [Link](/docs/components/link) component automatically localizes internal links using the `$localePath` helper. This means you don't need to manually wrap your links with `localePath()` or `localeRoute()`.
167
+
168
+
```vue
169
+
<template>
170
+
<!-- Automatically becomes /en/about or /fr/about based on current locale -->
171
+
<ULink to="/about">About</ULink>
172
+
<UButton to="/contact">Contact</UButton>
173
+
</template>
174
+
```
175
+
176
+
::tip
177
+
External links and absolute URLs are automatically detected and skip localization. You can still manually use `localePath()` or `localeRoute()` if needed.
Copy file name to clipboardExpand all lines: docs/content/docs/2.components/link.md
+22-3Lines changed: 22 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,8 @@ slots:
75
75
Link
76
76
::
77
77
78
-
## IntelliSense
79
-
80
-
If you're using VSCode and wish to get autocompletion for the classes `active-class` and `inactive-class`, you can add the following settings to your `.vscode/settings.json`:
78
+
::callout{icon="i-simple-icons-visualstudiocode"}
79
+
If you're using the [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) extension for VSCode and wish to get autocompletion for the `active-class` and `inactive-class` props, you can add the following settings to your `.vscode/settings.json`:
81
80
82
81
```json [.vscode/settings.json]
83
82
{
@@ -87,6 +86,26 @@ If you're using VSCode and wish to get autocompletion for the classes `active-cl
The Link component automatically integrates with [`@nuxtjs/i18n`](https://i18n.nuxtjs.org/) when installed. Internal links are automatically localized using the `$localePath` helper without requiring manual wrapping.
94
+
95
+
```vue
96
+
<template>
97
+
<!-- Automatically becomes /en/about or /fr/about based on current locale -->
98
+
<ULink to="/about">About</ULink>
99
+
</template>
100
+
```
101
+
102
+
::tip
103
+
You can still manually use `localePath()` or `localeRoute()` if needed.
0 commit comments