Skip to content

Commit cc44470

Browse files
committed
📝 docs: udpate README
1 parent 36c62a5 commit cc44470

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export default {
4747
</i18n>
4848
```
4949

50+
The locale messages defined at `i18n` custom blocks are **json format default**.
51+
5052
### Source importing
5153

5254
you also can:
@@ -88,6 +90,38 @@ You can define locale messages for each locale with `locale` attr in single-file
8890
The above defines two locales, which are merged at target single-file components.
8991

9092

93+
### Locale Messages formatting
94+
95+
Besides json format, You can be used by specifying the following format in the `lang` attribute:
96+
97+
- yaml
98+
- json5
99+
100+
example yaml foramt:
101+
102+
```vue
103+
<i18n locale="en" lang="yaml">
104+
hello: "hello world!"
105+
</i18n>
106+
107+
<i18n locale="ja" lang="yml">
108+
hello: "こんにちは、世界!"
109+
</i18n>
110+
```
111+
112+
example json5 format:
113+
114+
```vue
115+
<i18n lang="json5">
116+
{
117+
"en": {
118+
// comments
119+
"hello": "hello world!"
120+
}
121+
}
122+
</i18n>
123+
```
124+
91125
### JavaScript
92126

93127
```javascript

0 commit comments

Comments
 (0)