From c618678281a259c46845f092ced0157b626ef02c Mon Sep 17 00:00:00 2001 From: Zhicheng Wang Date: Wed, 7 Mar 2018 13:28:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=BA=E5=B7=A5=E4=BF=AE=E8=AE=A2?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BF=BB=E8=AF=91=20fix:=20=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=8C=96=E5=8E=9F=E6=96=87=E4=B8=AD=E7=9A=84=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aio/content/guide/router.md | 2 +- aio/content/guide/template-syntax.md | 35 ++++++++++++++++------- aio/tools/translator/bin/translate-one.ts | 2 +- aio/tools/translator/dict-3.json | 6 ++-- aio/tools/translator/utils.ts | 5 ++++ 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/aio/content/guide/router.md b/aio/content/guide/router.md index db5d45574f..87d50473fc 100644 --- a/aio/content/guide/router.md +++ b/aio/content/guide/router.md @@ -5622,7 +5622,7 @@ navigates from the root of the application down to the *Dragon Crisis*: * The first item in the array identifies the parent route (`/crisis-center`). - 数组中的第一个条目用来标记出父路由('/crisis-center')。 + 数组中的第一个条目标记出了父路由(`/crisis-center`)。 * There are no parameters for this parent route so you're done with it. diff --git a/aio/content/guide/template-syntax.md b/aio/content/guide/template-syntax.md index 172a7ec389..0a50845535 100644 --- a/aio/content/guide/template-syntax.md +++ b/aio/content/guide/template-syntax.md @@ -1504,26 +1504,39 @@ Here's how the table renders: 这里是表格渲染出来的样子: - - 1-2列 + - - - Six + - 六列 + + + + + -
- One-Two +
-
+ One-Two - Five + 1-2列 - 五列 + +
+ + Five + + 五列 + + + + Six + + 六列 + +
One of the primary use cases for attribute binding diff --git a/aio/tools/translator/bin/translate-one.ts b/aio/tools/translator/bin/translate-one.ts index a8ac6b1e82..ee6b2252d4 100644 --- a/aio/tools/translator/bin/translate-one.ts +++ b/aio/tools/translator/bin/translate-one.ts @@ -3,5 +3,5 @@ import { dirs } from '../dirs'; import { translateFile } from '../translate'; -const filename = 'guide/template-syntax.md'; +const filename = 'guide/router.md'; translateFile(__dirname + '/../../../../../content-en/' + filename, dirs.content + filename); diff --git a/aio/tools/translator/dict-3.json b/aio/tools/translator/dict-3.json index 2e827cccfc..4789335456 100644 --- a/aio/tools/translator/dict-3.json +++ b/aio/tools/translator/dict-3.json @@ -6856,7 +6856,7 @@ }, { "original": "Note the following:", - "translation": "要注意的有两点:", + "translation": "请注意以下几点:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/form-validation.md" }, { @@ -12211,7 +12211,7 @@ }, { "original": "Note the following:", - "translation": "要注意的有两点:", + "translation": "请注意以下几点:", "sourceFile": "/Users/twer/private/GDE/content-3/guide/pipes.md" }, { @@ -17946,7 +17946,7 @@ }, { "original": "* The first item in the array identifies the parent route (`/crisis-center`).", - "translation": "数组中的第一个条目用来标记出父路由('/crisis-center')。", + "translation": "数组中的第一个条目标记出了父路由(`/crisis-center`)。", "sourceFile": "/Users/twer/private/GDE/content-3/guide/router.md" }, { diff --git a/aio/tools/translator/utils.ts b/aio/tools/translator/utils.ts index 6a5da487f3..df3f0537a2 100644 --- a/aio/tools/translator/utils.ts +++ b/aio/tools/translator/utils.ts @@ -56,6 +56,11 @@ export function normalizeLines(text: string): string { text = text.replace(oneLineCommentPattern, '\n\n$1$2$3\n'); const oneLineBrTagPattern = /\n( *)(
)( *)(?=\n)/g; text = text.replace(oneLineBrTagPattern, '\n\n$1$2$3\n'); + + // 原文中有 back to top 被分成两行的情况,这里把它标准化一下 + const specialBackToTopPattern = /Back to top\s+<\/a>/g; + text = text.replace(specialBackToTopPattern, 'Back to top'); + const backToTopPattern = /\n( *)(Back to top<\/a>)( *)(?=\n)/g; text = text.replace(backToTopPattern, '\n\n$1$2$3\n'); const atTagCommentPattern = /\n( *)({@a.*})( *)(?=\n)/g;