From 1f95c12471d1041108238cef1881a8ba4524f60c Mon Sep 17 00:00:00 2001 From: rexebin Date: Sun, 27 Nov 2016 10:59:31 +0000 Subject: [PATCH] fix translate.js pure english. --- public/docs/ts/latest/guide/setup.jade | 16 ++++++++++------ public/translate/cn/translate.js | 25 ++++++++++++++----------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/public/docs/ts/latest/guide/setup.jade b/public/docs/ts/latest/guide/setup.jade index 9ca465e6a4..00d2cc9a93 100644 --- a/public/docs/ts/latest/guide/setup.jade +++ b/public/docs/ts/latest/guide/setup.jade @@ -17,19 +17,23 @@ a#develop-locally The QuickStart live-coding example is an Angular _playground_. It's not where you'd develop a real application. You [should develop locally](#why-locally "Why develop locally") on your own machine ... and that's also how we think you should learn Angular. + + 《快速起步》在线编程例子是 Angular 的*游戏场*。 + 它不是你开发的真实应用的地方。 + 你应该在自己的电脑上[本地开发](#why-locally "Why develop locally")... 你也应该在本地环境学习 Angular。 - - 《快速起步》 live-coding example is an Angular _playground_. - It's not where you'd develop a real application. - You [should develop locally](#why-locally "Why develop locally") on your own machine ... and that's also how we think you should learn Angular. - - + Setting up a new project on your machine is quick and easy with the **QuickStart seed**, maintained [on github](!{_qsRepo} "Install the github QuickStart repo"). + 利用 [github 上](!{_qsRepo} "Install the github QuickStart repo")的**快速起步种子**在你的电脑上搭建一个新项目是很快很容易的。 + Make sure you have [!{_prereq} installed](#install-prerequisites "What if you don't have !{_prereq}?"). Then ... + + 确定你已经安装了[!{_prereq}](#install-prerequisites "What if you don't have !{_prereq}?"),然后: + 1. Create a project folder (you can call it `quickstart` and rename it later). 1. [Clone](#clone "Clone it from github") or [download](#download "download it from github") the **QuickStart seed** into your project folder. 1. !{_Install} [!{_npm}](#install-prerequisites "What if you don't have !{_prereq}?") packages. diff --git a/public/translate/cn/translate.js b/public/translate/cn/translate.js index 5ef6978e0f..d5024641d1 100644 --- a/public/translate/cn/translate.js +++ b/public/translate/cn/translate.js @@ -92,17 +92,20 @@ var sourceVisible = localStorage.getItem('source-visible') === 'true'; if (sibling.children) { processContainer(sibling); } - $current.addClass('original-english'); - $sibling.addClass('translated'); - $sibling.addClass('translated-cn'); - $sibling.after($current); - $sibling.on('click', function (event) { - // for nested structure. - event.stopPropagation(); - $current.toggleClass('hidden'); - }); - // addSpacingBetweenCnAndEn(sibling); - return true; + if(!isPureEnglish(sibling.textContent)){ + $current.addClass('original-english'); + $sibling.addClass('translated'); + $sibling.addClass('translated-cn'); + $sibling.after($current); + $sibling.on('click', function (event) { + // for nested structure. + event.stopPropagation(); + $current.toggleClass('hidden'); + }); + // addSpacingBetweenCnAndEn(sibling); + return true; + } + } } }