From 558f73b6a5e9cac584f12166ab3e3e6753e82656 Mon Sep 17 00:00:00 2001 From: Cemre Mengu Date: Mon, 9 Apr 2018 06:06:18 +0300 Subject: [PATCH] Added en translation for Ellipsis (#1210) * Added en translation * Remove dots in description * Fix chinese doc title * lowercase description * Updated and added demo translation --- src/components/Ellipsis/demo/line.md | 13 ++++++++++++- src/components/Ellipsis/demo/number.md | 10 +++++++++- src/components/Ellipsis/index.en-US.md | 15 +++++++++++++++ .../Ellipsis/{index.md => index.zh-CN.md} | 4 +--- 4 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 src/components/Ellipsis/index.en-US.md rename src/components/Ellipsis/{index.md => index.zh-CN.md} (91%) diff --git a/src/components/Ellipsis/demo/line.md b/src/components/Ellipsis/demo/line.md index 60b804c6..bc31170d 100644 --- a/src/components/Ellipsis/demo/line.md +++ b/src/components/Ellipsis/demo/line.md @@ -1,12 +1,23 @@ --- order: 1 -title: 按照行数省略 +title: + zh-CN: 按照行数省略 + en-US: Truncate according to the number of rows --- +## zh-CN + 通过设置 `lines` 属性指定最大行数,如果超过这个行数的文本会自动截取。但是在这种模式下所有 `children` 将会被转换成纯文本。 并且注意在这种模式下,外容器需要有指定的宽度(或设置自身宽度)。 +## en-US + +`lines` attribute specifies the maximum number of rows where the text will automatically be truncated when exceeded. In this mode, all children will be converted to plain text. + +Also note that, in this mode, the outer container needs to have a specified width (or set its own width). + + ````jsx import Ellipsis from 'ant-design-pro/lib/Ellipsis'; diff --git a/src/components/Ellipsis/demo/number.md b/src/components/Ellipsis/demo/number.md index 9302bb85..0bc1a0ff 100644 --- a/src/components/Ellipsis/demo/number.md +++ b/src/components/Ellipsis/demo/number.md @@ -1,10 +1,18 @@ --- order: 0 -title: 按照字符数省略 +title: + zh-CN: 按照字符数省略 + en-US: Truncate according to the number of character --- +## zh-CN + 通过设置 `length` 属性指定文本最长长度,如果超过这个长度会自动截取。 +## en-US + +`length` attribute specifies the maximum length where the text will automatically be truncated when exceeded. + ````jsx import Ellipsis from 'ant-design-pro/lib/Ellipsis'; diff --git a/src/components/Ellipsis/index.en-US.md b/src/components/Ellipsis/index.en-US.md new file mode 100644 index 00000000..fa5beb64 --- /dev/null +++ b/src/components/Ellipsis/index.en-US.md @@ -0,0 +1,15 @@ +--- +title: Ellipsis +cols: 1 +order: 10 +--- + +When the text is too long, the Ellipsis automatically shortens it according to its length or the maximum number of lines. + +## API + +Property | Description | Type | Default +----|------|-----|------ +tooltip | tooltip for showing the full text content when hovering over | boolean | - +length | maximum number of characters in the text before being truncated | number | - +lines | maximum number of rows in the text before being truncated | number | `1` diff --git a/src/components/Ellipsis/index.md b/src/components/Ellipsis/index.zh-CN.md similarity index 91% rename from src/components/Ellipsis/index.md rename to src/components/Ellipsis/index.zh-CN.md index e53cd1ce..8fe98bb0 100644 --- a/src/components/Ellipsis/index.md +++ b/src/components/Ellipsis/index.zh-CN.md @@ -1,7 +1,5 @@ --- -title: - en-US: Ellipsis - zh-CN: Ellipsis +title: Ellipsis subtitle: 文本自动省略号 cols: 1 order: 10 -- GitLab