Repository: nodejs/nodejs.dev
Pull request #3025 (2022-11-17 05:20:44)

zh-CN: Translation for site.json
1. A translation for the Chinese site page, with some modifications to make the local Chinese easy to understand.

2. Enable zh-CN for review.

Refs: https://github.com/nodejs/nodejs.dev/pull/2795.

<!--
Please read the [Code of Conduct](https://github.com/nodejs/nodejs.dev/blob/main/CODE_OF_CONDUCT.md) and the [Contributing Guidelines](https://github.com/nodejs/nodejs.dev/blob/main/CONTRIBUTING.md) before opening a pull request.
-->

## Description

<!-- Write a brief description of the changes introduced by this PR -->

## Related Issues

<!--
  Link to the issue that is fixed by this PR (if there is one)
  e.g. Fixes #1234, Addresses #1234, Related to #1234, etc.
-->

### Check List

<!--
ATTENTION
Please follow this check list to ensure that you've followed all items before opening this PR
-->

- [x] I have read the [Contributing Guidelines](https://github.com/nodejs/nodejs.dev/blob/main/CONTRIBUTING.md) and made commit messages that follow the guideline.
- [x] I have run `npm run lint:js -- --fix` and/or `npm run lint:md -- --fix` for my JavaScript and/or Markdown changes.
  - This is important as most of the cases your code changes might not be correctly linted
- [x] I have run `npm run test` to check if all tests are passing, and/or `npm run test -- -u` to update snapshots if I created and/or updated React Components.
- [x] I have checked that the build works locally and that `npm run build` work fine.
- [x] I've covered new added functionality with unit tests if necessary.


MaledongGit: Ping @nodejs/nodejs-cn ,please have a review, thanks!
codecov-commenter: # [Codecov](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
Base: **66.02**% // Head: **66.95**% // Increases project coverage by **`+0.92%`** :tada:
> Coverage data is based on head [(`7f0e58a`)](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) compared to base [(`fd57b87`)](https://codecov.io/gh/nodejs/nodejs.dev/commit/fd57b871c2b1ad2f6fb812ed066dec074d76db22?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).
> Patch has no changes to coverable lines.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #3025      +/-   ##
==========================================
+ Coverage   66.02%   66.95%   +0.92%     
==========================================
  Files         118      143      +25     
  Lines        1351     1622     +271     
  Branches      342      384      +42     
==========================================
+ Hits          892     1086     +194     
- Misses        422      493      +71     
- Partials       37       43       +6     
```


| [Impacted Files](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | |
|---|---|---|
| [src/templates/blog.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RlbXBsYXRlcy9ibG9nLnRzeA==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [util-node/getNodeReleasesData.js](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-dXRpbC1ub2RlL2dldE5vZGVSZWxlYXNlc0RhdGEuanM=) | `91.30% <0.00%> (-6.32%)` | :arrow_down: |
| [src/\_\_fixtures\_\_/page.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL19fZml4dHVyZXNfXy9wYWdlLnRzeA==) | `94.11% <0.00%> (-5.89%)` | :arrow_down: |
| [src/pages/index.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3BhZ2VzL2luZGV4LnRzeA==) | `100.00% <0.00%> (ø)` | |
| [src/templates/api.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RlbXBsYXRlcy9hcGkudHN4) | `0.00% <0.00%> (ø)` | |
| [src/templates/learn.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3RlbXBsYXRlcy9sZWFybi50c3g=) | `100.00% <0.00%> (ø)` | |
| [util-node/createSlug.js](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-dXRpbC1ub2RlL2NyZWF0ZVNsdWcuanM=) | `100.00% <0.00%> (ø)` | |
| [util-node/getNvmData.js](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-dXRpbC1ub2RlL2dldE52bURhdGEuanM=) | `100.00% <0.00%> (ø)` | |
| [src/hooks/useOnScreen.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2hvb2tzL3VzZU9uU2NyZWVuLnRzeA==) | `100.00% <0.00%> (ø)` | |
| [src/pages/about/index.tsx](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3BhZ2VzL2Fib3V0L2luZGV4LnRzeA==) | `100.00% <0.00%> (ø)` | |
| ... and [180 more](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | |

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

</details>

[:umbrella: View full report at Codecov](https://codecov.io/gh/nodejs/nodejs.dev/pull/3025?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None).


Patch:
diff --git a/src/i18n/config.json b/src/i18n/config.json
index 4d29d6e8..d0964ad4 100644
--- a/src/i18n/config.json
+++ b/src/i18n/config.json
@@ -150,7 +150,7 @@
     "langDir": "ltr",
     "dateFormat": "YYYY/MM/DD",
     "hrefLang": "zh-Hans",
-    "enabled": false
+    "enabled": true
   },
   {
     "code": "zh-tw",
diff --git a/src/i18n/locales/zh-cn.json b/src/i18n/locales/zh-cn.json
index 08964556..605addbf 100644
--- a/src/i18n/locales/zh-cn.json
+++ b/src/i18n/locales/zh-cn.json
@@ -2,26 +2,26 @@
   "blog.title": "Node.js 博客",
   "blog.description": "最近的 Node.js 新闻、案例研究、教程及资源。",
   "blog.authors.list.title.by": "作者",
-  "blog.authors.list.title.and": "and",
+  "blog.authors.list.title.and": "和",
   "components.downloadAdditional.title": "额外下载",
   "components.downloadHeader.navigation.activeSection": "下载",
   "components.downloadHeader.navigation.title": "下载",
-  "components.downloadHeader.navigation.nodeVersion": "{lts, select, true {LATEST LTS}other {CURRENT}} VERSION {nodeVersion}",
-  "components.downloadHeader.navigation.npmVersion": "(包含 npm)",
+  "components.downloadHeader.navigation.nodeVersion": "{lts, select, true {最新 LTS 版}other {尝鲜版}} 版本号： {nodeVersion}",
+  "components.downloadHeader.navigation.npmVersion": "（自带 npm）",
   "components.downloadTable.header.release": "发行",
   "components.downloadTable.header.status": "状态",
   "components.downloadTable.header.codename": "代号",
   "components.downloadTable.header.initialRelease": "首次发行",
-  "components.downloadTable.header.ltsStarts": "激活 LTS 开始",
-  "components.downloadTable.header.maintenanceStart": "维护 LTS 开始",
-  "components.downloadTable.header.endOfLife": "支持结束",
+  "components.downloadTable.header.ltsStarts": "长期维护版（LTS）正式启用时间",
+  "components.downloadTable.header.maintenanceStart": "长期维护版（LTS）正式维护时间",
+  "components.downloadTable.header.endOfLife": "支持结束时间",
   "components.downloadReleases.upcomingReleases.title": "即将到来的版本",
-  "components.downloadReleases.upcomingReleases.content": "Node.js 的主要版本会进入当前发行状态六个月，这给了库的作者时间来添加支持。六个月后，奇数发行版 (9, 11, 等等) 将不再被支持，并且偶数发行版 (10, 12, 等等) 进入活跃 LTS 状态，可供广泛使用。LTS 版本状态是\"长期支持\"，通常可以保证在30个月的时间里修复重要的漏洞。在生产应用中只能使用活跃 LTS 或者维护 LTS 版本。",
-  "components.downloadToggle.current": "最新",
-  "components.downloadToggle.lts": "LTS",
-  "components.downloadToggle.recommendation": "{selected, select, LTS {Recommended for most users}other {With the latest features}}",
-  "components.editLink.title": "在 GitHub 上编辑此页面",
-  "components.jsonLink.title": "View as JSON",
+  "components.downloadReleases.upcomingReleases.content": "Node.js 的主要版本会进入当前发行状态六个月，这给了库的作者时间来添加支持。六个月后，奇数发行版（9、11 等）将不再被支持；偶数发行版（10、12 等）转为“长期维护版（LTS）”并正式开启，可供广泛使用。LTS 版本状态是\"长期支持\"，通常可以保证在 30 个月的时间里修复重要的漏洞。在生产应用中只能使用“当前 LTS”或“维护 LTS”版本。",
+  "components.downloadToggle.current": "尝鲜版",
+  "components.downloadToggle.lts": "长期维护版（LTS）",
+  "components.downloadToggle.recommendation": "{selected, select, LTS {推荐绝大部分用户使用}other {具备最新尝鲜功能}}",
+  "components.editLink.title": "在 GitHub 上编辑当前页面",
+  "components.jsonLink.title": "以 JSON 格式预览",
   "components.footer.links.trademark": "商标政策",
   "components.footer.links.privacy": "隐私政策",
   "components.footer.links.codeOfConduct": "行为准则",
@@ -61,39 +61,39 @@
   "pages.index.features.everywhere.title": "任何地方",
   "pages.index.features.everywhere.description": "Node.js 已经被适配成可以在各种各样的地方工作",
   "components.tableOfContents.heading": "目录",
-  "docs.api.addedIn": "添加: {version}",
-  "docs.api.removedIn": "移除: {version}",
-  "docs.api.deprecatedIn": "弃用: {version}",
-  "docs.api.nApiVersion": "N-API 版本: {version}",
+  "docs.api.addedIn": "自 {version} 版本开始新增",
+  "docs.api.removedIn": "自 {version} 版本开始移除",
+  "docs.api.deprecatedIn": "自 {version} 版本开始弃用",
+  "docs.api.nApiVersion": "N-API 版本：{version}",
   "docs.api.history": "历史",
-  "docs.api.sourceLink": "源代码:",
+  "docs.api.sourceLink": "源代码：",
   "docs.api.history.version": "版本",
-  "docs.api.history.changes": "变更",
-  "docs.api.stability": "稳定: {level}{text}",
+  "docs.api.history.changes": "历史变更",
+  "docs.api.stability": "稳定级别：{level}{text}",
   "components.header.links.about": "关于",
   "components.header.links.certification": "认证",
-  "components.author.githubLinkLabel": "{username} Github - opens in new tab",
-  "navigation.about.section.about": "About Node.js",
-  "navigation.about.section.getInvolved": "Get Involved",
-  "navigation.about.section.download": "Download",
-  "navigation.about.items.collabSummit": "Collab Summit",
-  "navigation.about.items.contribute": "Contribute",
-  "navigation.about.items.previousReleases": "Previous Releases",
-  "navigation.about.items.codeOfConduct": "Code of Conduct",
-  "navigation.about.items.governance": "Project Governance",
-  "navigation.about.items.releases": "Releases",
-  "navigation.about.items.resources": "Resources",
-  "navigation.about.items.privacy": "Privacy Policy",
-  "navigation.about.items.security": "Security Reporting",
-  "navigation.about.items.packageManager": "Package Manager",
-  "navigation.blog.categories": "Categories",
-  "blog.categories.all": "Everything",
-  "blog.categories.announcements": "Announcements",
-  "blog.categories.release": "Releases",
-  "blog.categories.vulnerability": "Vulnerabilities",
-  "blog.categories.announcements.description": "Blog category for Node.js announcements",
-  "blog.categories.release.description": "Blog category for Node.js Release announcements",
-  "blog.categories.vulnerability.description": "Blog category regarding Security Vulnerabilities",
-  "components.downloadToggle.ltsVersions": "LTS Versions",
-  "components.downloadToggle.currentVersions": "Current Versions"
+  "components.author.githubLinkLabel": "Github 的用户“{username}”以新窗口方式打开",
+  "navigation.about.section.about": "关于 Node.js",
+  "navigation.about.section.getInvolved": "加入我们",
+  "navigation.about.section.download": "下载",
+  "navigation.about.items.collabSummit": "协作者峰会",
+  "navigation.about.items.contribute": "贡献",
+  "navigation.about.items.previousReleases": "以往的发布版本",
+  "navigation.about.items.codeOfConduct": "行为准则",
+  "navigation.about.items.governance": "项目管理方式",
+  "navigation.about.items.releases": "发布",
+  "navigation.about.items.resources": "资源",
+  "navigation.about.items.privacy": "隐私政策",
+  "navigation.about.items.security": "安全隐患报告",
+  "navigation.about.items.packageManager": "包管理",
+  "navigation.blog.categories": "所有分类",
+  "blog.categories.all": "全部",
+  "blog.categories.announcements": "通告",
+  "blog.categories.release": "发布信息",
+  "blog.categories.vulnerability": "缺陷与隐患",
+  "blog.categories.announcements.description": "关于 Node.js 所有的公告信息",
+  "blog.categories.release.description": "关于 Node.js 所有的发布信息",
+  "blog.categories.vulnerability.description": "涉及到安全隐患方面的所有信息",
+  "components.downloadToggle.ltsVersions": "长期维护版（LTS）",
+  "components.downloadToggle.currentVersions": "尝鲜版"
 }


Test patch:
diff --git a/src/components/CommonComponents/LanguageSelector/__tests__/__snapshots__/LanguageSelector.test.tsx.snap b/src/components/CommonComponents/LanguageSelector/__tests__/__snapshots__/LanguageSelector.test.tsx.snap
index 6f5c4615..d72194e4 100644
--- a/src/components/CommonComponents/LanguageSelector/__tests__/__snapshots__/LanguageSelector.test.tsx.snap
+++ b/src/components/CommonComponents/LanguageSelector/__tests__/__snapshots__/LanguageSelector.test.tsx.snap
@@ -44,6 +44,14 @@ exports[`LanguageSelector component renders correctly 1`] = `
         Français
       </button>
     </li>
+    <li>
+      <button
+        style="font-weight: normal;"
+        type="button"
+      >
+        简体中文
+      </button>
+    </li>
   </ul>
 </div>
 `;
diff --git a/src/layouts/__tests__/__snapshots__/index.test.tsx.snap b/src/layouts/__tests__/__snapshots__/index.test.tsx.snap
index ee673c9b..e6e203cc 100644
--- a/src/layouts/__tests__/__snapshots__/index.test.tsx.snap
+++ b/src/layouts/__tests__/__snapshots__/index.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`Layout component renders correctly with data 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
diff --git a/src/layouts/__tests__/__snapshots__/page.test.tsx.snap b/src/layouts/__tests__/__snapshots__/page.test.tsx.snap
index 333af6b1..6b8190de 100644
--- a/src/layouts/__tests__/__snapshots__/page.test.tsx.snap
+++ b/src/layouts/__tests__/__snapshots__/page.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`PageLayout component renders correctly with data 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
diff --git a/src/pages/about/__tests__/__snapshots__/resources.test.tsx.snap b/src/pages/about/__tests__/__snapshots__/resources.test.tsx.snap
index ac3fbd08..78543763 100644
--- a/src/pages/about/__tests__/__snapshots__/resources.test.tsx.snap
+++ b/src/pages/about/__tests__/__snapshots__/resources.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`Resources page renders correctly 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
diff --git a/src/pages/download/__tests__/__snapshots__/index.test.tsx.snap b/src/pages/download/__tests__/__snapshots__/index.test.tsx.snap
index 2dec854a..c40c597e 100644
--- a/src/pages/download/__tests__/__snapshots__/index.test.tsx.snap
+++ b/src/pages/download/__tests__/__snapshots__/index.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`Download page renders correctly 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
@@ -1236,6 +1244,14 @@ exports[`Download page should handle LTS to Current switch 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
diff --git a/src/pages/download/__tests__/__snapshots__/package-manager.test.tsx.snap b/src/pages/download/__tests__/__snapshots__/package-manager.test.tsx.snap
index d1cab208..2f3aad76 100644
--- a/src/pages/download/__tests__/__snapshots__/package-manager.test.tsx.snap
+++ b/src/pages/download/__tests__/__snapshots__/package-manager.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`Package Manager Page renders correctly 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
diff --git a/src/sections/Header/__tests__/__snapshots__/index.test.tsx.snap b/src/sections/Header/__tests__/__snapshots__/index.test.tsx.snap
index c96e3f32..1a875775 100644
--- a/src/sections/Header/__tests__/__snapshots__/index.test.tsx.snap
+++ b/src/sections/Header/__tests__/__snapshots__/index.test.tsx.snap
@@ -196,6 +196,14 @@ exports[`Tests for Header component Theme color switcher skips rendering in case
                   Français
                 </button>
               </li>
+              <li>
+                <button
+                  style="font-weight: normal;"
+                  type="button"
+                >
+                  简体中文
+                </button>
+              </li>
             </ul>
           </li>
           <li>
@@ -431,6 +439,14 @@ exports[`Tests for Header component renders correctly 1`] = `
                   Français
                 </button>
               </li>
+              <li>
+                <button
+                  style="font-weight: normal;"
+                  type="button"
+                >
+                  简体中文
+                </button>
+              </li>
             </ul>
           </li>
           <li>
@@ -666,6 +682,14 @@ exports[`Tests for Header component renders shorter menu items for mobile 1`] =
                   Français
                 </button>
               </li>
+              <li>
+                <button
+                  style="font-weight: normal;"
+                  type="button"
+                >
+                  简体中文
+                </button>
+              </li>
             </ul>
           </li>
           <li>
diff --git a/src/templates/__tests__/__snapshots__/learn.test.tsx.snap b/src/templates/__tests__/__snapshots__/learn.test.tsx.snap
index 1b8b963a..899c909b 100644
--- a/src/templates/__tests__/__snapshots__/learn.test.tsx.snap
+++ b/src/templates/__tests__/__snapshots__/learn.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`Learn Template renders correctly 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>
diff --git a/src/templates/__tests__/__snapshots__/post.test.tsx.snap b/src/templates/__tests__/__snapshots__/post.test.tsx.snap
index c8eeac56..28bcae33 100644
--- a/src/templates/__tests__/__snapshots__/post.test.tsx.snap
+++ b/src/templates/__tests__/__snapshots__/post.test.tsx.snap
@@ -199,6 +199,14 @@ exports[`LearnLayout Template renders correctly 1`] = `
                     Français
                   </button>
                 </li>
+                <li>
+                  <button
+                    style="font-weight: normal;"
+                    type="button"
+                  >
+                    简体中文
+                  </button>
+                </li>
               </ul>
             </li>
             <li>