@polang233/kiro-language-pack 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kiro-language-pack contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,57 @@
1
+ kiro-language-pack
2
+ Copyright (c) 2026 kiro-language-pack contributors
3
+
4
+ This product includes software and localized string resources developed by
5
+ third parties. Their license terms are reproduced below.
6
+
7
+ ================================================================================
8
+ 1. Visual Studio Code Localization Extension (vscode-loc)
9
+ ================================================================================
10
+
11
+ When this project is built in "full" mode, the localized string resources for
12
+ the Visual Studio Code / Code OSS core workbench and for the built-in
13
+ extensions are derived from the microsoft/vscode-loc repository:
14
+
15
+ https://github.com/microsoft/vscode-loc
16
+
17
+ Those strings are used, modified and redistributed under the MIT License:
18
+
19
+ MIT License
20
+
21
+ Copyright (c) Microsoft Corporation. All rights reserved.
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in
31
+ all copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
38
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
39
+ DEALINGS IN THE SOFTWARE.
40
+
41
+ The upstream commit or tag used for a given release is recorded in
42
+ `config.json` (`upstream.ref`) and in the generated extension manifest.
43
+
44
+ ================================================================================
45
+ 2. Trademarks
46
+ ================================================================================
47
+
48
+ "Kiro" is a product of Amazon Web Services, Inc. "Visual Studio Code" is a
49
+ product of Microsoft Corporation. This project is an independent, community
50
+ maintained language pack. It is not affiliated with, endorsed by, or sponsored
51
+ by Amazon Web Services, Inc. or Microsoft Corporation. Product names are used
52
+ only to describe compatibility.
53
+
54
+ Source string identifiers of the Kiro built-in extension (`kiro.kiroAgent`) are
55
+ referenced for the sole purpose of interoperability, as required by the
56
+ Visual Studio Code language pack contribution format. No Kiro source code is
57
+ copied or redistributed by this project.
package/README.en.md ADDED
@@ -0,0 +1,61 @@
1
+ # Kiro Language Pack
2
+
3
+ Chinese translations for Kiro, including the editor, sessions, Settings, specs and steering. Supports Simplified Chinese and Traditional Chinese with Taiwan terminology.
4
+
5
+ [简体中文](README.md)
6
+
7
+ <img src="media/icon.png" width="96" height="96" alt="Kiro Language Pack icon" />
8
+
9
+ [![Open VSX](https://img.shields.io/open-vsx/v/polang233/kiro-language-pack?label=Open%20VSX)](https://open-vsx.org/extension/polang233/kiro-language-pack)
10
+
11
+ | Before · English | After · 简体中文 |
12
+ | --- | --- |
13
+ | ![English](docs/images/before-en.png) | ![Simplified Chinese](docs/images/after-zh-cn.png) |
14
+
15
+ ## Command-line installation
16
+
17
+ Node.js 22+ is recommended; the minimum is 18.17. Quit Kiro completely first.
18
+
19
+ The npm package is awaiting its first publication; these npx commands become available then.
20
+
21
+ ```bash
22
+ npx @polang233/kiro-language-pack@latest
23
+ ```
24
+
25
+ The default command is `install`. It installs the language pack and translates text in the app files. Each npm version includes its matching VSIX, so users do not need to download or build the source. To specify the language and install directory:
26
+
27
+ ```bash
28
+ npx @polang233/kiro-language-pack@latest --locale=zh-tw --dir="path/to/install"
29
+ ```
30
+
31
+ | Subcommand | Purpose |
32
+ | --- | --- |
33
+ | `preview` | Preview changes |
34
+ | `status` | Report the current state |
35
+ | `restore` | Restore only the app files |
36
+
37
+ System locales with TW/HK/MO or zh-Hant select `zh-tw` with Taiwan terminology; all others select `zh-cn`. Override this with `--locale`. `--dir` selects the install directory containing `resources/app`, or `Kiro.app/Contents` on macOS.
38
+
39
+ Reopen Kiro after installation. Rerun the install command after an app update. Switch extensions and display language inside the app; `restore` does not uninstall the extension or reset the display language.
40
+
41
+ Test the source entry point from the repository. See [npm maintenance](docs/npm.md) for preparation:
42
+
43
+ ```bash
44
+ node bin/cli.mjs preview --locale=zh-tw
45
+ ```
46
+
47
+ ## Extension installation
48
+
49
+ 1. Uninstall other language packs to avoid conflicts with the official VS Code Chinese packs.
50
+ 2. Search Extensions for **Kiro Language Pack** or **汉化**, or download a VSIX from [GitHub Releases](https://github.com/polang233/kiro-language-pack/releases) and use **Extensions: Install from VSIX…**.
51
+ 3. Run **Language Pack: Select Display Language**, choose Simplified or Traditional Chinese, then quit Kiro completely and reopen it.
52
+
53
+ The extension id remains `polang233.kiro-language-pack`. The setting `kiroLanguagePack.language` also accepts `auto`, `zh-cn`, `zh-tw` and `en`; restart after changing it. Translating some text compiled into the app requires the command-line installation above.
54
+
55
+ The translations target Kiro **1.4.26** (Code OSS 1.131.0). New or untranslated text stays in English. UI language does not change AI reply language; use a steering file such as `.kiro/steering/language.md` for that.
56
+
57
+ ## Development and license
58
+
59
+ [Maintenance and source tests](docs/npm.md) · [Publishing](docs/publishing.md) · [Architecture](docs/architecture.md) · [Contributing](CONTRIBUTING.md)
60
+
61
+ MIT. Workbench translations come from [microsoft/vscode-loc](https://github.com/microsoft/vscode-loc); see [NOTICE](NOTICE). A community project, unaffiliated with AWS or Microsoft.
package/README.md CHANGED
@@ -1,3 +1,61 @@
1
- # Temporary Holding Version
1
+ # Kiro Language Pack
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Kiro 中文语言包,支持简体中文和使用台湾用词的繁体中文,覆盖编辑器、会话、设置、规格与指引界面。
4
+
5
+ [English](README.en.md)
6
+
7
+ <img src="media/icon.png" width="96" height="96" alt="Kiro Language Pack 图标" />
8
+
9
+ [![Open VSX](https://img.shields.io/open-vsx/v/polang233/kiro-language-pack?label=Open%20VSX)](https://open-vsx.org/extension/polang233/kiro-language-pack)
10
+
11
+ | 安装前 · English | 安装后 · 简体中文 |
12
+ | --- | --- |
13
+ | ![英文](docs/images/before-en.png) | ![简体中文](docs/images/after-zh-cn.png) |
14
+
15
+ ## 命令行安装
16
+
17
+ 推荐 Node.js 22+,最低 18.17。先完全退出 Kiro。
18
+
19
+ npm 包尚未首次发布,以下 npx 入口在首发后可用。
20
+
21
+ ```bash
22
+ npx @polang233/kiro-language-pack@latest
23
+ ```
24
+
25
+ 默认执行 `install`,安装语言包并翻译程序内的文案。包内自带本版本 VSIX,无需下载源码或构建。指定语言和安装目录:
26
+
27
+ ```bash
28
+ npx @polang233/kiro-language-pack@latest --locale=zh-tw --dir="安装目录"
29
+ ```
30
+
31
+ | 子命令 | 用途 |
32
+ | --- | --- |
33
+ | `preview` | 预览改动 |
34
+ | `status` | 查看状态 |
35
+ | `restore` | 只恢复程序文件 |
36
+
37
+ 系统语言为 TW/HK/MO 或 zh-Hant 时自动选 `zh-tw`,沿用台湾用词;其他选 `zh-cn`。可用 `--locale` 指定。`--dir` 指向含 `resources/app` 的安装目录,macOS 为 `Kiro.app/Contents`。
38
+
39
+ 安装后重新打开 Kiro;应用更新后重跑安装命令。扩展和显示语言可在应用内切换,`restore` 不会卸载扩展或重置显示语言。
40
+
41
+ 可在仓库内联调源码入口,准备步骤见 [npm 维护说明](docs/npm.md):
42
+
43
+ ```bash
44
+ node bin/cli.mjs preview --locale=zh-tw
45
+ ```
46
+
47
+ ## 扩展安装
48
+
49
+ 1. 卸载其他语言包,避免与官方 VS Code 中文包冲突。
50
+ 2. 在扩展中搜索 **Kiro Language Pack** 或 **汉化**,也可从 [GitHub Releases](https://github.com/polang233/kiro-language-pack/releases) 下载 VSIX,通过 **Extensions: Install from VSIX…** 安装。
51
+ 3. 命令面板运行 **Language Pack: Select Display Language**,选简体或繁体,完全退出 Kiro 后重新打开。
52
+
53
+ 扩展 id 保持 `polang233.kiro-language-pack`。也可用设置 `kiroLanguagePack.language` 选择 `auto`、`zh-cn`、`zh-tw` 或 `en`,切换后重启。仅安装扩展时,部分写死在程序里的英文需要命令行安装才能翻译。
54
+
55
+ 当前译文对应 Kiro **1.4.26**(Code OSS 1.131.0)。新增或未覆盖的文案会显示英文。界面语言不影响 AI 回复语言,可通过 `.kiro/steering/language.md` 指定回复语言。
56
+
57
+ ## 开发与许可
58
+
59
+ [维护与源码测试](docs/npm.md) · [发布](docs/publishing.zh-CN.md) · [架构](docs/architecture.zh-CN.md) · [贡献](CONTRIBUTING.md)
60
+
61
+ MIT。工作台译文来自 [microsoft/vscode-loc](https://github.com/microsoft/vscode-loc),见 [NOTICE](NOTICE)。社区项目,与 AWS、Microsoft 无隶属关系。
@@ -0,0 +1,61 @@
1
+ # Kiro Language Pack
2
+
3
+ Kiro 中文语言包,支持简体中文和使用台湾用词的繁体中文,覆盖编辑器、会话、设置、规格与指引界面。
4
+
5
+ [English](README.en.md)
6
+
7
+ <img src="media/icon.png" width="96" height="96" alt="Kiro Language Pack 图标" />
8
+
9
+ [![Open VSX](https://img.shields.io/open-vsx/v/polang233/kiro-language-pack?label=Open%20VSX)](https://open-vsx.org/extension/polang233/kiro-language-pack)
10
+
11
+ | 安装前 · English | 安装后 · 简体中文 |
12
+ | --- | --- |
13
+ | ![英文](docs/images/before-en.png) | ![简体中文](docs/images/after-zh-cn.png) |
14
+
15
+ ## 命令行安装
16
+
17
+ 推荐 Node.js 22+,最低 18.17。先完全退出 Kiro。
18
+
19
+ npm 包尚未首次发布,以下 npx 入口在首发后可用。
20
+
21
+ ```bash
22
+ npx @polang233/kiro-language-pack@latest
23
+ ```
24
+
25
+ 默认执行 `install`,安装语言包并翻译程序内的文案。包内自带本版本 VSIX,无需下载源码或构建。指定语言和安装目录:
26
+
27
+ ```bash
28
+ npx @polang233/kiro-language-pack@latest --locale=zh-tw --dir="安装目录"
29
+ ```
30
+
31
+ | 子命令 | 用途 |
32
+ | --- | --- |
33
+ | `preview` | 预览改动 |
34
+ | `status` | 查看状态 |
35
+ | `restore` | 只恢复程序文件 |
36
+
37
+ 系统语言为 TW/HK/MO 或 zh-Hant 时自动选 `zh-tw`,沿用台湾用词;其他选 `zh-cn`。可用 `--locale` 指定。`--dir` 指向含 `resources/app` 的安装目录,macOS 为 `Kiro.app/Contents`。
38
+
39
+ 安装后重新打开 Kiro;应用更新后重跑安装命令。扩展和显示语言可在应用内切换,`restore` 不会卸载扩展或重置显示语言。
40
+
41
+ 可在仓库内联调源码入口,准备步骤见 [npm 维护说明](docs/npm.md):
42
+
43
+ ```bash
44
+ node bin/cli.mjs preview --locale=zh-tw
45
+ ```
46
+
47
+ ## 扩展安装
48
+
49
+ 1. 卸载其他语言包,避免与官方 VS Code 中文包冲突。
50
+ 2. 在扩展中搜索 **Kiro Language Pack** 或 **汉化**,也可从 [GitHub Releases](https://github.com/polang233/kiro-language-pack/releases) 下载 VSIX,通过 **Extensions: Install from VSIX…** 安装。
51
+ 3. 命令面板运行 **Language Pack: Select Display Language**,选简体或繁体,完全退出 Kiro 后重新打开。
52
+
53
+ 扩展 id 保持 `polang233.kiro-language-pack`。也可用设置 `kiroLanguagePack.language` 选择 `auto`、`zh-cn`、`zh-tw` 或 `en`,切换后重启。仅安装扩展时,部分写死在程序里的英文需要命令行安装才能翻译。
54
+
55
+ 当前译文对应 Kiro **1.4.26**(Code OSS 1.131.0)。新增或未覆盖的文案会显示英文。界面语言不影响 AI 回复语言,可通过 `.kiro/steering/language.md` 指定回复语言。
56
+
57
+ ## 开发与许可
58
+
59
+ [维护与源码测试](docs/npm.md) · [发布](docs/publishing.zh-CN.md) · [架构](docs/architecture.zh-CN.md) · [贡献](CONTRIBUTING.md)
60
+
61
+ MIT。工作台译文来自 [microsoft/vscode-loc](https://github.com/microsoft/vscode-loc),见 [NOTICE](NOTICE)。社区项目,与 AWS、Microsoft 无隶属关系。
Binary file
package/bin/cli.mjs ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from '../scripts/lib/cli.mjs';
3
+ await runCli('kiro');
package/config.json ADDED
@@ -0,0 +1,185 @@
1
+ {
2
+ "$comment": "Single source of truth for the build. Everything else is generated.",
3
+
4
+ "publisher": "polang233",
5
+ "$publisher": "Must match the Open VSX namespace you claim with `ovsx create-namespace`, and the Marketplace publisher id if you also publish there. Taken from the GitHub account this repository is authored from; change it here if you publish under an organisation instead.",
6
+ "namePrefix": "kiro-language-pack",
7
+ "version": "1.2.0",
8
+ "license": "MIT",
9
+ "repository": "https://github.com/polang233/kiro-language-pack",
10
+ "homepage": "https://github.com/polang233/kiro-language-pack#readme",
11
+ "bugs": "https://github.com/polang233/kiro-language-pack/issues",
12
+ "icon": "media/icon.png",
13
+ "$icon": "Copied into each packaged extension by scripts/build.mjs. 128x128 PNG.",
14
+
15
+ "engines": {
16
+ "vscode": "^1.107.0"
17
+ },
18
+ "$engines": "Lower bound, deliberately below the newest Kiro: 1.0.228 is Code OSS 1.107.1, 1.0.242 is 1.108.2, 1.0.309 / 1.0.395 / 1.0.437 are 1.109.5, and 1.1.14 / 1.1.70 / 1.4.0 are 1.131.0, so ^1.107.0 installs on all of them. Raise it only to require a newer Kiro. `npm run detect` prints the value for the locally installed build.",
19
+
20
+ "pack": {
21
+ "displayName": "Kiro Language Pack — 简体中文 / 繁體中文",
22
+ "description": "Kiro IDE 中文语言包(汉化 / 中文翻译)。简体与繁体已发布;替代 VS Code 官方语言包,并覆盖 Kiro 写进内核的界面文案。其他语言可自行贡献。Simplified & Traditional Chinese for Kiro; other locales welcome via PR.",
23
+ "$note": "Used by the single-extension `full` mode, which ships every enabled locale in one artifact and lets the host pick by display language. Open VSX / Marketplace show ONE displayName + this description, and both are searched, so both carry the Chinese terms users actually type - there are no per-locale storefront pages. Per-locale naming/description on each locale entry is only used by `companion` / single-locale builds. Only locales with enabled:true are packaged. Keep the displayName starting with Kiro so it sorts with other Kiro extensions in the marketplace, and re-check this text when a non-Chinese locale is enabled."
24
+ },
25
+
26
+ "target": {
27
+ "kiroExtensionId": "kiro.kiroAgent",
28
+ "$kiroExtensionId": "publisher.name from resources/app/extensions/kiro.kiro-agent/package.json. The folder name (kiro.kiro-agent) is NOT the extension id.",
29
+ "verifiedKiroVersions": ["1.0.228", "1.0.242", "1.0.309", "1.0.395", "1.0.437", "1.1.14", "1.1.70", "1.4.0", "1.4.26"],
30
+ "$verifiedKiroVersions": "Builds whose localizable surface this pack has been reconciled against: `npm run coverage` reports 100% for the Kiro-specific keys and `npm run validate` passes. `npm run check-upgrade` compares the installed Kiro against this list."
31
+ },
32
+
33
+ "locales": [
34
+ {
35
+ "id": "zh-cn",
36
+ "languageName": "Chinese Simplified",
37
+ "localizedLanguageName": "中文(简体)",
38
+ "displayName": "Kiro Chinese (Simplified) Language Pack",
39
+ "description": "Simplified Chinese for the whole Kiro IDE: the editor workbench and Kiro's own interface. Self-contained; replaces the official VS Code language pack. Kiro IDE 完整界面简体中文语言包(含编辑器主体与 Kiro 自有界面),自包含,替代 VS Code 官方中文语言包。",
40
+ "companionExtension": "ms-ceintl.vscode-language-pack-zh-hans",
41
+ "upstreamPackDir": "i18n/vscode-language-pack-zh-hans",
42
+ "enabled": true
43
+ },
44
+ {
45
+ "id": "zh-tw",
46
+ "languageName": "Chinese Traditional",
47
+ "localizedLanguageName": "中文(繁體)",
48
+ "displayName": "Kiro Chinese (Traditional) Language Pack",
49
+ "description": "Traditional Chinese for the whole Kiro IDE: the editor workbench and Kiro's own interface. Self-contained; replaces the official VS Code language pack. Kiro IDE 完整介面繁體中文語言包(含編輯器主體與 Kiro 自有介面),自包含,替代 VS Code 官方繁體中文語言包。",
50
+ "companionExtension": "ms-ceintl.vscode-language-pack-zh-hant",
51
+ "upstreamPackDir": "i18n/vscode-language-pack-zh-hant",
52
+ "enabled": true
53
+ },
54
+ {
55
+ "id": "ja",
56
+ "languageName": "Japanese",
57
+ "localizedLanguageName": "日本語",
58
+ "companionExtension": "ms-ceintl.vscode-language-pack-ja",
59
+ "upstreamPackDir": "i18n/vscode-language-pack-ja",
60
+ "enabled": false
61
+ },
62
+ {
63
+ "id": "ko",
64
+ "languageName": "Korean",
65
+ "localizedLanguageName": "한국어",
66
+ "companionExtension": "ms-ceintl.vscode-language-pack-ko",
67
+ "upstreamPackDir": "i18n/vscode-language-pack-ko",
68
+ "enabled": false
69
+ },
70
+ {
71
+ "id": "fr",
72
+ "languageName": "French",
73
+ "localizedLanguageName": "français",
74
+ "companionExtension": "ms-ceintl.vscode-language-pack-fr",
75
+ "upstreamPackDir": "i18n/vscode-language-pack-fr",
76
+ "enabled": false
77
+ },
78
+ {
79
+ "id": "de",
80
+ "languageName": "German",
81
+ "localizedLanguageName": "Deutsch",
82
+ "companionExtension": "ms-ceintl.vscode-language-pack-de",
83
+ "upstreamPackDir": "i18n/vscode-language-pack-de",
84
+ "enabled": false
85
+ },
86
+ {
87
+ "id": "es",
88
+ "languageName": "Spanish",
89
+ "localizedLanguageName": "español",
90
+ "companionExtension": "ms-ceintl.vscode-language-pack-es",
91
+ "upstreamPackDir": "i18n/vscode-language-pack-es",
92
+ "enabled": false
93
+ },
94
+ {
95
+ "id": "it",
96
+ "languageName": "Italian",
97
+ "localizedLanguageName": "italiano",
98
+ "companionExtension": "ms-ceintl.vscode-language-pack-it",
99
+ "upstreamPackDir": "i18n/vscode-language-pack-it",
100
+ "enabled": false
101
+ },
102
+ {
103
+ "id": "ru",
104
+ "languageName": "Russian",
105
+ "localizedLanguageName": "русский",
106
+ "companionExtension": "ms-ceintl.vscode-language-pack-ru",
107
+ "upstreamPackDir": "i18n/vscode-language-pack-ru",
108
+ "enabled": false
109
+ },
110
+ {
111
+ "id": "pt-br",
112
+ "languageName": "Portuguese (Brazil)",
113
+ "localizedLanguageName": "português (Brasil)",
114
+ "companionExtension": "ms-ceintl.vscode-language-pack-pt-BR",
115
+ "upstreamPackDir": "i18n/vscode-language-pack-pt-BR",
116
+ "enabled": false
117
+ },
118
+ {
119
+ "id": "tr",
120
+ "languageName": "Turkish",
121
+ "localizedLanguageName": "Türkçe",
122
+ "companionExtension": "ms-ceintl.vscode-language-pack-tr",
123
+ "upstreamPackDir": "i18n/vscode-language-pack-tr",
124
+ "enabled": false
125
+ },
126
+ {
127
+ "id": "pl",
128
+ "languageName": "Polish",
129
+ "localizedLanguageName": "polski",
130
+ "companionExtension": "ms-ceintl.vscode-language-pack-pl",
131
+ "upstreamPackDir": "i18n/vscode-language-pack-pl",
132
+ "enabled": false
133
+ },
134
+ {
135
+ "id": "cs",
136
+ "languageName": "Czech",
137
+ "localizedLanguageName": "čeština",
138
+ "companionExtension": "ms-ceintl.vscode-language-pack-cs",
139
+ "upstreamPackDir": "i18n/vscode-language-pack-cs",
140
+ "enabled": false
141
+ }
142
+ ],
143
+ "$locales": "Every language microsoft/vscode-loc ships is listed here; only the enabled ones are built. To contribute a language, create src/i18n/<id>/ (see CONTRIBUTING.md) and flip `enabled` to true - no script changes needed. For a language vscode-loc does not cover, add an entry with upstreamPackDir set to null: the workbench then stays English and only the Kiro strings are translated.",
144
+
145
+ "modes": {
146
+ "full": {
147
+ "enabled": true,
148
+ "perLocale": false,
149
+ "nameSuffix": "",
150
+ "displayNameSuffix": "",
151
+ "includeUpstream": true,
152
+ "kiroOnly": false,
153
+ "requireCompanion": false,
154
+ "$note": "The published product. One extension declaring every enabled locale, so the host picks by display language and untranslated strings fall back to English. Self-contained: it carries the vscode-loc workbench baseline plus the Kiro translations, and therefore owns the `vscode` translation id. Do not install an official VS Code language pack alongside it - see $why.",
155
+ "$why": "Kiro is a fork that compiled its own UI into the Code OSS core (vs/workbench/contrib/kiroStandalone/*, vs/workbench/contrib/spec/*, the rewritten chat contrib). Those strings live in the `vscode` translation id, not in a separate extension id, and languagepacks.json maps one id to exactly one file - there is no per-key merge. Translating Kiro's Settings panel therefore requires owning `vscode`, which rules out coexisting with the official pack."
156
+ },
157
+ "companion": {
158
+ "enabled": false,
159
+ "perLocale": true,
160
+ "nameSuffix": "-companion",
161
+ "displayNameSuffix": " (Companion)",
162
+ "includeUpstream": false,
163
+ "kiroOnly": true,
164
+ "requireCompanion": false,
165
+ "$note": "One extension per locale, claiming only the `kiro.kiroAgent` id, ~11 KB. Coexists with the official VS Code language pack because it does not touch the `vscode` id. The trade-off is scope: it reaches the 72 manifest strings (command titles, view names, spec toolbar) but not the Settings panel, the session list or anything else Kiro compiled into the core. Disabled by default.",
166
+ "$requireCompanion": "Set to true to emit extensionDependencies for the locale's companionExtension, so installing this pack pulls in the official VS Code language pack automatically. Off by default: it hard-couples the two and fails if the companion is unavailable in the target registry."
167
+ }
168
+ },
169
+
170
+ "upstream": {
171
+ "repo": "microsoft/vscode-loc",
172
+ "ref": "main",
173
+ "$ref": "Pin to a tag or commit sha for reproducible releases. `main` is convenient during development.",
174
+ "$license": "vscode-loc source and strings are MIT licensed, so redistribution is permitted. See NOTICE."
175
+ },
176
+
177
+ "build": {
178
+ "filterByKiroMetadata": true,
179
+ "$filterByKiroMetadata": "Drop keys that do not exist in the local Kiro build. Shrinks the pack and makes coverage numbers meaningful. Automatically disabled when metadata/ is absent (e.g. in CI).",
180
+ "repairMismatchedMarkers": true,
181
+ "$repairMismatchedMarkers": "Drop inherited translations whose {0} placeholders, $(icon) references or (command:...) links no longer match the English source in the installed Kiro build. Those strings render broken text, so falling back to English is strictly better. Mismatches in files this repository maintains are reported instead of dropped. Requires metadata/.",
182
+ "dropEmptyBundles": true,
183
+ "prettyJson": false
184
+ }
185
+ }
package/package.json CHANGED
@@ -1,6 +1,76 @@
1
1
  {
2
2
  "name": "@polang233/kiro-language-pack",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.2.0",
4
+ "description": "Kiro 简体/繁体中文汉化工具,自动选择系统语言,支持一键安装与恢复。",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/polang233/kiro-language-pack.git"
10
+ },
11
+ "homepage": "https://github.com/polang233/kiro-language-pack#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/polang233/kiro-language-pack/issues"
14
+ },
15
+ "engines": {
16
+ "node": ">=18.17.0"
17
+ },
18
+ "scripts": {
19
+ "detect": "node scripts/detect-kiro.mjs",
20
+ "extract": "node scripts/extract.mjs",
21
+ "audit": "node scripts/audit-manifest.mjs",
22
+ "gap": "node scripts/gap.mjs",
23
+ "check-upgrade": "node scripts/check-upgrade.mjs",
24
+ "patch": "node scripts/patch-install.mjs",
25
+ "test": "node scripts/test-extension.mjs && node --test scripts/test-cli.mjs scripts/test-upgrade.mjs && node scripts/test-patch.mjs",
26
+ "sync": "node scripts/sync-upstream.mjs",
27
+ "build": "node scripts/build.mjs",
28
+ "coverage": "node scripts/coverage.mjs",
29
+ "validate": "node scripts/validate-dist.mjs",
30
+ "package": "node scripts/package.mjs",
31
+ "publish:ovsx": "node scripts/publish.mjs --registry=ovsx",
32
+ "publish:vsce": "node scripts/publish.mjs --registry=vsce",
33
+ "verify": "node scripts/build.mjs && node scripts/validate-dist.mjs && node scripts/coverage.mjs",
34
+ "clean": "node -e \"for (const d of ['dist','reports']) require('fs').rmSync(d,{recursive:true,force:true})\"",
35
+ "prepack": "node scripts/prepare-npm.mjs",
36
+ "package:npm": "node scripts/package-npm.mjs",
37
+ "test:cli": "node --test scripts/test-cli.mjs",
38
+ "test:package": "node scripts/test-package.mjs",
39
+ "test:upgrade": "node --test scripts/test-upgrade.mjs"
40
+ },
41
+ "devDependencies": {
42
+ "@vscode/vsce": "3.2.1",
43
+ "opencc-js": "1.4.1",
44
+ "ovsx": "0.10.1"
45
+ },
46
+ "$devDependencies": "opencc-js is only used by scripts/convert-zh-tw.mjs, which regenerates the zh-tw sources from zh-cn. It is declared so `npm ci` keeps it available.",
47
+ "bin": {
48
+ "kiro-language-pack": "bin/cli.mjs"
49
+ },
50
+ "files": [
51
+ "bin/",
52
+ "scripts/lib/",
53
+ "scripts/patch-install.mjs",
54
+ "src/extension/main.cjs",
55
+ "src/i18n/zh-cn/patch/kiro.kiroAgent.json",
56
+ "src/i18n/zh-tw/patch/kiro.kiroAgent.json",
57
+ "assets/language-pack.vsix",
58
+ "config.json",
59
+ "LICENSE",
60
+ "NOTICE"
61
+ ],
62
+ "publishConfig": {
63
+ "access": "public",
64
+ "registry": "https://registry.npmjs.org/"
65
+ },
66
+ "keywords": [
67
+ "kiro",
68
+ "汉化",
69
+ "中文语言包",
70
+ "localization",
71
+ "cli",
72
+ "chinese",
73
+ "zh-cn",
74
+ "zh-tw"
75
+ ]
76
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Access to the display-language field of argv.json from build-time scripts.
3
+ *
4
+ * The implementation deliberately lives in `src/extension/main.cjs`: that is the copy
5
+ * that ships inside the .vsix and the copy `npm test` exercises. argv.json is JSON with
6
+ * comments, is shared with the editor, and a botched write can keep Kiro from starting,
7
+ * so there must be exactly one implementation of that edit. This module loads it with
8
+ * `vscode` stubbed - the same trick scripts/test-extension.mjs uses - rather than
9
+ * duplicating the logic here.
10
+ */
11
+ import Module from 'node:module';
12
+ import { createRequire } from 'node:module';
13
+ import { p } from './util.mjs';
14
+
15
+ /** Enough of the `vscode` API surface for the module to load; none of it is called. */
16
+ const VSCODE_STUB = {
17
+ l10n: { t: (message) => message },
18
+ env: { appRoot: '', language: 'en' },
19
+ window: {},
20
+ commands: {},
21
+ workspace: {},
22
+ extensions: { all: [] }
23
+ };
24
+
25
+ let cached = null;
26
+
27
+ /**
28
+ * @returns {{ readLocale: (file: string) => string | null,
29
+ * writeLocale: (file: string, locale: string) => void }}
30
+ */
31
+ export function argvLocale() {
32
+ if (cached) return cached;
33
+
34
+ const originalLoad = Module._load;
35
+ Module._load = function (request, parent, isMain) {
36
+ if (request === 'vscode') return VSCODE_STUB;
37
+ return originalLoad.call(this, request, parent, isMain);
38
+ };
39
+ try {
40
+ const require = createRequire(import.meta.url);
41
+ const api = require(p('src', 'extension', 'main.cjs')).__test;
42
+ if (!api?.readLocale || !api?.writeLocale) {
43
+ throw new Error('src/extension/main.cjs no longer exports __test.{readLocale,writeLocale}');
44
+ }
45
+ cached = api;
46
+ } finally {
47
+ Module._load = originalLoad;
48
+ }
49
+ return cached;
50
+ }