Skip to content

Commit 0ae5d7a

Browse files
committed
doc: udpate i18n doc
1 parent be9d448 commit 0ae5d7a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

site/src/vueDocs/i18n.en-US.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The default language is English as of yet. If you want to use other languages, y
66

77
ant-design-vue provides a Vue Component [ConfigProvider](/components/config-provider) for configuring ant-design-vue locale text globally.
88

9+
ConfigProvider does not include the internationalization of time components. You need to additionally import the internationalization files of the time library (dayjs, momentjs, date-fns, etc.). Below we have taken dayjs as an example.
10+
911
```html
1012
<template>
1113
<a-config-provider :locale="locale">
@@ -15,6 +17,10 @@ ant-design-vue provides a Vue Component [ConfigProvider](/components/config-prov
1517

1618
<script>
1719
import zhCN from 'ant-design-vue/es/locale/zh_CN';
20+
import dayjs from 'dayjs';
21+
import 'dayjs/locale/zh-cn';
22+
dayjs.locale('zh-cn');
23+
1824
export default {
1925
data() {
2026
return {

site/src/vueDocs/i18n.zh-CN.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
`ant-design-vue` 目前的默认文案是英文,如果需要使用其他语言,可以参考下面的方案。
44

5+
##
6+
57
## ConfigProvider
68

7-
ant-design-vue 提供了一个 Vue 组件 [ConfigProvider](/components/config-provider-cn) 用于全局配置国际化文案。
9+
ant-design-vue 提供了一个 Vue 组件 [ConfigProvider](/components/config-provider-cn) 用于全局配置国际化文案。 ConfigProvider 不包含时间类组件的国际化,你需要额外引入时间库(dayjs、momentjs、date-fns 等)的国际化文件,以下我们已 dayjs 为例。
810

911
```html
1012
<template>
@@ -15,6 +17,10 @@ ant-design-vue 提供了一个 Vue 组件 [ConfigProvider](/components/config-pr
1517

1618
<script>
1719
import zhCN from 'ant-design-vue/es/locale/zh_CN';
20+
import dayjs from 'dayjs';
21+
import 'dayjs/locale/zh-cn';
22+
dayjs.locale('zh-cn');
23+
1824
export default {
1925
data() {
2026
return {

0 commit comments

Comments
 (0)