From c448443c709fe7916d82aa2a6a5ce2f03a5f0ea1 Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Sun, 2 Sep 2018 11:28:43 +0800 Subject: [PATCH] =?UTF-8?q?docs(API):=20=E7=BF=BB=E8=AF=91=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=20XxxCasePipe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/translations/cn/api-plan.md | 2 +- .../common/src/pipes/case_conversion_pipes.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/aio/content/translations/cn/api-plan.md b/aio/content/translations/cn/api-plan.md index 4e05cfc671..93a1f8fb37 100644 --- a/aio/content/translations/cn/api-plan.md +++ b/aio/content/translations/cn/api-plan.md @@ -31,7 +31,7 @@ [x] | common/http/HttpClientModule | 0.67 [x] | core/ElementRef | 0.67 [x] | core/OnInit | 0.66 -[ ] | common/UpperCasePipe | 0.65 +[x] | common/UpperCasePipe | 0.65 [ ] | common/NgStyle | 0.60 [ ] | router/RouterOutlet | 0.59 [ ] | forms/Validators | 0.59 diff --git a/packages/common/src/pipes/case_conversion_pipes.ts b/packages/common/src/pipes/case_conversion_pipes.ts index e2e6041dac..49dbb876d6 100644 --- a/packages/common/src/pipes/case_conversion_pipes.ts +++ b/packages/common/src/pipes/case_conversion_pipes.ts @@ -12,6 +12,8 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; /** * Transforms text to all lower case. * + * 把文本转换成全小写形式。 + * * @see `UpperCasePipe` * @see `TitleCasePipe` * @usageNotes @@ -19,6 +21,8 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; * The following example defines a view that allows the user to enter * text, and then uses the pipe to convert the input text to all lower case. * + * 下面的例子定义了一个视图,允许用户输入文本,然后就会用该管道把输入的文本转换成全小写形式。 + * * * * @@ -27,6 +31,8 @@ import {invalidPipeArgumentError} from './invalid_pipe_argument_error'; export class LowerCasePipe implements PipeTransform { /** * @param value The string to transform to lower case. + * + * 要转换成小写形式的字符串。 */ transform(value: string): string { if (!value) return value; @@ -55,12 +61,18 @@ const unicodeWordMatch = * rest of the word to lower case. * Words are delimited by any whitespace character, such as a space, tab, or line-feed character. * + * 把文本转换成标题形式。 + * 把每个单词的第一个字母转成大写形式,并把单词的其余部分转成小写形式。 + * 单词之间用任意空白字符进行分隔,比如空格、Tab 或换行符。 + * * @see `LowerCasePipe` * @see `UpperCasePipe` * * @usageNotes * The following example shows the result of transforming various strings into title case. * + * 下面的例子示范了如何把多种字符串转成标题形式。 + * * * * @@ -69,6 +81,8 @@ const unicodeWordMatch = export class TitleCasePipe implements PipeTransform { /** * @param value The string to transform to title case. + * + * 要转换成标题形式的字符串。 */ transform(value: string): string { if (!value) return value; @@ -83,6 +97,9 @@ export class TitleCasePipe implements PipeTransform { /** * Transforms text to all upper case. + * + * 把文本转换成全大写形式。 + * * @see `LowerCasePipe` * @see `TitleCasePipe` */ @@ -90,6 +107,8 @@ export class TitleCasePipe implements PipeTransform { export class UpperCasePipe implements PipeTransform { /** * @param value The string to transform to upper case. + * + * 要转换成大写的字符串。 */ transform(value: string): string { if (!value) return value;