Skip to content

feat: adjust index.ts file in zh #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 2 additions & 72 deletions docs/typescriptlang/zh/index.ts
Original file line number Diff line number Diff line change
@@ -1,79 +1,9 @@
export const indexCopy = {
index_headline: "<bold>拥有类型的 JavaScript,且适用于任何规模的工程</bold>",
index_byline: "TypeScript 扩展了 JavaScript ,为它添加了类型支持。",
index_summary:
"TypeScript 可以在您运行代码之前找到错误并提供修复,从而改善您的开发体验。",
index_locations:
"任何浏览器,任何操作系统,任何运行 JavaScript 的地方,完全开源。",

index_what_is: "什么是 TypeScript?",

index_what_is_js: "JavaScript,以及更多。",
index_what_is_js_copy: `
<p>TypeScript 是一个开源的编程语言,通过在 JavaScript(世界上最常用的语言之一) 的基础上添加静态类型定义构建而成。</p>

<p>类型提供了一种描述对象形状的方法。可以帮助提供更好的文档,还可以让 TypeScript 验证你的代码可以正常工作。</p>

<p>在 TypeScript 中,不是每个地方都需要标注类型,因为类型推断允许您无需编写额外的代码即可获得大量功能。</p>`,

index_trust: "值得信任的结果",
index_trust_copy_a: `所有有效的 JavaScript 代码同时也是有效的 TypeScript 代码。你也许会有类型检查的错误,但是这不会阻止你运行生成的 JavaScript。尽管您可以选择更严格的行为,但是这意味着一切依然在您的控制中。`,
index_trust_copy_b: `TypeScript 代码通过 TypeScript 编译器或 <babel>Babel</babel> 转译为 JavaScript 代码,生成后的代码也是干净,简洁,运行在任何可以运行 JavaScript 的地方,无论是在浏览器,Node.JS 还是在您的应用中。`,
index_standards: "与标准同步发展",
index_standards_copy: `
<p>TypeScript 团队为指导 JavaScript 语言发展的 TC39 委员会作出了贡献。</p>

<p>当新的功能到达 stage 3 阶段后,他们将被包含进 TypeScript。</p>

<p>例如 TypeScript 团队推进了“可选链”,“空合并操作符”,throw 表达式和 regex 匹配索引之类的提案。</p>`,

index_gradual: "渐进式迁移",
index_gradual_copy: `
<p>使用 TypeScript 并不是一个二元选择,您可以首先使用 JSDoc 来注释现有的 JavaScript,然后只让 TypeScript 检查一小部分文件,从而让您的代码可以在后续迭代中逐渐完成迁移。</p>

<p>TypeScript 的类型推导意味着只有您希望获得更佳的安全性时,才需要在您的代码中写更多的类型注释。</p>`,

index_dts: "每个人的类型",
index_dts_copy: `
<p>这个世界上大多数的 JavaScript 都是没有类型的,所以类型推断只能提供很有限的支持。为了处理这种情况,TypeScript 团队帮助维护了 <dt>Definitely Typed</dt> - 一个为已经存在的 JavaScript 提供类型定义和内联文档的社区项目。

<p>这个项目使 JavaScript 库的类型定义可以由社区来维护,而不需要为他们的维护者带来额外的负担。</p>`,

index_tools: "始终如一的优质工具",
index_tools_copy: `
<p>通过 TypeScript 中对编辑器集成的处理,你可以在很多不同的编辑器中获得一致的使用体验。</p>

<p>这允许你可以在不同编辑器之间快速切换,例如 <vs>Visual Studio</vs>, <vsc>Visual Studio Code</vsc>, <nova>Nova</nova>, <atom>Atom</atom>, <subl>Sublime Text</subl>, <emacs>Emacs</emacs>, <vim>Vim</vim>, <webs>WebStorm</webs> and <eclipse>Eclipse</eclipse> 等。</p>

<p>TypeScript 的编辑器集成中支持 JavaScript,所以您可能已经在不知不觉中使用到了 TypeScript。
`,

index_started_title: "开始使用",
index_started_handbook: "手册",
index_started_handbook_blurb: "学习语言",
index_started_community: "社区",
index_started_community_blurb: "不断更新",
index_install: "安装 TypeScript",
index_install_ref: `
<p>你可以使用 npm 安装 TypeScript<install>
<p>之后执行 <code>tsc</code> 来运行 TypeScript 编译器 <pre>npx tsc</pre>
`,
// The index page copy lives at index2.ts
index_releases: "季度发布",
index_releases_pt1: "我们的下一个版本发布是 ",
index_releases_pt2: ", 计划于 ",
index_releases_released: "发布",
index_releases_beta: "Beta 测试",
index_releases_rc: "预发布",

index_migration_title: "迁移故事",
index_migration_oss: "开源的 TypeScript",
index_videos_title: "查看 TypeScript 实践",

index_cta_play: "在浏览器中尝试",
index_cta_install: "在本地安装",

index_started_docs: "开始一个项目",
index_started_docs_blurb: "寻找一个入手点",
index_started_tooling: "工具",
index_started_tooling_blurb: "深入 TypeScript",
}
}
79 changes: 79 additions & 0 deletions docs/typescriptlang/zh/index2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
export const indexCopy = {
index_2_headline:
"TypeScript 是 <bold>带有类型语法的JavaScript</bold>",
index_2_byline: "TypeScript 扩展了 JavaScript ,为它添加了类型支持。",
index_2_summary:
"TypeScript是一种基于JavaScript的强类型编程语言,可以在任何规模上的项目为您提供更好的工具体验",

// Above the fold
index_2_cta_install: "现在尝试TypeScript",
index_2_cta_install_subtitle: "在线或通过npm",

index_2_cta_play: "在浏览器中尝试",
index_2_cta_play_subtitle: "通过演练场",

index_2_cta_download: "在你的电脑上",
index_2_cta_download_subtitle: "通过npm",

// Editor titles
index_2_tab_1: "编辑检查",
index_2_tab_2: "智能补全",
index_2_tab_3: "接口",
index_2_tab_4: "JSX",
index_2_tab_5: "ESNext",

// Quick pitch
index_2_what_is: "什么是TypeScript?",
index_2_what_is_js: "JavaScript以及更多",

index_2_what_is_js_copy: `TypeScript 向 JavaScript 添加额外的语法以提供<strong>与您的编辑器进行更紧密的集成</strong>。使得在编辑器中尽的早发现错误`,
index_2_trust: "值得信任的结果",
index_2_trust_copy: `TypeScript 代码转换成 JavaScript, 它 <strong>可以在 JavaScript 运行的任何地方运行</strong>: 在浏览器中、在 Node.js 或 Deno 上以及在您的应用程序中。`,
index_2_scale: "规模安全性",
index_2_scale_copy: `TypeScript 能够理解 JavaScript t并使用<strong>类型推断为您提供了很好的工具</strong>,而无需额外的代码。`,

// Links for getting started (this shows up twice)
index_2_started_title: "开始使用",
index_2_started_handbook: "手册",
index_2_started_handbook_blurb: "学习语言",
index_2_install: "安装 TypeScript",
index_2_playground_blurb: "在你的浏览器中尝试",

index_2_migrate_1: "JavaScript 文件",
index_2_migrate_2: "带有TS检查的 JavaScript ",
index_2_migrate_3: "带有JSDoc的 JavaScript",
index_2_migrate_4: "TypeScript 文件",

// Stories + OSS users`
index_2_migration_title: "推荐 TypeScript",
index_2_migration_oss: "开源的 TypeScript",

// Survey results
index_2_loved_by: "深受开发者喜爱",
index_2_loved_stack: `在<so>Stack Overflow 2020 开发人员调查</so>中被评为<strong>第二大最受欢迎的编程语言</strong>。`,
index_2_loved_state_js: `在 <js>2020 State of JS</js>调查者中,有<strong>78%</strong>的人使用过TypeScript,并且其中<strong>93% 的人说还会再次使用</strong>。`,
index_2_loved_state_js2: `TypeScript 因每年使用数量同比增长而获得了<strong>“最受采用技术”</strong>奖项`,

// Show me some code
index_2_describe: "描述您的数据",
index_2_describe_blurb1:
"在您的代码中<strong>描述对象和函数的形状结构</strong>。",
index_2_describe_blurb2:
"使您可以<strong>在编辑器中查看文档和问题</strong>。",

// Show how tsc 'works'
index_2_transform: "TypeScript 删除键能够编程JavaScript。",
index_2_transform_1: "<strong>TypeScript 文件</strong>",
index_2_transform_2: "<strong>移除类型</strong>",
index_2_transform_3: "<strong>JavaScript 文件</strong>",

// Adopt TS gradually animations
index_2_adopt: "逐步采用TypeScript",
index_2_adopt_blurb_1:
"逐步将类型应用到您的 JavaScript 项目,, <strong>每一步都提高了编辑器的支持</strong> 并改进了您的代码库。",
index_2_adopt_blurb_2:
"让我们以这段不正确的JavaScript代码为例, 看看 <strong>TypeScript如何在您的编辑器中捕获错误。</strong>.",

index_2_adopt_info_1:
"JavaScript文件中没有编辑器警告。<br/><br/>在运行时就会崩溃。",
}
2 changes: 2 additions & 0 deletions docs/typescriptlang/zh/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { navCopy } from "./nav"
import { headCopy } from "./head-seo"
import { docCopy } from "./documentation"
import { indexCopy } from "./index"
import { indexCopy as index2Copy } from "./index2"
import { comCopy } from "./community"
import { handbookCopy } from "./handbook"

Expand All @@ -17,4 +18,5 @@ export const lang = defineMessages({
...playCopy,
...comCopy,
...handbookCopy,
...index2Copy
})