File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -63,21 +63,26 @@ const i18n = createI18n({
63
63
en: {
64
64
message: {
65
65
hi: ' Hi, {name}!' ,
66
- bye: ' good bye!'
66
+ bye: ' good bye!' ,
67
+ apple: ' no apples | one apple | {count} apples'
67
68
}
68
69
},
69
70
ja: {
70
71
message: {
71
72
hi: ' こんにちは、 {name}!' ,
72
- bye: ' さようなら!'
73
+ bye: ' さようなら!' ,
74
+ apple: ' リンゴはありません | 一つのりんご | {count} りんご'
73
75
}
74
76
}
75
77
}
76
78
})
77
79
78
80
const app = createApp ({
79
81
data () {
80
- return { byePath: ' message.bye' }
82
+ return {
83
+ byePath: ' message.bye' ,
84
+ appleCount: 7 ,
85
+ }
81
86
}
82
87
})
83
88
app .use (i18n)
@@ -92,6 +97,8 @@ Templates:
92
97
<p v-t =" { path: 'message.hi', args: { name: 'kazupon' } }" ></p >
93
98
<!-- data binding via data -->
94
99
<p v-t =" { path: byePath, locale: 'en' }" ></p >
100
+ <!-- pluralization -->
101
+ <p v-t =" { path: 'message.apple', plural: appleCount }" ></p >
95
102
</div >
96
103
```
97
104
@@ -101,6 +108,7 @@ Outputs:
101
108
<div id =" object-syntax" >
102
109
<p >こんにちは、 kazupon!</p >
103
110
<p >good bye!</p >
111
+ <p >7 りんご</p >
104
112
</div >
105
113
```
106
114
You can’t perform that action at this time.
0 commit comments