Skip to content

Commit f04d08c

Browse files
authored
docs(internationalization): correct example for overriding i18n strings (#22129)
1 parent 32242a3 commit f04d08c

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

packages/docs/src/pages/en/features/internationalization.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ If you are building custom Vuetify components that need to hook into the locale
173173

174174
## vue-i18n
175175

176-
If you are using the vue-i18n library, you can very easily integrate it with Vuetify. This allows you to keep all of your translations in one place. Simply create an entry for $vuetify within your messages and add the corresponding language changes. Then hook up vue-i18n to Vuetify by using the provided adapter function (as seen in the example below).
176+
If you are using the vue-i18n library, you can very easily integrate it with Vuetify. This allows you to keep all of your translations in one place. Simply use the spread operator to import the existing Vuetify messages and add the corresponding language changes. Then hook up vue-i18n to Vuetify by using the provided adapter function (as seen in the example below).
177177

178178
```js { resource="src/main.js" }
179179
import { createApp } from 'vue'
@@ -184,21 +184,19 @@ import { en, sv } from 'vuetify/locale'
184184

185185
const messages = {
186186
en: {
187-
$vuetify: {
188-
...en,
189-
dataIterator: {
190-
rowsPerPageText: 'Items per page:',
191-
pageText: '{0}-{1} of {2}',
192-
},
187+
...en,
188+
dataFooter: {
189+
...en.dataFooter,
190+
itemsPerPageText: 'Items per page:',
191+
pageText: '{0}-{1} of {2}',
193192
},
194193
},
195194
sv: {
196-
$vuetify: {
197-
...sv,
198-
dataIterator: {
199-
rowsPerPageText: 'Element per sida:',
200-
pageText: '{0}-{1} av {2}',
201-
},
195+
...sv,
196+
dataFooter: {
197+
...sv.dataFooter,
198+
itemsPerPageText: 'Element per sida:',
199+
pageText: '{0}-{1} av {2}',
202200
},
203201
},
204202
}

0 commit comments

Comments
 (0)