4
4
Vue I18n v10 ** is still an alpha version** .
5
5
:::
6
6
7
- ## APIs
8
-
9
- ### Change ` $t ` and ` t ` overloaded signature for Legacy API mode
7
+ ## Change ` $t ` and ` t ` overloaded signature for Legacy API mode
10
8
11
9
In Vue I18n v9, it has a different interface from the Composition API mode and Legacy API mode of ` $t ` and ` t ` overloaded signature.
12
10
@@ -60,7 +58,7 @@ If you are using the following APIs in Legacy API mode, you must change to anoth
60
58
- ` t(key: Key, locale: Locale, list: unknown[]): TranslateResult; `
61
59
- ` t(key: Key, locale: Locale, named: NamedValue): TranslateResult; `
62
60
63
- #### ` $t(key: Key, locale: Locale): TranslateResult; `
61
+ ### ` $t(key: Key, locale: Locale): TranslateResult; `
64
62
65
63
Vue I18n v9.x:
66
64
@@ -80,7 +78,7 @@ use `$t(key: Key, list: unknown[], options: TranslateOptions): TranslateResult;`
80
78
</template>
81
79
```
82
80
83
- #### ` $t(key: Key, locale: Locale, list: unknown[]): TranslateResult; `
81
+ ### ` $t(key: Key, locale: Locale, list: unknown[]): TranslateResult; `
84
82
85
83
Vue I18n v9.x:
86
84
@@ -100,7 +98,7 @@ use `$t(key: Key, list: unknown[], options: TranslateOptions): TranslateResult;`
100
98
</template>
101
99
```
102
100
103
- #### ` $t(key: Key, locale: Locale, named: NamedValue): TranslateResult; `
101
+ ### ` $t(key: Key, locale: Locale, named: NamedValue): TranslateResult; `
104
102
105
103
Vue I18n v9.x:
106
104
@@ -120,7 +118,7 @@ use `$t(key: Key, named: NamedValue, options: TranslateOptions): TranslateResult
120
118
</template>
121
119
```
122
120
123
- #### ` t(key: Key, locale: Locale): TranslateResult; `
121
+ ### ` t(key: Key, locale: Locale): TranslateResult; `
124
122
125
123
Vue I18n v9.x:
126
124
@@ -146,7 +144,7 @@ const i18n = createI18n({
146
144
console .log (i18n .global .t (' message.hello' , {}, { locale: ' ja' })
147
145
` ` `
148
146
149
- #### ` t (key : Key , locale : Locale , list : unknown []): TranslateResult ;`
147
+ ### ` t (key : Key , locale : Locale , list : unknown []): TranslateResult ;`
150
148
151
149
Vue I18n v9.x:
152
150
@@ -172,7 +170,7 @@ const i18n = createI18n({
172
170
console .log (i18n .global .t (' message.hello' , [' dio' ], { locale: ' ja' }))
173
171
` ` `
174
172
175
- #### ` t (key : Key , locale : Locale , named : NamedValue ): TranslateResult ;`
173
+ ### ` t (key : Key , locale : Locale , named : NamedValue ): TranslateResult ;`
176
174
177
175
Vue I18n v9.x:
178
176
@@ -198,7 +196,7 @@ const i18n = createI18n({
198
196
console .log (i18n .global .t (' message.hello' , { name: ' dio' }, { locale: ' ja' }))
199
197
` ` `
200
198
201
- ### Deprecate ` tc ` and ` $tc ` for Legacy API mode
199
+ ## Deprecate ` tc ` and ` $tc ` for Legacy API mode
202
200
203
201
The following APIs are deprecated in v10:
204
202
@@ -226,7 +224,7 @@ In v10, `tc` and `$tc` still exist to give benefit migration. These will be drop
226
224
If you will use them, Vue I18n will output the console warning in your application.
227
225
228
226
229
- #### ` tc (key : Key | ResourceKeys ): TranslateResult ;`
227
+ ### ` tc (key : Key | ResourceKeys ): TranslateResult ;`
230
228
231
229
Vue I18n v9.x:
232
230
@@ -250,7 +248,7 @@ const i18n = createI18n({
250
248
console .log (i18n .global .t (' banana' , 1 ))
251
249
` ` `
252
250
253
- #### ` tc (key : Key | ResourceKeys , locale : Locales | Locale ): TranslateResult ;`
251
+ ### ` tc (key : Key | ResourceKeys , locale : Locales | Locale ): TranslateResult ;`
254
252
255
253
Vue I18n v9.x:
256
254
@@ -274,7 +272,7 @@ const i18n = createI18n({
274
272
console .log (i18n .global .t (' banana' , 1 , { locale: ' ja' }))
275
273
` ` `
276
274
277
- #### ` tc (key : Key | ResourceKeys , list : unknown []): TranslateResult ;`
275
+ ### ` tc (key : Key | ResourceKeys , list : unknown []): TranslateResult ;`
278
276
279
277
280
278
Vue I18n v9.x:
@@ -299,7 +297,7 @@ const i18n = createI18n({
299
297
console .log (i18n .global .t (' banana' , [' dio' ], 1 ))
300
298
` ` `
301
299
302
- #### ` tc (key : Key | ResourceKeys , named : Record < string , unknown > ): TranslateResult ;`
300
+ ### ` tc (key : Key | ResourceKeys , named : Record < string , unknown > ): TranslateResult ;`
303
301
304
302
Vue I18n v9.x:
305
303
@@ -323,7 +321,7 @@ const i18n = createI18n({
323
321
console .log (i18n .global .t (' banana' , { name: ' dio' }, 1 ))
324
322
` ` `
325
323
326
- #### ` tc (key : Key | ResourceKeys , choice : number ): TranslateResult ;`
324
+ ### ` tc (key : Key | ResourceKeys , choice : number ): TranslateResult ;`
327
325
328
326
Vue I18n v9.x:
329
327
@@ -347,7 +345,7 @@ const i18n = createI18n({
347
345
console .log (i18n .global .t (' banana' , 2 ))
348
346
` ` `
349
347
350
- #### ` tc (key : Key | ResourceKeys , choice : number , locale : Locales | Locale ): TranslateResult ;`
348
+ ### ` tc (key : Key | ResourceKeys , choice : number , locale : Locales | Locale ): TranslateResult ;`
351
349
352
350
Vue I18n v9.x:
353
351
@@ -371,7 +369,7 @@ const i18n = createI18n({
371
369
console .log (i18n .global .t (' banana' , 2 , { locale: ' ja' }))
372
370
` ` `
373
371
374
- #### ` tc (key : Key | ResourceKeys , choice : number , list : unknown []): TranslateResult ;`
372
+ ### ` tc (key : Key | ResourceKeys , choice : number , list : unknown []): TranslateResult ;`
375
373
376
374
Vue I18n v9.x:
377
375
@@ -395,7 +393,7 @@ const i18n = createI18n({
395
393
console .log (i18n .global .t (' banana' , [' dio' ], 2 ))
396
394
` ` `
397
395
398
- #### ` tc (key : Key | ResourceKeys , choice : number , named : Record < string , unknown > ): TranslateResult ;`
396
+ ### ` tc (key : Key | ResourceKeys , choice : number , named : Record < string , unknown > ): TranslateResult ;`
399
397
400
398
` ` ` ts
401
399
const i18n = createI18n ({
@@ -417,7 +415,7 @@ const i18n = createI18n({
417
415
console .log (i18n .global .tc (' banana' , { name: ' dio' }, 2 ))
418
416
` ` `
419
417
420
- #### ` $tc (key : Key ): TranslateResult ;`
418
+ ### ` $tc (key : Key ): TranslateResult ;`
421
419
422
420
Vue I18n v9.x:
423
421
@@ -437,7 +435,7 @@ use `$t(key: Key, plural: number): TranslateResult;`
437
435
< / template >
438
436
` ` `
439
437
440
- #### ` $tc (key : Key , locale : Locale ): TranslateResult ;`
438
+ ### ` $tc (key : Key , locale : Locale ): TranslateResult ;`
441
439
442
440
Vue I18n v9.x:
443
441
@@ -457,7 +455,7 @@ use `$t(key: Key, plural: number, options: TranslateOptions): TranslateResult;`
457
455
< / template >
458
456
` ` `
459
457
460
- #### ` $tc (key : Key , list : unknown []): TranslateResult ;`
458
+ ### ` $tc (key : Key , list : unknown []): TranslateResult ;`
461
459
462
460
Vue I18n v9.x:
463
461
@@ -477,7 +475,7 @@ use `$t(key: Key, list: unknown[], plural: number): TranslateResult;`
477
475
< / template >
478
476
` ` `
479
477
480
- #### ` $tc (key : Key , named : Record < string , unknown > ): TranslateResult ;`
478
+ ### ` $tc (key : Key , named : Record < string , unknown > ): TranslateResult ;`
481
479
482
480
Vue I18n v9.x:
483
481
@@ -497,7 +495,7 @@ use `$t(key: Key, named: NamedValue, plural: number): TranslateResult;`
497
495
< / template >
498
496
` ` `
499
497
500
- #### ` $tc (key : Key , choice : number ): TranslateResult ;`
498
+ ### ` $tc (key : Key , choice : number ): TranslateResult ;`
501
499
502
500
Vue I18n v9.x:
503
501
@@ -517,7 +515,7 @@ use `$t(key: Key, plural: number): TranslateResult;`
517
515
< / template >
518
516
` ` `
519
517
520
- #### ` $tc (key : Key , choice : number , locale : Locale ): TranslateResult ;`
518
+ ### ` $tc (key : Key , choice : number , locale : Locale ): TranslateResult ;`
521
519
522
520
Vue I18n v9.x:
523
521
@@ -537,7 +535,7 @@ use `$t(key: Key, plural: number, options: TranslateOptions): TranslateResult;`
537
535
< / template >
538
536
` ` `
539
537
540
- #### ` $tc (key : Key , choice : number , list : unknown []): TranslateResult ;`
538
+ ### ` $tc (key : Key , choice : number , list : unknown []): TranslateResult ;`
541
539
542
540
Vue I18n v9.x:
543
541
@@ -557,7 +555,7 @@ use `$t(key: Key, list: unknown[], plural: number): TranslateResult;`
557
555
< / template >
558
556
` ` `
559
557
560
- #### ` $tc (key : Key , choice : number , named : Record < string , unknown > ): TranslateResult ;`
558
+ ### ` $tc (key : Key , choice : number , named : Record < string , unknown > ): TranslateResult ;`
561
559
562
560
Vue I18n v9.x:
563
561
@@ -577,13 +575,13 @@ use `$t(key: Key, named: NamedValue, plural: number): TranslateResult;`
577
575
< / template >
578
576
` ` `
579
577
580
- ### Drop modulo ` % ` syntax
578
+ ## Drop modulo ` % ` syntax
581
579
582
580
Named interpolation using modulo ` % ` is no longer supported in v10.
583
581
584
582
**Reason**: module syntax has already deprecated in v9 with a warning.
585
583
586
- #### for migration
584
+ ### for migration
587
585
588
586
You can use ` eslint - plugin - vue - i18n ` .
589
587
@@ -594,37 +592,37 @@ You can fixed with using `eslint --fix`
594
592
595
593
You must have migrated with eslint before upgrading to vue-i18n v10
596
594
597
- ### Drop ` vue - i18n - bridge `
595
+ ## Drop ` vue - i18n - bridge `
598
596
599
597
**Reason**: vue-i18n-bridge is a bridge library for migrating vue-i18n from Vue 2 to Vue 3, and Vue 2 is no longer past EOL.
600
598
601
- ### Drop ` allowComposition ` option
599
+ ## Drop ` allowComposition ` option
602
600
603
601
**Reason**: This option already deprecated in warning about being dropped in v10. docs says, https://vue-i18n.intlify.dev/guide/migration/vue3.html#about-supporting
604
602
605
603
This option was added to support the migration from the Legacy API to the composition API on v9.
606
604
607
- ### Drop ` formatter ` option on Legacy API
605
+ ## Drop ` formatter ` option on Legacy API
608
606
609
607
**Reason**: This option was deprecated in warning on v9.
610
608
611
- ### Drop ` preserveDirectiveContent ` option on Legacy API
609
+ ## Drop ` preserveDirectiveContent ` option on Legacy API
612
610
613
611
**Reason**: This option was deprecated in warning on v9.
614
612
615
- ### Drop ` preserve ` modifier codes on ` v - t ` directive
613
+ ## Drop ` preserve ` modifier codes on ` v - t ` directive
616
614
617
615
**Reason**: This option was deprecated in warning on v9.
618
616
619
- ### Drop ` getChoiceIndex ` on Legacy API
617
+ ## Drop ` getChoiceIndex ` on Legacy API
620
618
621
619
**Reason**: This option was deprecated in warning on v9.
622
620
623
- ### Drop translation component ` <i18n >` v8.x compatibility
621
+ ## Drop translation component ` <i18n >` v8.x compatibility
624
622
625
623
**Reason**: This option was deprecated in warning on v9.
626
624
627
- ### Drop ` te ` behavior v8.x compatibility
625
+ ## Drop ` te ` behavior v8.x compatibility
628
626
629
627
**Reason**: This option was deprecated in warning on v9.
630
628
0 commit comments