@@ -10,9 +10,7 @@ It can be used in Vue 2 applications that you have already built with vue-i18n@v
10
10
11
11
And, also some features are backported from
[email protected] :
12
12
13
- - Vue I18n Compostion API, that is powered by ` @vue/composition-api ` and ` vue-demi `
14
- - for Vue 2.6, you need ` @vue/composition-api ` and ` vue-demi `
15
- - for Vue 2.7, you need ` vue-demi ` only
13
+ - Vue I18n Composition API, that is powered by ` @vue/composition-api ` and ` vue-demi `
16
14
- Message format syntax, that is powered by ` @intlify/message-compiler `
17
15
18
16
### Installation
@@ -31,13 +29,14 @@ pnpm add vue-i18n-bridge
31
29
You must install the below packages before using this library:
32
30
33
31
- vue-i18n: >= v8.26.1 < v9
34
- - @vue/composition-api : >= v1.2.0 (for Vue 2.6)
32
+ - vue-demi: >= v1.3.5
33
+ - @vue/composition-api : >= v1.2.0 (if you will use Vue 2.6)
35
34
36
35
#### CDN
37
36
38
37
** For Vue 2.7** :
39
38
40
- Include ` vue-i18n-bridge ` after ` vue ` , ` vue-demo ` and it will install.
39
+ Include ` vue-i18n-bridge ` after ` vue ` , ` vue-demi ` and it will install.
41
40
42
41
``` html
43
42
<
script src =
" https://cdn.jsdelivr.net/npm/[email protected] " ></
script >
@@ -252,6 +251,19 @@ const { createApp } = VueDemi // exported UMD which is named by `VueDemi`
252
251
const { createI18n , useI18n } = VueI18nBridge // exported UMD which is named by `VueI18nBridge`
253
252
254
253
Vue .use (VueI18n, { bridge: true })
254
+
255
+ const i18n = createI18n ({
256
+ locale: ' ja' ,
257
+ messages: {
258
+ // ...
259
+ }
260
+ }, VueI18n)
261
+
262
+ const app = createApp ({}, {
263
+ // ...
264
+ })
265
+ app .use (i18n)
266
+ app .mount (' #app' ) // Vue app host container element
255
267
```
256
268
257
269
#### For Vue 2.6
@@ -261,6 +273,19 @@ const { createI18n, useI18n } = VueI18nBridge // exported UMD which is named by
261
273
262
274
Vue .use (VueCompositionAPI)
263
275
Vue .use (VueI18n, { bridge: true })
276
+
277
+ const i18n = createI18n ({
278
+ locale: ' ja' ,
279
+ messages: {
280
+ // ...
281
+ }
282
+ }, VueI18n)
283
+
284
+ const app = createApp ({}, {
285
+ // ...
286
+ })
287
+ app .use (i18n)
288
+ app .mount (' #app' ) // Vue app host container element
264
289
```
265
290
266
291
### Limitations
0 commit comments