diff --git a/aio/tools/translator/bin/translate-one.ts b/aio/tools/translator/bin/translate-one.ts index 0b79aecc04..69d48b7117 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/aot-compiler.md'; -translateFile(__dirname + '/../../../../../content-en/' + filename, dirs.content + filename); +const filename = 'guide/reactive-forms.md'; +translateFile(__dirname + '/../../../../../angular/aio/content/' + filename, dirs.content + filename); diff --git a/aio/tools/translator/extractor.ts b/aio/tools/translator/extractor.ts index 9070bd179b..80a41b9772 100644 --- a/aio/tools/translator/extractor.ts +++ b/aio/tools/translator/extractor.ts @@ -10,7 +10,6 @@ import { originalIsNotOnlyBeginTag, originalIsNotPureCloseTag, originalIsNotSpecialDivTag, - translationHasNotCodeExample, } from './utils'; export function splitAndTrim(text = ''): string[] { @@ -27,7 +26,7 @@ export function isTranslation(text) { export function gatherTranslations(text: string): DictEntry[] { const lines = splitAndTrim(normalizeLines(text)); - const result = []; + const result: any[] = []; for (let i = 1; i < lines.length; ++i) { const translation = purifyText(lines[i]); if (hasInlineText(translation)) { diff --git a/aio/tools/translator/utils.ts b/aio/tools/translator/utils.ts index 760a713c9b..b252db6e71 100644 --- a/aio/tools/translator/utils.ts +++ b/aio/tools/translator/utils.ts @@ -35,15 +35,15 @@ export function isNotImg(entry: DictEntry): boolean { } export function isNotCheatSheet(entry: DictEntry): boolean { - return !/cheatsheet.md$/.test(entry.sourceFile); + return !/cheatsheet.md$/.test(entry.sourceFile!!); } export function isNotMarketingDocs(entry: DictEntry): boolean { - return !/marketing\/docs.md$/.test(entry.sourceFile); + return !/marketing\/docs.md$/.test(entry.sourceFile!!); } export function isNotCnPages(entry: DictEntry): boolean { - return !/cn\/.*?.md$/.test(entry.sourceFile); + return !/cn\/.*?.md$/.test(entry.sourceFile!!); } export function isHead(line: string): boolean { @@ -166,7 +166,7 @@ export function fuzzyTest(text1: string, text2: string): boolean { } export function exactlyTest(key: string, text: string): boolean { - return key && key === text; + return !!key && key === text; } export function kernelText(text: string): string {