Skip to content

Commit c924b6d

Browse files
committed
chore(i18n): add zh-CN translations to entries that lack translations
1 parent 4db33e9 commit c924b6d

3 files changed

Lines changed: 233 additions & 84 deletions

File tree

CONTRIBUTING.md

Lines changed: 71 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,46 +26,75 @@ This focus helps guide our project decisions as a community and what we choose t
2626

2727
## Table of Contents
2828

29-
- [Getting started](#getting-started)
30-
- [Prerequisites](#prerequisites)
31-
- [Setup](#setup)
32-
- [Development workflow](#development-workflow)
33-
- [Available commands](#available-commands)
34-
- [Project structure](#project-structure)
35-
- [Local connector CLI](#local-connector-cli)
36-
- [Mock connector (for local development)](#mock-connector-for-local-development)
37-
- [Code style](#code-style)
38-
- [TypeScript](#typescript)
39-
- [Server API patterns](#server-api-patterns)
40-
- [Import order](#import-order)
41-
- [Naming conventions](#naming-conventions)
42-
- [Vue components](#vue-components)
43-
- [Internal linking](#internal-linking)
44-
- [RTL Support](#rtl-support)
45-
- [Localization (i18n)](#localization-i18n)
46-
- [Approach](#approach)
47-
- [i18n commands](#i18n-commands)
48-
- [Adding a new locale](#adding-a-new-locale)
49-
- [Update translation](#update-translation)
50-
- [Adding translations](#adding-translations)
51-
- [Translation key conventions](#translation-key-conventions)
52-
- [Using i18n-ally (recommended)](#using-i18n-ally-recommended)
53-
- [Formatting numbers and dates](#formatting-numbers-and-dates)
54-
- [Testing](#testing)
55-
- [Unit tests](#unit-tests)
56-
- [Component accessibility tests](#component-accessibility-tests)
57-
- [Lighthouse accessibility tests](#lighthouse-accessibility-tests)
58-
- [Lighthouse performance tests](#lighthouse-performance-tests)
59-
- [End to end tests](#end-to-end-tests)
60-
- [Test fixtures (mocking external APIs)](#test-fixtures-mocking-external-apis)
61-
- [Submitting changes](#submitting-changes)
62-
- [Before submitting](#before-submitting)
63-
- [Pull request process](#pull-request-process)
64-
- [Commit messages and PR titles](#commit-messages-and-pr-titles)
65-
- [Pre-commit hooks](#pre-commit-hooks)
66-
- [Using AI](#using-ai)
67-
- [Questions](#questions)
68-
- [License](#license)
29+
- [Contributing to npmx.dev](#contributing-to-npmxdev)
30+
- [Goals](#goals)
31+
- [Core values](#core-values)
32+
- [Target audience](#target-audience)
33+
- [Table of Contents](#table-of-contents)
34+
- [Getting started](#getting-started)
35+
- [Prerequisites](#prerequisites)
36+
- [Setup](#setup)
37+
- [Development workflow](#development-workflow)
38+
- [Available commands](#available-commands)
39+
- [Project structure](#project-structure)
40+
- [Local connector CLI](#local-connector-cli)
41+
- [Mock connector (for local development)](#mock-connector-for-local-development)
42+
- [Code style](#code-style)
43+
- [npmx name](#npmx-name)
44+
- [TypeScript](#typescript)
45+
- [Server API patterns](#server-api-patterns)
46+
- [Input validation with Valibot](#input-validation-with-valibot)
47+
- [Error handling with `handleApiError`](#error-handling-with-handleapierror)
48+
- [URL parameter parsing with `parsePackageParams`](#url-parameter-parsing-with-parsepackageparams)
49+
- [Constants](#constants)
50+
- [Import order](#import-order)
51+
- [Naming conventions](#naming-conventions)
52+
- [Vue components](#vue-components)
53+
- [Internal linking](#internal-linking)
54+
- [Package routes](#package-routes)
55+
- [Available route names](#available-route-names)
56+
- [RTL Support](#rtl-support)
57+
- [Localization (i18n)](#localization-i18n)
58+
- [Approach](#approach)
59+
- [i18n commands](#i18n-commands)
60+
- [Adding a new locale](#adding-a-new-locale)
61+
- [Update translation](#update-translation)
62+
- [Country variants (advanced)](#country-variants-advanced)
63+
- [Adding translations](#adding-translations)
64+
- [Translation key conventions](#translation-key-conventions)
65+
- [Using i18n-ally (recommended)](#using-i18n-ally-recommended)
66+
- [Formatting numbers and dates](#formatting-numbers-and-dates)
67+
- [Testing](#testing)
68+
- [Unit tests](#unit-tests)
69+
- [Component accessibility tests](#component-accessibility-tests)
70+
- [Lighthouse accessibility tests](#lighthouse-accessibility-tests)
71+
- [How it works](#how-it-works)
72+
- [Running locally](#running-locally)
73+
- [Configuration](#configuration)
74+
- [Lighthouse performance tests](#lighthouse-performance-tests)
75+
- [How it works](#how-it-works-1)
76+
- [Running locally](#running-locally-1)
77+
- [End to end tests](#end-to-end-tests)
78+
- [Test fixtures (mocking external APIs)](#test-fixtures-mocking-external-apis)
79+
- [Fixture files](#fixture-files)
80+
- [Adding new fixtures](#adding-new-fixtures)
81+
- [Environment variables](#environment-variables)
82+
- [When tests fail due to missing fixtures](#when-tests-fail-due-to-missing-fixtures)
83+
- [Testing connector features](#testing-connector-features)
84+
- [Architecture](#architecture)
85+
- [Vitest component tests (`test/nuxt/`)](#vitest-component-tests-testnuxt)
86+
- [Playwright E2E tests (`test/e2e/`)](#playwright-e2e-tests-teste2e)
87+
- [Submitting changes](#submitting-changes)
88+
- [Before submitting](#before-submitting)
89+
- [Pull request process](#pull-request-process)
90+
- [Commit messages and PR titles](#commit-messages-and-pr-titles)
91+
- [PR descriptions](#pr-descriptions)
92+
- [Pre-commit hooks](#pre-commit-hooks)
93+
- [Using AI](#using-ai)
94+
- [1. Never let an LLM speak for you](#1-never-let-an-llm-speak-for-you)
95+
- [2. Never let an LLM think for you](#2-never-let-an-llm-think-for-you)
96+
- [Questions?](#questions)
97+
- [License](#license)
6998

7099
## Getting started
71100

@@ -416,7 +445,7 @@ npmx.dev uses [@nuxtjs/i18n](https://i18n.nuxtjs.org/) for internationalization.
416445
- All user-facing strings should use translation keys via `$t()` in templates and script
417446
- Translation files live in [`i18n/locales/`](i18n/locales) (e.g., `en-US.json`)
418447
- We use the `no_prefix` strategy (no `/en-US/` or `/fr-FR/` in URLs)
419-
- Locale preference is stored in cookies and respected on subsequent visits
448+
- Locale preference is stored in `localStorage` and respected on subsequent visits
420449

421450
### i18n commands
422451

@@ -469,7 +498,7 @@ Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essential
469498

470499
### Update translation
471500

472-
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/
501+
We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: <https://i18n.npmx.dev/>
473502
If you see any outdated translations in your language, feel free to update the keys to match the English version.
474503

475504
Use `pnpm i18n:check` and `pnpm i18n:check:fix` to verify and fix your locale (see [i18n commands](#i18n-commands) above for details).

i18n/locales/zh-CN.json

Lines changed: 81 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
"end_of_results": "没有更多结果",
126126
"try_again": "再试一次",
127127
"close": "关闭",
128+
"or": "",
128129
"retry": "重试",
129130
"copy": "复制",
130131
"copied": "已复制!",
@@ -142,18 +143,18 @@
142143
"scroll_to_top": "回到顶部"
143144
},
144145
"package": {
145-
"not_found": "没有找到包",
146-
"not_found_message": "找不到这个包",
147-
"no_description": "没有提供描述",
148-
"not_latest": "不是最新",
149-
"verified_provenance": "已验证的来源",
150-
"view_permalink": "查看这个版本的链接",
146+
"not_found": "未找到包",
147+
"not_found_message": "找不到此包",
148+
"no_description": "未提供描述",
149+
"not_latest": "非最新",
150+
"verified_provenance": "已验证来源",
151+
"view_permalink": "查看此版本的链接",
151152
"navigation": "包导航",
152153
"copy_name": "复制包名",
153154
"deprecation": {
154-
"package": "这个包已经被弃用",
155-
"version": "这个版本已经被弃用",
156-
"no_reason": "没有提供原因"
155+
"package": "此包已废弃",
156+
"version": "此版本已废弃",
157+
"no_reason": "未提供原因"
157158
},
158159
"replacement": {
159160
"title": "你可能不需要这个依赖。",
@@ -209,8 +210,8 @@
209210
"compare": "比较"
210211
},
211212
"likes": {
212-
"like": "喜欢这个包",
213-
"unlike": "取消喜欢这个包"
213+
"like": "点赞此包",
214+
"unlike": "取消点赞"
214215
},
215216
"docs": {
216217
"not_available": "文档不可用",
@@ -232,18 +233,18 @@
232233
"locally": "本地运行"
233234
},
234235
"readme": {
235-
"title": "Readme",
236-
"no_readme": "没有可用的 README",
236+
"title": "自述文件",
237+
"no_readme": "无可用自述文件",
237238
"view_on_github": "在 GitHub 上查看",
238-
"toc_title": "大纲",
239+
"toc_title": "目录",
239240
"callout": {
240241
"note": "注意",
241242
"tip": "提示",
242243
"important": "重要",
243244
"warning": "警告",
244245
"caution": "当心"
245246
},
246-
"copy_as_markdown": " Markdown 格式复制 README"
247+
"copy_as_markdown": "复制为 Markdown"
247248
},
248249
"provenance_section": {
249250
"title": "来源",
@@ -256,7 +257,16 @@
256257
"view_more_details": "查看更多详情",
257258
"error_loading": "加载来源详情失败"
258259
},
259-
"security_downgrade": {},
260+
"security_downgrade": {
261+
"title": "信任度降低",
262+
"description_to_none_provenance": "此版本发布时未包含 {provenance}。",
263+
"description_to_none_trustedPublisher": "此版本发布时未包含 {trustedPublishing}。",
264+
"description_to_provenance_trustedPublisher": "此版本使用了 {provenance} 但未包含 {trustedPublishing}。",
265+
"fallback_install_provenance": "安装命令已锁定为 {version},这是最后一个具有来源的版本。",
266+
"fallback_install_trustedPublisher": "安装命令已锁定为 {version},这是最后一个具有可信发布的版本。",
267+
"provenance_link_text": "来源",
268+
"trusted_publishing_link_text": "可信发布"
269+
},
260270
"keywords_title": "关键词",
261271
"compatibility": "兼容性",
262272
"card": {
@@ -278,7 +288,16 @@
278288
"more_tagged": "还有 {count} 个标签",
279289
"all_covered": "所有版本均已包含于上方标签中。",
280290
"deprecated_title": "{version}(已弃用)",
281-
"view_all": "查看全部 {count} 个版本"
291+
"view_all": "查看全部 {count} 个版本",
292+
"distribution_title": "语义化版本分组",
293+
"distribution_modal_title": "版本",
294+
"grouping_major": "主版本",
295+
"grouping_minor": "次版本",
296+
"recent_versions_only": "仅显示最近版本",
297+
"recent_versions_only_tooltip": "仅显示在过去一年内发布的版本。",
298+
"show_low_usage": "显示低使用率版本",
299+
"show_low_usage_tooltip": "包括下载量低于 1% 的版本组。",
300+
"date_range_tooltip": "仅显示最近一周的版本分布情况"
282301
},
283302
"dependencies": {
284303
"title": "依赖({count} 个)",
@@ -330,12 +349,16 @@
330349
"legend_estimation": "估算值",
331350
"no_data": "无可用数据",
332351
"y_axis_label": "{granularity} {facet}",
352+
"facet": "维度",
353+
"title": "趋势",
333354
"items": {
334-
"downloads": "下载量"
355+
"downloads": "下载量",
356+
"likes": "喜欢"
335357
}
336358
},
337359
"downloads": {
338360
"title": "每周下载量",
361+
"modal_title": "每周下载量",
339362
"analyze": "分析下载量",
340363
"community_distribution": "查看社区采用分布"
341364
},
@@ -374,7 +397,8 @@
374397
"high": "",
375398
"moderate": "中等",
376399
"low": ""
377-
}
400+
},
401+
"fixed_in_title": "修复于版本 {version}"
378402
},
379403
"deprecated": {
380404
"label": "已弃用",
@@ -448,7 +472,8 @@
448472
"warning": "警告",
449473
"warning_text": "这将允许 npmx 访问你的 npm CLI。请仅连接你信任的站点。",
450474
"connect": "连接",
451-
"connecting": "连接中…"
475+
"connecting": "连接中…",
476+
"auto_open_url": "自动打开认证页面"
452477
}
453478
},
454479
"operations": {
@@ -464,7 +489,9 @@
464489
"otp_placeholder": "输入 OTP 代码…",
465490
"otp_label": "一次性代码",
466491
"retry_otp": "使用 OTP 重试",
492+
"retry_web_auth": "使用网页认证重试",
467493
"retrying": "重试中…",
494+
"open_web_auth": "打开网页认证链接",
468495
"approve_operation": "批准操作",
469496
"remove_operation": "移除操作",
470497
"approve_all": "批准所有",
@@ -816,7 +843,7 @@
816843
"connect_npm_cli": "连接到 npm CLI",
817844
"connect_atmosphere": "连接到 Atmosphere",
818845
"connecting": "连接中…",
819-
"ops": "ops"
846+
"ops": "{count} 个操作"
820847
},
821848
"auth": {
822849
"modal": {
@@ -967,6 +994,9 @@
967994
"types_none": "",
968995
"vulnerabilities_summary": "{count}({critical} 严重/{high} 高)",
969996
"up_to_you": "由你决定!"
997+
},
998+
"trends": {
999+
"title": "比较趋势"
9701000
}
9711001
}
9721002
},
@@ -1049,5 +1079,35 @@
10491079
"title": "本政策的变更",
10501080
"p1": "我们可能会不时更新本隐私政策。任何更改都将发布在此页面上,并附有更新的修订日期。"
10511081
}
1082+
},
1083+
"a11y": {
1084+
"title": "无障碍",
1085+
"footer_title": "无障碍",
1086+
"welcome": "我们希望 {app} 能够被尽可能多的人使用。",
1087+
"approach": {
1088+
"title": "我们的做法",
1089+
"p1": "我们尝试遵循 Web 内容无障碍指南(WCAG)2.2,并在构建功能时将其作为参考。我们不声称完全符合任何级别的 WCAG——无障碍是一个持续的过程,总是有更多的工作要做。",
1090+
"p2": "此站点是一个 {about}。无障碍改进是我们常规开发的一部分,逐步进行。",
1091+
"about_link": "开源、社区驱动的项目"
1092+
},
1093+
"measures": {
1094+
"title": "具体措施",
1095+
"p1": "我们在全站致力于落实以下措施:",
1096+
"li1": "在适当时使用语义化 HTML 和 ARIA 属性。",
1097+
"li2": "使用相对字号,以便用户在浏览器中调整。",
1098+
"li3": "支持全站键盘导航。",
1099+
"li4": "遵循 prefers-reduced-motion 和 prefers-color-scheme 媒体查询。",
1100+
"li5": "设计时确保足够的颜色对比度。",
1101+
"li6": "确保在禁用 JavaScript 时仍可访问基本内容(部分交互功能除外)。"
1102+
},
1103+
"limitations": {
1104+
"title": "已知限制",
1105+
"p1": "网站的某些部分,特别是第三方内容(如包的自述文件),可能不符合无障碍标准。我们正在努力改善这些问题。"
1106+
},
1107+
"contact": {
1108+
"title": "反馈",
1109+
"p1": "如果你在 {app} 上遇到无障碍问题,请通过在我们的 {link} 上提交问题来告诉我们。我们会认真对待这些报告,并尽力解决它们。",
1110+
"link": "GitHub 仓库"
1111+
}
10521112
}
10531113
}

0 commit comments

Comments
 (0)