diff --git a/aio/content/guide/form-validation.md b/aio/content/guide/form-validation.md index 5070e4fbf0..848d1737f3 100644 --- a/aio/content/guide/form-validation.md +++ b/aio/content/guide/form-validation.md @@ -49,7 +49,7 @@ The following example exports `NgModel` into a variable called `name`: Note the following: -要注意的有两点: +请注意以下几点: * The `` element carries the HTML validation attributes: `required` and `minlength`. It also carries a custom validator directive, `forbiddenName`. For more diff --git a/aio/content/guide/pipes.md b/aio/content/guide/pipes.md index 91f542ddef..b23ea9d495 100644 --- a/aio/content/guide/pipes.md +++ b/aio/content/guide/pipes.md @@ -258,7 +258,7 @@ Now you need a component to demonstrate the pipe. Note the following: -要注意的有两点: +请注意以下几点: * You use your custom pipe the same way you use built-in pipes. diff --git a/aio/tools/translator/checker.spec.ts b/aio/tools/translator/checker.spec.ts index 6276791534..3c3797c71a 100644 --- a/aio/tools/translator/checker.spec.ts +++ b/aio/tools/translator/checker.spec.ts @@ -8,7 +8,7 @@ import { isNotImg, isNotMarketingDocs, originalIsNotChinese, - originalIsNotTag, + originalIsNotAlertDivTag, translationHasNotCodeExample, } from './utils'; @@ -42,7 +42,7 @@ describe('自动检查翻译结果', function () { }); it('原文不应该是以
", - "translation": "译注:由于 HTML attribute 和 DOM property 在中文中都被翻译成了“属性”,无法区分,\n而接下来的部分重点是对它们进行比较。", - "sourceFile": "/Users/twer/private/GDE/content-1/guide/template-syntax.md" - }, { "original": "Binding types other than interpolation have a **target name** to the left of the equal sign,\neither surrounded by punctuation (`[]`, `()`) or preceded by a prefix (`bind-`, `on-`, `bindon-`).", "translation": "除了插值表达式之外的绑定类型,在等号左边是**目标名**,\n 无论是包在括号中 (`[]`、`()`) 还是用前缀形式 (`bind-`、`on-`、`bindon-`) 。", diff --git a/aio/tools/translator/dict-2.json b/aio/tools/translator/dict-2.json index d97b752e4b..0e90375173 100644 --- a/aio/tools/translator/dict-2.json +++ b/aio/tools/translator/dict-2.json @@ -24789,11 +24789,6 @@ "translation": "样式", "sourceFile": "/Users/twer/private/GDE/content-2/guide/template-syntax.md" }, - { - "original": "
", - "translation": "译注:由于 HTML attribute 和 DOM property 在中文中都被翻译成了“属性”,无法区分,\n而接下来的部分重点是对它们进行比较。", - "sourceFile": "/Users/twer/private/GDE/content-2/guide/template-syntax.md" - }, { "original": "Binding types other than interpolation have a **target name** to the left of the equal sign,\neither surrounded by punctuation (`[]`, `()`) or preceded by a prefix (`bind-`, `on-`, `bindon-`).", "translation": "除了插值表达式之外的绑定类型,在等号左边是**目标名**,\n 无论是包在括号中 (`[]`、`()`) 还是用前缀形式 (`bind-`、`on-`、`bindon-`) 。", diff --git a/aio/tools/translator/dict-3.json b/aio/tools/translator/dict-3.json index 68ff656552..2e827cccfc 100644 --- a/aio/tools/translator/dict-3.json +++ b/aio/tools/translator/dict-3.json @@ -1479,6 +1479,31 @@ "translation": "## 小结", "sourceFile": "/Users/twer/private/GDE/content-3/guide/aot-compiler.md" }, + { + "original": "Property", + "translation": "属性", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/api-page-class.md" + }, + { + "original": "Type", + "translation": "绑定类型", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/api-page-class.md" + }, + { + "original": "Description", + "translation": "描述", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/api-page-class.md" + }, + { + "original": "Type", + "translation": "绑定类型", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/api-page-class.md" + }, + { + "original": "Type", + "translation": "绑定类型", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/api-page-class.md" + }, { "original": "# Architecture Overview", "translation": "# 架构概览", @@ -2955,13 +2980,8 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/browser-support.md" }, { - "original": "[Animations](guide/animations)", - "translation": "[动画](guide/animations)", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/browser-support.md" - }, - { - "original": "
Only if `Animation Builder` is used within the application--standard\n animation support in Angular doesn't require any polyfills (as of NG6).", - "translation": "
只有在应用中用到了 `Animation Builder` 时才需要;Angular 标准的动画支持是不需要任何腻子脚本的(截至 NG6)。", + "original": "[Animations](guide/animations)\n
Only if `Animation Builder` is used within the application--standard\n animation support in Angular doesn't require any polyfills (as of NG6).", + "translation": "[动画](guide/animations)\n
只有在应用中用到了 `Animation Builder` 时才需要;Angular 标准的动画支持是不需要任何腻子脚本的(截至 NG6)。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/browser-support.md" }, { @@ -3449,6 +3469,11 @@ "translation": "[生命周期钩子](guide/lifecycle-hooks)章现在更加简短,并且对强调了Angular是以什么顺序来调用钩子方法的。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/change-log.md" }, + { + "original": "Template syntax", + "translation": "模板语法", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/cheatsheet.md" + }, { "original": "# Component Interaction", "translation": "# 组件之间的交互", @@ -3519,6 +3544,11 @@ "translation": "运行应用程序会显示三个英雄:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/component-interaction.md" }, + { + "original": "

Test it

", + "translation": "

测试一下

", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/component-interaction.md" + }, { "original": "E2E test that all children were instantiated and displayed as expected:", "translation": "端到端测试,用于确保所有的子组件都像所期待的那样被初始化并显示出来。", @@ -3549,6 +3579,11 @@ "translation": "下面的`NameParentComponent`展示了各种名字的处理方式,包括一个全是空格的名字。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/component-interaction.md" }, + { + "original": "

Test it

", + "translation": "

测试一下

", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/component-interaction.md" + }, { "original": "E2E tests of input property setter with empty and non-empty names:", "translation": "端到端测试:输入属性的setter,分别使用空名字和非空名字。", @@ -3881,7 +3916,7 @@ }, { "original": "You can run the in Stackblitz and download the code from there.", - "translation": "你可以在 Stackblitz 上运行本章这些代码的并下载这些代码。", + "translation": "运行来试用本页的代码。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/component-styles.md" }, { @@ -4235,7 +4270,7 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/dependency-injection-in-action.md" }, { - "original": "See the of the code in this cookbook.", + "original": "See the \nof the code in this cookbook.", "translation": "到查看本烹饪书的源码。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/dependency-injection-in-action.md" }, @@ -4465,7 +4500,7 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/dependency-injection-in-action.md" }, { - "original": "Find this example in live code and confirm that the three `HeroBioComponent` instances have their own cached hero data.", + "original": "Find this example in live code\nand confirm that the three `HeroBioComponent` instances have their own cached hero data.", "translation": "到在线例子中找到这个例子,确认三个`HeroBioComponent`实例拥有自己独立的英雄数据缓存。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/dependency-injection-in-action.md" }, @@ -6821,7 +6856,7 @@ }, { "original": "Note the following:", - "translation": "请注意以下几点:", + "translation": "要注意的有两点:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/form-validation.md" }, { @@ -10284,6 +10319,11 @@ "translation": "下面是每个练习简短的描述:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/lifecycle-hooks.md" }, + { + "original": "Description", + "translation": "描述", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/lifecycle-hooks.md" + }, { "original": "Demonstrates every lifecycle hook.\n Each hook method writes to the on-screen log.", "translation": "展示每个生命周期钩子,每个钩子方法都会在屏幕上显示一条日志。", @@ -10754,6 +10794,11 @@ "translation": "对下列概念有基本的理解:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/module-types.md" }, + { + "original": "Feature", + "translation": "特性", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/module-types.md" + }, { "original": "A basic understanding of the following concepts:", "translation": "对下列概念有基本的理解:", @@ -11105,7 +11150,7 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/ngmodule-faq.md" }, { - "original": "", + "original": "Angular doesn't recognize these names but Angular developers do.\nFollow this convention when you write similar modules with configurable service providers.", "translation": "Angular并不识别这些名字,但是Angular的开发人员可以。\n当你写类似的需要可配置的服务提供商时,请遵循这个约定。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/ngmodule-faq.md" }, @@ -18530,7 +18575,7 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/setup-systemjs-anatomy.md" }, { - "original": "Try the sample application \n and the unit test\n as _live examples_.", + "original": "Try the sample application\n and the unit test\n as _live examples_.", "translation": "在live example中试试范例程序单元测试", "sourceFile": "/Users/twer/private/GDE/content-3/guide/setup-systemjs-anatomy.md" }, @@ -18550,8 +18595,8 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/setup-systemjs-anatomy.md" }, { - "original": "Tooling configuration files and folders.", - "translation": "配置文件和文件夹的工具。", + "original": "Tooling configuration files and folders.\n Ignore them until you have a compelling reason to do otherwise.", + "translation": "配置文件和文件夹的工具。\n 除非你有足够的理由,否则别动它。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/setup-systemjs-anatomy.md" }, { @@ -18681,7 +18726,7 @@ }, { "original": "`npm start` fails in _Bash for Windows_ in versions earlier than the Creator's Update (April 2017).", - "translation": "在*Bash for Windows*中`npm start`可能会失败,因为到2017-04为止它还不支持访问网络上的服务器。", + "translation": "在*Bash for Windows*中`npm start`可能会失败,因为到2017-01为止它还不支持访问网络上的服务器。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/setup.md" }, { @@ -22345,23 +22390,8 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, { - "original": "Interpolation", - "translation": "插值表达式", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Property", - "translation": "属性", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Class", - "translation": "CSS 类", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Style", - "translation": "样式", + "original": "Interpolation
\n Property
\n Attribute
\n Class
\n Style", + "translation": "插值表达式
\n 属性
\n Attribute
\n CSS 类
\n 样式", "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, { @@ -22384,21 +22414,6 @@ "translation": "双向", "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, - { - "original": "", - "translation": "译注:由于 HTML attribute 和 DOM property 在中文中都被翻译成了“属性”,无法区分,\n而接下来的部分重点是对它们进行比较。", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "", - "translation": "我们无法改变历史,因此,在本章的翻译中,保留了它们的英文形式,不加翻译,以免混淆。\n本章中,如果提到“属性”的地方,一定是指 property,因为在 Angular 中,实际上很少涉及 attribute。", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "", - "translation": "但在其它章节中,为简单起见,凡是能通过上下文明显区分开的,就仍统一译为“属性”,\n区分不明显的,会加注英文。", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, { "original": "Binding types other than interpolation have a **target name** to the left of the equal sign,\neither surrounded by punctuation (`[]`, `()`) or preceded by a prefix (`bind-`, `on-`, `bindon-`).", "translation": "除了插值表达式之外的绑定类型,在等号左边是**目标名**,\n 无论是包在括号中 (`[]`、`()`) 还是用前缀形式 (`bind-`、`on-`、`bindon-`) 。", @@ -22590,18 +22605,8 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, { - "original": "Element property", - "translation": "元素的 property", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Component property", - "translation": "组件的 property", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Directive property", - "translation": "指令的 property", + "original": "Element property
\n Component property
\n Directive property", + "translation": "元素的 property
\n 组件的 property
\n 指令的 property", "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, { @@ -22610,18 +22615,8 @@ "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, { - "original": "Element event", - "translation": "元素的事件", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Component event", - "translation": "组件的事件", - "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" - }, - { - "original": "Directive event", - "translation": "指令的事件", + "original": "Element event
\n Component event
\n Directive event", + "translation": "元素的事件
\n 组件的事件
\n 指令的事件", "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, { @@ -22954,6 +22949,21 @@ "translation": "这里是表格渲染出来的样子:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, + { + "original": "One-Two", + "translation": "1-2列", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" + }, + { + "original": "Five", + "translation": "五列", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" + }, + { + "original": "Six", + "translation": "六列", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" + }, { "original": "One of the primary use cases for attribute binding\nis to set ARIA attributes, as in this example:", "translation": "attribute 绑定的主要用例之一是设置 ARIA attribute(译注:ARIA指可访问性,用于给残障人士访问互联网提供便利),\n就像这个例子中一样:", @@ -23894,6 +23904,11 @@ "translation": "为简洁起见,以下讨论会涉及到**组件**,因为这个主题主要是组件作者所关心的问题。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" }, + { + "original": "

Discussion

", + "translation": "

讨论

", + "sourceFile": "/Users/twer/private/GDE/content-3/guide/template-syntax.md" + }, { "original": "You are usually binding a template to its _own component class_.\nIn such binding expressions, the component's property or method is to the _right_ of the (`=`).", "translation": "在下面的例子中,`iconUrl`和`onSave`是组件的成员,它们在`=`右侧引号语法中被引用了。", diff --git a/aio/tools/translator/extractor.ts b/aio/tools/translator/extractor.ts index 726881cfcb..8f4fdf8f23 100644 --- a/aio/tools/translator/extractor.ts +++ b/aio/tools/translator/extractor.ts @@ -5,6 +5,7 @@ import { isOnlyBeginTag, normalizeLines, originalIsNotChinese, + originalIsNotAlertDivTag, originalIsNotOnlyBeginTag, translationHasNotCodeExample, } from './utils'; @@ -48,6 +49,7 @@ export function gatherTranslations(text: string): DictEntry[] { .filter(isNotCnPages) .filter(translationHasNotCodeExample) .filter(originalIsNotChinese) + .filter(originalIsNotAlertDivTag) .filter(originalIsNotOnlyBeginTag) .map(purifyEntry); } diff --git a/aio/tools/translator/utils.ts b/aio/tools/translator/utils.ts index 614cd3fd87..64e1018197 100644 --- a/aio/tools/translator/utils.ts +++ b/aio/tools/translator/utils.ts @@ -9,12 +9,8 @@ export function originalIsNotChinese(entry: DictEntry): boolean { return !isTranslation(entry.original); } -export function isTagLine(text: string) { - return /^\s*<\/?\w+.*/.test(text); -} - -export function originalIsNotTag(entry: DictEntry): boolean { - return !isTagLine(entry.original); +export function originalIsNotAlertDivTag(entry: DictEntry): boolean { + return !/^