fix: 对 section 和 code-tabs 换行

This commit is contained in:
Zhicheng Wang 2018-03-07 11:25:41 +08:00
parent 51bd598826
commit 38af562aff
5 changed files with 1479 additions and 674 deletions

View File

@ -3,5 +3,5 @@
import { dirs } from '../dirs'; import { dirs } from '../dirs';
import { translateFile } from '../translate'; import { translateFile } from '../translate';
const filename = 'attribute-directives.md'; const filename = 'guide/i18n.md';
translateFile(__dirname + '/../../../../../content-en/' + 'guide/' + filename, dirs.content + 'guide/' + filename); translateFile(__dirname + '/../../../../../content-en/' + filename, dirs.content + filename);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2969,6 +2969,11 @@
"translation": "[Web 动画](guide/browser-support#web-animations)", "translation": "[Web 动画](guide/browser-support#web-animations)",
"sourceFile": "/Users/twer/private/GDE/content-3/guide/browser-support.md" "sourceFile": "/Users/twer/private/GDE/content-3/guide/browser-support.md"
}, },
{
"original": "<p>If AnimationBuilder is used then the polyfill will enable scrubbing\n support for IE/Edge and Safari (Chrome and Firefox support this natively).</p>",
"translation": "<p>如果使用了AnimationBuilder那么腻子脚本将为 IE/Edge 和 Safari 启用擦除scrubbing支持Chrome 和 Firefox 原生支持此特性)</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/guide/browser-support.md"
},
{ {
"original": "If you use the following deprecated i18n pipes:", "original": "If you use the following deprecated i18n pipes:",
"translation": "如果你使用下列已废弃的i18n管道", "translation": "如果你使用下列已废弃的i18n管道",
@ -27480,13 +27485,13 @@
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
"original": "A quick look at an Angular \"hello world\" application.", "original": "<p>A quick look at an Angular \"hello world\" application.</p>",
"translation": "快速体验 Angular 的 \"hello world\" 应用。", "translation": "<p>快速体验 Angular 的 \"hello world\" 应用。</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
"original": "<p class=\"card-footer\">", "original": "<p class=\"card-footer\">Angular in Action</p>",
"translation": "体验 Angular", "translation": "<p class=\"card-footer\">体验 Angular</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
@ -27495,13 +27500,13 @@
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
"original": "Get going on your own environment with the Quickstart.", "original": "<p>Get going on your own environment with the Quickstart.</p>",
"translation": "跟随\"快速上手\"构建你的开发环境", "translation": "<p>跟随\"快速上手\"构建你的开发环境</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
"original": "<p class=\"card-footer\">", "original": "<p class=\"card-footer\">Quickstart</p>",
"translation": "快速上手", "translation": "<p class=\"card-footer\">快速上手</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
@ -27510,13 +27515,13 @@
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
"original": "Learn Angular application fundamentals, starting with an architecture overview.", "original": "<p>Learn Angular application fundamentals, starting with an architecture overview.</p>",
"translation": "学习 Angular 应用的基本原理。<br/>从架构概览开始。", "translation": "<p>学习 Angular 应用的基本原理。<br/>从架构概览开始。</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {
"original": "<p class=\"card-footer\">", "original": "<p class=\"card-footer\">Architecture</p>",
"translation": "架构", "translation": "<p class=\"card-footer\">架构</p>",
"sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md" "sourceFile": "/Users/twer/private/GDE/content-3/marketing/docs.md"
}, },
{ {

View File

@ -52,7 +52,7 @@ export function normalizeLines(text: string): string {
text = text.replace(blockElementPattern, '\n\n'); text = text.replace(blockElementPattern, '\n\n');
const hxPattern = /(\n *#+ .*)(?=\n)/g; const hxPattern = /(\n *#+ .*)(?=\n)/g;
text = text.replace(hxPattern, '\n$1\n'); text = text.replace(hxPattern, '\n$1\n');
const oneLinePairedTagPattern = /\n( *)<(p|div|h\d+|a|code-example)( ?[^>\n]*)>([^<\n]*)<\/\2>( *)(?=\n)/g; const oneLinePairedTagPattern = /\n( *)<(p|div|h\d+|a|code-example|section)( ?[^>\n]*)>([^<\n]*)<\/\2>( *)(?=\n)/g;
text = text.replace(oneLinePairedTagPattern, '\n\n$1<$2$3>$4</$2>$5\n'); text = text.replace(oneLinePairedTagPattern, '\n\n$1<$2$3>$4</$2>$5\n');
const oneLineThTdTagPattern = /\n( *)<(th|td|li)( ?[^>\n]*)>(.*)<\/\2>( *)(?=\n)/g; const oneLineThTdTagPattern = /\n( *)<(th|td|li)( ?[^>\n]*)>(.*)<\/\2>( *)(?=\n)/g;
text = text.replace(oneLineThTdTagPattern, '\n\n$1<$2$3>\n\n$1 $4\n\n$1</$2>$5\n'); text = text.replace(oneLineThTdTagPattern, '\n\n$1<$2$3>\n\n$1 $4\n\n$1</$2>$5\n');
@ -62,12 +62,12 @@ export function normalizeLines(text: string): string {
text = text.replace(oneLineBrTagPattern, '\n\n$1$2$3\n'); text = text.replace(oneLineBrTagPattern, '\n\n$1$2$3\n');
const atTagCommentPattern = /\n( *)({@a.*})( *)(?=\n)/g; const atTagCommentPattern = /\n( *)({@a.*})( *)(?=\n)/g;
text = text.replace(atTagCommentPattern, '\n\n$1$2$3\n'); text = text.replace(atTagCommentPattern, '\n\n$1$2$3\n');
const oneLineClosedTagPattern = /\n( *)<(hr|p)(\/?)>( *)(?=\n)/g; const oneLineClosedTagPattern = /\n( *)<(hr)(\/?)>( *)(?=\n)/g;
text = text.replace(oneLineClosedTagPattern, '\n\n$1<$2$3>$4\n'); text = text.replace(oneLineClosedTagPattern, '\n\n$1<$2$3>$4\n');
const multiLinePairedTagPattern = /\n( *)<(header|p)( *[^>\n]*)>\n*(.*?)\n*( *)<\/\2>( *)(?=\n)/g; const multiLinePairedTagPattern = /\n( *)<(header)( *[^>\n]*)>\n*(.*?)\n*( *)<\/\2>( *)(?=\n)/g;
text = text.replace(multiLinePairedTagPattern, '\n\n$1<$2$3>\n\n$4\n\n$5</$2>$6\n'); text = text.replace(multiLinePairedTagPattern, '\n\n$1<$2$3>\n\n$4\n\n$5</$2>$6\n');
const blockTagPattern = /\n( *)<(\/?)(td|th|div|code-example)( *[^>\n]*)>( *)(?=\n)/g; const blockTagPattern = /\n( *)<(\/?)(td|th|div|code-example|code-tabs)( *[^>\n]*)>( *)(?=\n)/g;
text = text.replace(blockTagPattern, '\n\n$1<$2$3$4>$5\n'); text = text.replace(blockTagPattern, '\n\n$1<$2$3$4>$5\n');
const multiLineCodePattern = /\n( *)```(\w*)( *)(?=\n)/g; const multiLineCodePattern = /\n( *)```(\w*)( *)(?=\n)/g;