diff --git a/aio/content/dict/checker.spec.ts b/aio/content/dict/checker.spec.ts index 88f1d938c3..969d3e1e2d 100644 --- a/aio/content/dict/checker.spec.ts +++ b/aio/content/dict/checker.spec.ts @@ -3,17 +3,31 @@ import { DictEntry } from './dict-entry'; import { gatherFromMarkdownFiles, isTranslation } from './extractor'; describe('auto check translations', function () { - const entries = gatherFromMarkdownFiles(__dirname + '/../'); + const entries = gatherFromMarkdownFiles(__dirname + '/../') + .filter(isNotCheatSheet) + .filter(isNotMarketingDocs) + .filter(isNotCnPages); + it('should not have in translation', function () { const codeExamples = entries.filter(entry => entry.translation.indexOf(' isTranslation(entry.original)) - .filter(isNotImg) - .filter(isNotCheatSheet) - .filter(isNotMarketingDocs) - .filter(isNotCnPages); + .filter(isNotImg); + expect(lines).eql([]); + }); + + it('should have same head level', function () { + const lines = entries + .filter(entry => isHead(entry.original) && isHead(entry.translation)) + .filter(entry => { + const originalLevel = entry.original.replace(/^(#+).*$/, '$1').length; + const translationLevel = entry.translation.replace(/^(#+).*$/, '$1').length; + return originalLevel !== translationLevel; + }); + expect(lines).eql([]); }); }); @@ -33,3 +47,7 @@ function isNotMarketingDocs(entry: DictEntry): boolean { function isNotCnPages(entry: DictEntry): boolean { return !/cn\/.*?.md$/.test(entry.sourceFile); } + +function isHead(line: string): boolean { + return /^#/.test(line); +} diff --git a/aio/content/dict/dict-3.json b/aio/content/dict/dict-3.json index b0bdfe9756..2dd0d32b79 100644 --- a/aio/content/dict/dict-3.json +++ b/aio/content/dict/dict-3.json @@ -11571,7 +11571,7 @@ }, { "original": "## What's the difference between a _bootstrap_ component and an _entry component_?", - "translation": "### *引导组件*和*入口组件*有什么不同?", + "translation": "## *引导组件*和*入口组件*有什么不同?", "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/ngmodule-faq.md" }, { @@ -12226,7 +12226,7 @@ }, { "original": "## The *PipeTransform* interface", - "translation": "### *PipeTransform*接口", + "translation": "## *PipeTransform*接口", "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/pipes.md" }, { @@ -15776,7 +15776,7 @@ }, { "original": "### _Activated Route_ in action", - "translation": "#### _Activated Route_ 实战", + "translation": "### _Activated Route_ 实战", "sourceFile": "/Users/twer/private/GDE/angular-cn/aio/content/guide/router.md" }, { diff --git a/aio/content/guide/ngmodule-faq.md b/aio/content/guide/ngmodule-faq.md index 681e157d1c..c1e65e0869 100644 --- a/aio/content/guide/ngmodule-faq.md +++ b/aio/content/guide/ngmodule-faq.md @@ -870,7 +870,7 @@ For more information, see [Entry Components](guide/entry-components). ## What's the difference between a _bootstrap_ component and an _entry component_? -### *引导组件*和*入口组件*有什么不同? +## *引导组件*和*入口组件*有什么不同? A bootstrapped component _is_ an [entry component](guide/ngmodule-faq#q-entry-component-defined) that Angular loads into the DOM during the bootstrap process (application launch). diff --git a/aio/content/guide/pipes.md b/aio/content/guide/pipes.md index cd5355b798..6336394787 100644 --- a/aio/content/guide/pipes.md +++ b/aio/content/guide/pipes.md @@ -276,7 +276,7 @@ Your pipe has one such parameter: the `exponent`. ## The *PipeTransform* interface -### *PipeTransform*接口 +## *PipeTransform*接口 The `transform` method is essential to a pipe. The `PipeTransform` *interface* defines that method and guides both tooling and the compiler. diff --git a/aio/content/guide/router.md b/aio/content/guide/router.md index 8156b9d556..74f0923ede 100644 --- a/aio/content/guide/router.md +++ b/aio/content/guide/router.md @@ -2621,7 +2621,7 @@ the `HeroDetailComponent` via the `ActivatedRoute` service. ### _Activated Route_ in action -#### _Activated Route_ 实战 +### _Activated Route_ 实战 Import the `Router`, `ActivatedRoute`, and `ParamMap` tokens from the router package.