@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 +21 -0
- package/NOTICE +57 -0
- package/README.en.md +61 -0
- package/README.md +60 -2
- package/README.zh-CN.md +61 -0
- package/assets/language-pack.vsix +0 -0
- package/bin/cli.mjs +3 -0
- package/config.json +185 -0
- package/package.json +74 -4
- package/scripts/lib/argv.mjs +50 -0
- package/scripts/lib/cli.mjs +101 -0
- package/scripts/lib/kiro-paths.mjs +151 -0
- package/scripts/lib/markers.mjs +43 -0
- package/scripts/lib/npm-tooling.mjs +19 -0
- package/scripts/lib/patch-state.mjs +304 -0
- package/scripts/lib/system-locale.mjs +37 -0
- package/scripts/lib/upgrade-diff.mjs +244 -0
- package/scripts/lib/util.mjs +146 -0
- package/scripts/patch-install.mjs +763 -0
- package/src/extension/main.cjs +287 -0
- package/src/i18n/zh-cn/patch/kiro.kiroAgent.json +125 -0
- package/src/i18n/zh-tw/patch/kiro.kiroAgent.json +125 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The language pack's runtime. A language pack does not need code - the translations
|
|
3
|
+
* work without it - so everything here exists only to close two gaps the host leaves:
|
|
4
|
+
*
|
|
5
|
+
* 1. Picking a language. Kiro inherits Code OSS's "Configure Display Language"
|
|
6
|
+
* command, which most people never find, and the host only offers to switch
|
|
7
|
+
* automatically when the pack matches the OS locale. This adds a setting and a
|
|
8
|
+
* command that write `locale` into argv.json for you. Switching to English (or
|
|
9
|
+
* back to a bundled language) only changes which translations the host loads —
|
|
10
|
+
* the pack stays installed; no reinstall is needed to switch again.
|
|
11
|
+
* 2. Warning about a conflicting pack. This pack claims the `vscode` translation id.
|
|
12
|
+
* So does an official VS Code language pack. `languagepacks.json` maps one id to
|
|
13
|
+
* one file, assigned by whichever extension is scanned last, so having both
|
|
14
|
+
* installed produces a partly translated UI that can change between restarts.
|
|
15
|
+
* Uninstall does not auto-clear argv.json; set locale to `en` (or delete the
|
|
16
|
+
* field) when fully removing the pack.
|
|
17
|
+
*
|
|
18
|
+
* Exactly what it touches, and nothing else:
|
|
19
|
+
* - reads <appRoot>/product.json to learn the user data folder name
|
|
20
|
+
* - reads ~/<dataFolder>/argv.json the current display language
|
|
21
|
+
* - writes ~/<dataFolder>/argv.json only the `locale` field, only after you
|
|
22
|
+
* confirm, preserving comments and formatting
|
|
23
|
+
* - reads the manifests of installed extensions, to spot a conflicting pack
|
|
24
|
+
* - stores two "do not ask again" flags in this extension's own global state
|
|
25
|
+
*
|
|
26
|
+
* No network access, no telemetry, no other files, no changes to your settings.
|
|
27
|
+
*/
|
|
28
|
+
'use strict';
|
|
29
|
+
|
|
30
|
+
const fs = require('fs');
|
|
31
|
+
const os = require('os');
|
|
32
|
+
const path = require('path');
|
|
33
|
+
const vscode = require('vscode');
|
|
34
|
+
|
|
35
|
+
const SECTION = 'kiroLanguagePack';
|
|
36
|
+
const AUTO = 'auto';
|
|
37
|
+
const DISMISS_LANGUAGE_PROMPT = 'dismissedLanguagePrompt';
|
|
38
|
+
const DISMISS_CONFLICT_WARNING = 'dismissedConflictWarning';
|
|
39
|
+
|
|
40
|
+
const t = vscode.l10n?.t ?? ((message, ...args) =>
|
|
41
|
+
message.replace(/\{(\d+)\}/g, (_, i) => String(args[Number(i)] ?? `{${i}}`)));
|
|
42
|
+
|
|
43
|
+
/** @returns {{id: string, label: string}[]} the locales this build declares */
|
|
44
|
+
function declaredLocales(context) {
|
|
45
|
+
const localizations = context.extension.packageJSON.contributes?.localizations ?? [];
|
|
46
|
+
return localizations.map((l) => ({
|
|
47
|
+
id: l.languageId,
|
|
48
|
+
label: l.localizedLanguageName || l.languageName || l.languageId
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* argv.json sits next to the user data, in a folder named by product.json. Deriving it
|
|
54
|
+
* that way instead of hardcoding `.kiro` keeps this working on a portable install.
|
|
55
|
+
*/
|
|
56
|
+
function argvPath() {
|
|
57
|
+
let dataFolderName = '.kiro';
|
|
58
|
+
try {
|
|
59
|
+
const product = JSON.parse(fs.readFileSync(path.join(vscode.env.appRoot, 'product.json'), 'utf8'));
|
|
60
|
+
if (typeof product.dataFolderName === 'string' && product.dataFolderName) {
|
|
61
|
+
dataFolderName = product.dataFolderName;
|
|
62
|
+
}
|
|
63
|
+
} catch {
|
|
64
|
+
// A wrong guess only means we cannot read or write the locale, and we say so.
|
|
65
|
+
}
|
|
66
|
+
return path.join(os.homedir(), dataFolderName, 'argv.json');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** The locale currently written in argv.json, or null when the field is absent. */
|
|
70
|
+
function readLocale(file) {
|
|
71
|
+
try {
|
|
72
|
+
const text = fs.readFileSync(file, 'utf8');
|
|
73
|
+
const match = text.match(/^[ \t]*"locale"[ \t]*:[ \t]*"([^"]*)"/m);
|
|
74
|
+
return match ? match[1] : null;
|
|
75
|
+
} catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Write `locale` into argv.json, touching nothing else. The file is JSON with comments;
|
|
82
|
+
* parsing and reserializing it would drop those, so this edits the one field in place.
|
|
83
|
+
*/
|
|
84
|
+
function writeLocale(file, locale) {
|
|
85
|
+
let text;
|
|
86
|
+
try {
|
|
87
|
+
text = fs.readFileSync(file, 'utf8');
|
|
88
|
+
} catch (err) {
|
|
89
|
+
if (err.code !== 'ENOENT') throw err;
|
|
90
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
91
|
+
fs.writeFileSync(file, `{\n\t"locale": "${locale}"\n}\n`, 'utf8');
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const existing = /^([ \t]*)"locale"([ \t]*):([ \t]*)"[^"]*"/m;
|
|
96
|
+
if (existing.test(text)) {
|
|
97
|
+
fs.writeFileSync(file, text.replace(existing, `$1"locale"$2:$3"${locale}"`), 'utf8');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const close = text.lastIndexOf('}');
|
|
102
|
+
if (close === -1) throw new Error(`${file} is not a JSON object`);
|
|
103
|
+
const head = text.slice(0, close).replace(/\s*$/, '');
|
|
104
|
+
const tail = text.slice(close);
|
|
105
|
+
// A comma is needed unless the object is still empty.
|
|
106
|
+
const needsComma = !/[{,]$/.test(head.replace(/\/\/[^\n]*/g, '').replace(/\s*$/, ''));
|
|
107
|
+
fs.writeFileSync(file, `${head}${needsComma ? ',' : ''}\n\t"locale": "${locale}"\n${tail}`, 'utf8');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const readArgvLocale = () => readLocale(argvPath());
|
|
111
|
+
const writeArgvLocale = (locale) => writeLocale(argvPath(), locale);
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The display language is a process argument, so reloading the window is not enough -
|
|
115
|
+
* the application has to start again. Kiro ships its own restart command; when it is
|
|
116
|
+
* absent we say so instead of pretending.
|
|
117
|
+
*/
|
|
118
|
+
async function offerRestart(label) {
|
|
119
|
+
const commands = await vscode.commands.getCommands(true);
|
|
120
|
+
const restartCommand = ['kiro.agentFocus.fullRestart', 'workbench.action.restart']
|
|
121
|
+
.find((c) => commands.includes(c));
|
|
122
|
+
|
|
123
|
+
const message = t(
|
|
124
|
+
'Display language set to {0}. Restart Kiro to apply it. The language pack stays installed; switch again anytime without reinstalling.',
|
|
125
|
+
label
|
|
126
|
+
);
|
|
127
|
+
if (!restartCommand) {
|
|
128
|
+
await vscode.window.showInformationMessage(t('{0} Quit and start Kiro again.', message));
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const restartNow = t('Restart now');
|
|
132
|
+
const choice = await vscode.window.showInformationMessage(message, restartNow, t('Later'));
|
|
133
|
+
if (choice === restartNow) await vscode.commands.executeCommand(restartCommand);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function localeLabel(id, locales) {
|
|
137
|
+
if (id === 'en') return 'English';
|
|
138
|
+
return locales.find((l) => l.id === id)?.label ?? id;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async function applyLocale(locale, label) {
|
|
142
|
+
if (readArgvLocale() === locale) {
|
|
143
|
+
vscode.window.showInformationMessage(t('The display language is already {0}.', label));
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
try {
|
|
147
|
+
writeArgvLocale(locale);
|
|
148
|
+
} catch (err) {
|
|
149
|
+
vscode.window.showErrorMessage(t(
|
|
150
|
+
'Could not write {0}: {1}. Run "Configure Display Language" from the Command Palette instead.',
|
|
151
|
+
argvPath(),
|
|
152
|
+
err.message
|
|
153
|
+
));
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
await offerRestart(label);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function selectLanguage(context) {
|
|
160
|
+
const current = readArgvLocale();
|
|
161
|
+
const locales = declaredLocales(context);
|
|
162
|
+
const mark = (id) => (id === current || (id === 'en' && current === null) ? t('current') : null);
|
|
163
|
+
const items = [
|
|
164
|
+
...locales.map((l) => ({
|
|
165
|
+
label: l.label,
|
|
166
|
+
description: [l.id, mark(l.id)].filter(Boolean).join(' • '),
|
|
167
|
+
detail: t('Applies workbench and Kiro UI. The pack stays installed — switch languages anytime without reinstalling.'),
|
|
168
|
+
locale: l.id
|
|
169
|
+
})),
|
|
170
|
+
{
|
|
171
|
+
label: 'English',
|
|
172
|
+
description: ['en', mark('en')].filter(Boolean).join(' • '),
|
|
173
|
+
detail: t('Built-in English. Menus, Settings, session list and other Kiro panels all return to English. The pack stays installed — pick a language again later, no reinstall.'),
|
|
174
|
+
locale: 'en'
|
|
175
|
+
}
|
|
176
|
+
];
|
|
177
|
+
|
|
178
|
+
const picked = await vscode.window.showQuickPick(items, {
|
|
179
|
+
title: t('Kiro Language Pack'),
|
|
180
|
+
placeHolder: t('Switch language only — does not uninstall the pack. Restart required.')
|
|
181
|
+
});
|
|
182
|
+
if (!picked) return;
|
|
183
|
+
|
|
184
|
+
// Keep the setting in step with argv.json, so it always reflects reality.
|
|
185
|
+
await vscode.workspace.getConfiguration(SECTION).update('language', picked.locale, true);
|
|
186
|
+
await applyLocale(picked.locale, picked.label);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Installed extensions that also claim the `vscode` id for a locale this pack ships. */
|
|
190
|
+
function conflictingPacks(context) {
|
|
191
|
+
const ours = context.extension.id.toLowerCase();
|
|
192
|
+
const ourLocales = new Set(declaredLocales(context).map((l) => l.id));
|
|
193
|
+
const found = [];
|
|
194
|
+
for (const ext of vscode.extensions.all) {
|
|
195
|
+
if (ext.id.toLowerCase() === ours) continue;
|
|
196
|
+
const localizations = ext.packageJSON?.contributes?.localizations;
|
|
197
|
+
if (!Array.isArray(localizations)) continue;
|
|
198
|
+
const clash = localizations.some((l) =>
|
|
199
|
+
ourLocales.has(l.languageId) && (l.translations ?? []).some((tr) => tr.id === 'vscode'));
|
|
200
|
+
if (clash) found.push(ext.id);
|
|
201
|
+
}
|
|
202
|
+
return found;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
async function warnAboutConflicts(context) {
|
|
206
|
+
if (context.globalState.get(DISMISS_CONFLICT_WARNING)) return;
|
|
207
|
+
const conflicts = conflictingPacks(context);
|
|
208
|
+
if (!conflicts.length) return;
|
|
209
|
+
|
|
210
|
+
const show = t('Show in Extensions');
|
|
211
|
+
const never = t('Do not ask again');
|
|
212
|
+
const choice = await vscode.window.showWarningMessage(
|
|
213
|
+
t(
|
|
214
|
+
'{0} also provides the workbench translations for a language this pack covers. Only one of them can win, and which one is not stable across restarts. Uninstall the other pack.',
|
|
215
|
+
conflicts.join(', ')
|
|
216
|
+
),
|
|
217
|
+
show,
|
|
218
|
+
never
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
if (choice === show) {
|
|
222
|
+
await vscode.commands.executeCommand('workbench.extensions.search', `@installed ${conflicts[0]}`);
|
|
223
|
+
} else if (choice === never) {
|
|
224
|
+
await context.globalState.update(DISMISS_CONFLICT_WARNING, true);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* The host only offers to switch language when the pack matches the OS locale. When it
|
|
230
|
+
* does not, the pack silently does nothing, which reads as a broken extension. One
|
|
231
|
+
* prompt, dismissible forever, closes that gap.
|
|
232
|
+
*/
|
|
233
|
+
async function maybeOfferLanguage(context) {
|
|
234
|
+
const configured = vscode.workspace.getConfiguration(SECTION).get('language', AUTO);
|
|
235
|
+
const locales = declaredLocales(context);
|
|
236
|
+
|
|
237
|
+
if (configured !== AUTO) {
|
|
238
|
+
if (readArgvLocale() !== configured) {
|
|
239
|
+
await applyLocale(configured, localeLabel(configured, locales));
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (locales.some((l) => l.id === vscode.env.language)) return;
|
|
245
|
+
if (context.globalState.get(DISMISS_LANGUAGE_PROMPT)) return;
|
|
246
|
+
|
|
247
|
+
const select = t('Select language');
|
|
248
|
+
const never = t('Do not ask again');
|
|
249
|
+
const choice = await vscode.window.showInformationMessage(
|
|
250
|
+
t(
|
|
251
|
+
'Kiro Language Pack is installed ({0}), but the display language is still {1}.',
|
|
252
|
+
locales.map((l) => l.label).join(', '),
|
|
253
|
+
vscode.env.language
|
|
254
|
+
),
|
|
255
|
+
select,
|
|
256
|
+
never
|
|
257
|
+
);
|
|
258
|
+
if (choice === select) await selectLanguage(context);
|
|
259
|
+
else if (choice === never) await context.globalState.update(DISMISS_LANGUAGE_PROMPT, true);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function activate(context) {
|
|
263
|
+
context.subscriptions.push(
|
|
264
|
+
vscode.commands.registerCommand(`${SECTION}.selectLanguage`, () => selectLanguage(context)),
|
|
265
|
+
vscode.commands.registerCommand(`${SECTION}.openSettings`, () =>
|
|
266
|
+
vscode.commands.executeCommand('workbench.action.openSettings', SECTION)),
|
|
267
|
+
vscode.workspace.onDidChangeConfiguration(async (event) => {
|
|
268
|
+
if (!event.affectsConfiguration(`${SECTION}.language`)) return;
|
|
269
|
+
const configured = vscode.workspace.getConfiguration(SECTION).get('language', AUTO);
|
|
270
|
+
if (configured === AUTO) return;
|
|
271
|
+
if (readArgvLocale() === configured) return;
|
|
272
|
+
await applyLocale(configured, localeLabel(configured, declaredLocales(context)));
|
|
273
|
+
})
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
// Both checks are advisory; a failure must never keep the window from starting.
|
|
277
|
+
void maybeOfferLanguage(context).catch(() => {});
|
|
278
|
+
void warnAboutConflicts(context).catch(() => {});
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function deactivate() {}
|
|
282
|
+
|
|
283
|
+
module.exports = { activate, deactivate };
|
|
284
|
+
|
|
285
|
+
// Exposed for scripts/test-extension.mjs. Editing argv.json is the only destructive
|
|
286
|
+
// thing this extension does, so it is the one part that gets tested.
|
|
287
|
+
module.exports.__test = { readLocale, writeLocale };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment2": "Do not add short or generic literals to `webview`/`extension`. \"(optional)\" was tried and rejected: it also occurs inside the bundled TextMate grammars for Clarity and Fortran, where it is documentation, not UI.",
|
|
3
|
+
"$comment": [
|
|
4
|
+
"Strings that the language pack mechanism cannot reach, for the optional installation patcher",
|
|
5
|
+
"(`npm run patch`). Everything here is applied by rewriting files inside the installed Kiro,",
|
|
6
|
+
"which is unsupported by definition: a Kiro update overwrites them. Nothing in this file affects",
|
|
7
|
+
"the .vsix.",
|
|
8
|
+
"",
|
|
9
|
+
" manifest values in extensions/kiro.kiro-agent/package.json that carry no %key% indirection",
|
|
10
|
+
" (76 of 183 localizable manifest strings). Replaced structurally: only known",
|
|
11
|
+
" localizable fields are considered, so an English word here cannot leak into an id.",
|
|
12
|
+
" extension literals in dist/extension.js. Runtime strings that would be translatable through",
|
|
13
|
+
" vscode.l10n.t() if Kiro called it. Keep these long and unambiguous.",
|
|
14
|
+
" webview literals in packages/*/dist/**/*.js - the React chat UI. Same rule.",
|
|
15
|
+
"",
|
|
16
|
+
"Rules: keep {0} placeholders, $(codicon) markers and (command:...) targets exactly as they are.",
|
|
17
|
+
"For extension/webview entries the English side must match the source byte for byte, including",
|
|
18
|
+
"punctuation, and must be specific enough not to appear anywhere else."
|
|
19
|
+
],
|
|
20
|
+
"version": "1.0.0",
|
|
21
|
+
|
|
22
|
+
"manifest": {
|
|
23
|
+
"Kiro": "Kiro",
|
|
24
|
+
"Kiro Agent": "Kiro",
|
|
25
|
+
"Context provider type": "上下文提供程序类型",
|
|
26
|
+
"Path segment in context provider": "上下文提供程序中的路径片段",
|
|
27
|
+
"Delimiter in context provider syntax": "上下文提供程序语法中的分隔符",
|
|
28
|
+
"Kiro Experiments feature states": "Kiro 实验功能的启用状态",
|
|
29
|
+
"Maximum time in milliseconds that a terminal command is allowed to run before it times out. When unset, commands use the built-in default timeout.": "终端命令在超时前允许运行的最长时间(毫秒)。未设置时,命令使用内置的默认超时。",
|
|
30
|
+
"**Deprecated.** Kiro now manages trust configuration with Trust v2. Your existing values have been migrated to `~/.kiro/settings/permissions.yaml`. Run **Kiro: Open Permissions (User)** or edit that file to change trust rules.": "**已弃用。** Kiro 现在通过 Trust v2 管理信任配置。你原有的值已迁移到 `~/.kiro/settings/permissions.yaml`。执行 **Kiro: 打开权限配置 (用户)** 或直接编辑该文件来修改信任规则。",
|
|
31
|
+
"Collapse on Complete": "完成后折叠",
|
|
32
|
+
"Always Expanded": "始终展开",
|
|
33
|
+
"Collapse a tool card automatically once it finishes (default).": "工具卡片执行完毕后自动折叠(默认)。",
|
|
34
|
+
"Keep tool cards expanded after they complete or error.": "工具卡片完成或出错后仍保持展开。",
|
|
35
|
+
"Controls how tool cards in the chat behave after a tool finishes. \"Collapse on Complete\" auto-collapses finished tool cards; \"Always Expanded\" leaves them open.": "控制聊天中的工具卡片在工具执行完毕后的行为。\"完成后折叠\" 会自动折叠已完成的卡片;\"始终展开\" 会保持其打开。",
|
|
36
|
+
"Trust the exact command (e.g. `npm run test`).": "信任完全一致的命令(例如 `npm run test`)。",
|
|
37
|
+
"Trust the command and its first argument (e.g. `npm run *`).": "信任命令及其第一个参数(例如 `npm run *`)。",
|
|
38
|
+
"Trust the base command (e.g. `npm *`).": "信任基础命令(例如 `npm *`)。",
|
|
39
|
+
"Pre-selected command pattern when you choose \"Always allow\"/\"Always deny\" for a shell command. Remembers your last choice; you can still change it per prompt.": "为某个 Shell 命令选择 \"始终允许\" / \"始终拒绝\" 时预选的命令匹配范围。会记住你上次的选择,每次询问时仍可更改。",
|
|
40
|
+
"All workspaces (persisted to your user permissions).": "所有工作区(写入你的用户权限配置)。",
|
|
41
|
+
"This workspace only.": "仅当前工作区。",
|
|
42
|
+
"This session only (not persisted to disk).": "仅当前会话(不写入磁盘)。",
|
|
43
|
+
"Pre-selected scope when you choose \"Always allow\"/\"Always deny\". Remembers your last choice; you can still change it per prompt.": "选择 \"始终允许\" / \"始终拒绝\" 时预选的生效范围。会记住你上次的选择,每次询问时仍可更改。",
|
|
44
|
+
"Focus Chat Input": "聚焦聊天输入框",
|
|
45
|
+
"Add Code Block to Chat": "将代码块添加到聊天",
|
|
46
|
+
"Start New Chat Session": "开始新的聊天会话",
|
|
47
|
+
"Open Chat Session": "打开聊天会话",
|
|
48
|
+
"Refresh Remote Tools": "刷新远程工具",
|
|
49
|
+
"Delete Account": "删除账户",
|
|
50
|
+
"Create Debug Log Zip": "创建调试日志压缩包",
|
|
51
|
+
"Delete Steering": "删除指引文档",
|
|
52
|
+
"Delete Hook": "删除钩子",
|
|
53
|
+
"Delete Skill": "删除技能",
|
|
54
|
+
"Refine": "完善",
|
|
55
|
+
"Previous document": "上一个文档",
|
|
56
|
+
"Next document": "下一个文档",
|
|
57
|
+
"Delete Spec": "删除规格",
|
|
58
|
+
"Rename Spec": "重命名规格",
|
|
59
|
+
"Retry": "重试",
|
|
60
|
+
"Ask Kiro": "询问 Kiro",
|
|
61
|
+
"Reauthenticate": "重新认证",
|
|
62
|
+
"Reconnect": "重新连接",
|
|
63
|
+
"Disable": "禁用",
|
|
64
|
+
"Show MCP Logs": "显示 MCP 日志",
|
|
65
|
+
"Test Tool": "测试工具",
|
|
66
|
+
"Enable": "启用",
|
|
67
|
+
"Disable All Tools": "禁用所有工具",
|
|
68
|
+
"Enable All Tools": "启用所有工具",
|
|
69
|
+
"MCP: Disable All Servers": "MCP:禁用所有服务器",
|
|
70
|
+
"MCP: Enable All Servers": "MCP:启用所有服务器",
|
|
71
|
+
"Reset Approved MCP Environment Variables": "重置已批准的 MCP 环境变量",
|
|
72
|
+
"MCP: Install from Registry": "MCP:从注册表安装",
|
|
73
|
+
"MCP: Reload Registry": "MCP:重新加载注册表",
|
|
74
|
+
"Generate Commit Message": "生成提交信息",
|
|
75
|
+
"Show Account Dashboard": "显示账户面板",
|
|
76
|
+
"Discuss": "讨论",
|
|
77
|
+
"Next Chat Session Tab": "下一个聊天会话选项卡",
|
|
78
|
+
"Previous Chat Session Tab": "上一个聊天会话选项卡",
|
|
79
|
+
"Close Chat Session Tab": "关闭聊天会话选项卡",
|
|
80
|
+
"Find in Chat": "在聊天中查找",
|
|
81
|
+
"Focus Migration Logs": "聚焦迁移日志",
|
|
82
|
+
"Show Architectural Overview": "显示架构总览",
|
|
83
|
+
"Chat": "聊天",
|
|
84
|
+
"Powers": "能力",
|
|
85
|
+
"ACP Debug": "ACP 调试",
|
|
86
|
+
"Specs": "规格",
|
|
87
|
+
"Safety Properties": "安全属性",
|
|
88
|
+
"ACP Inspector": "ACP 检查器",
|
|
89
|
+
"Open a project to start working with Kiro\n[Open Project](command:workbench.action.files.openFolder)": "打开一个项目即可开始使用 Kiro\n[打开项目](command:workbench.action.files.openFolder)",
|
|
90
|
+
"Open a project to start working with Kiro\n[Open Project](command:workbench.action.files.openFolderViaWorkspace)": "打开一个项目即可开始使用 Kiro\n[打开项目](command:workbench.action.files.openFolderViaWorkspace)",
|
|
91
|
+
"Create a project plan to develop complex features and services\n\n[$(add) Create New Spec](command:kiro.spec.explorerCreateSpec)": "创建项目计划,用于开发复杂的功能与服务\n\n[$(add) 新建规格](command:kiro.spec.explorerCreateSpec)",
|
|
92
|
+
"Guide agent behavior and responses \n [Generate Steering Docs](command:kiro.steering.createInitialSteering)": "指引智能体的行为与回复 \n [生成指引文档](command:kiro.steering.createInitialSteering)",
|
|
93
|
+
"Automate tasks like documentation, code cleanup, or language localization\n\n[$(add) Create New Hook](command:kiroAgent.hooks.createNew)": "自动化文档编写、代码清理、界面本地化等任务\n\n[$(add) 新建钩子](command:kiroAgent.hooks.createNew)",
|
|
94
|
+
|
|
95
|
+
"Custom prompts for the Kiro editor context menu actions. Each value replaces the built-in prompt for that action.": "Kiro 编辑器右键菜单动作的自定义提示。每一项都会替换该动作内置的提示。",
|
|
96
|
+
"Override the prompt used by the \"Fix Grammar / Spelling\" editor action.": "覆盖 \"修正语法 / 拼写\" 动作使用的提示。",
|
|
97
|
+
"Override the prompt used by the \"Write Comments for this Code\" editor action.": "覆盖 \"为这段代码写注释\" 动作使用的提示。",
|
|
98
|
+
"Override the prompt used by the \"Write a Docstring for this Code\" editor action.": "覆盖 \"为这段代码写文档字符串\" 动作使用的提示。",
|
|
99
|
+
"Override the prompt used by the \"Fix this Code\" editor action.": "覆盖 \"修复这段代码\" 动作使用的提示。",
|
|
100
|
+
"Override the prompt used by the \"Optimize this Code\" editor action.": "覆盖 \"优化这段代码\" 动作使用的提示。"
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"extension": {
|
|
104
|
+
"Structured feature development": "按步骤做功能",
|
|
105
|
+
"Plan-only mode that helps break ideas down into an implementation plan without making any changes": "只做规划的模式:把想法拆解成实施计划,不做任何修改",
|
|
106
|
+
"Structured bug-fix workflow: investigate, diagnose, and resolve bugs": "按步骤修 Bug:排查、定位、修复",
|
|
107
|
+
"Fast spec workflow: clarify, then auto-generate requirements, design, and tasks": "快速 Spec 流程:先澄清,再自动生成需求、设计与任务"
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
"webview": {
|
|
111
|
+
"Let's build": "开始构建",
|
|
112
|
+
"New Workspace": "新建工作区",
|
|
113
|
+
"Plan, search, or build anything": "规划、搜索,或构建任何东西",
|
|
114
|
+
"I manage your workspaces, worktrees, and sessions. Try something like:": "我负责管理你的工作区、工作树和会话。可以试试:",
|
|
115
|
+
"Start with a workflow": "选择一个工作流",
|
|
116
|
+
"Autopilot ON: Kiro will make changes on your behalf.": "自动模式已开:Kiro 会直接代你修改。",
|
|
117
|
+
"Autopilot OFF: Kiro will ask for approval for making changes.": "自动模式已关:Kiro 修改前会先征求你的同意。",
|
|
118
|
+
"View changes (": "查看更改 (",
|
|
119
|
+
"Revert changes (": "撤销更改 (",
|
|
120
|
+
"Reverting...": "正在撤销...",
|
|
121
|
+
"files changed": "个文件已更改",
|
|
122
|
+
"file changed": "个文件已更改",
|
|
123
|
+
"See all": "查看全部"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment2": "Do not add short or generic literals to `webview`/`extension`. \"(optional)\" was tried and rejected: it also occurs inside the bundled TextMate grammars for Clarity and Fortran, where it is documentation, not UI.",
|
|
3
|
+
"$comment": [
|
|
4
|
+
"Strings that the language pack mechanism cannot reach, for the optional installation patcher",
|
|
5
|
+
"(`npm run patch`). Everything here is applied by rewriting files inside the installed Kiro,",
|
|
6
|
+
"which is unsupported by definition: a Kiro update overwrites them. Nothing in this file affects",
|
|
7
|
+
"the .vsix.",
|
|
8
|
+
"",
|
|
9
|
+
" manifest values in extensions/kiro.kiro-agent/package.json that carry no %key% indirection",
|
|
10
|
+
" (76 of 183 localizable manifest strings). Replaced structurally: only known",
|
|
11
|
+
" localizable fields are considered, so an English word here cannot leak into an id.",
|
|
12
|
+
" extension literals in dist/extension.js. Runtime strings that would be translatable through",
|
|
13
|
+
" vscode.l10n.t if Kiro called it. Keep these long and unambiguous.",
|
|
14
|
+
" webview literals in packages/*/dist/**/*.js - the React chat UI. Same rule.",
|
|
15
|
+
"",
|
|
16
|
+
"Rules: keep {0} placeholders, $(codicon) markers and (command:...) targets exactly as they are.",
|
|
17
|
+
"For extension/webview entries the English side must match the source byte for byte, including",
|
|
18
|
+
"punctuation, and must be specific enough not to appear anywhere else."
|
|
19
|
+
],
|
|
20
|
+
"version": "1.0.0",
|
|
21
|
+
|
|
22
|
+
"manifest": {
|
|
23
|
+
"Kiro": "Kiro",
|
|
24
|
+
"Kiro Agent": "Kiro",
|
|
25
|
+
"Context provider type": "上下文提供程式型別",
|
|
26
|
+
"Path segment in context provider": "上下文提供程式中的路徑片段",
|
|
27
|
+
"Delimiter in context provider syntax": "上下文提供程式語法中的分隔符",
|
|
28
|
+
"Kiro Experiments feature states": "Kiro 實驗功能的啟用狀態",
|
|
29
|
+
"Maximum time in milliseconds that a terminal command is allowed to run before it times out. When unset, commands use the built-in default timeout.": "終端命令在超時前允許執行的最長時間(毫秒)。未設定時,命令使用內建的預設超時。",
|
|
30
|
+
"**Deprecated.** Kiro now manages trust configuration with Trust v2. Your existing values have been migrated to `~/.kiro/settings/permissions.yaml`. Run **Kiro: Open Permissions (User)** or edit that file to change trust rules.": "**已棄用。** Kiro 現在通過 Trust v2 管理信任配置。你原有的值已遷移到 `~/.kiro/settings/permissions.yaml`。執行 **Kiro: 開啟權限配置 (使用者)** 或直接編輯該檔案來修改信任規則。",
|
|
31
|
+
"Collapse on Complete": "完成後摺疊",
|
|
32
|
+
"Always Expanded": "始終展開",
|
|
33
|
+
"Collapse a tool card automatically once it finishes (default).": "工具卡片執行完畢後自動摺疊(預設)。",
|
|
34
|
+
"Keep tool cards expanded after they complete or error.": "工具卡片完成或出錯後仍保持展開。",
|
|
35
|
+
"Controls how tool cards in the chat behave after a tool finishes. \"Collapse on Complete\" auto-collapses finished tool cards; \"Always Expanded\" leaves them open.": "控制聊天中的工具卡片在工具執行完畢後的行為。\"完成後摺疊\" 會自動摺疊已完成的卡片;\"始終展開\" 會保持其開啟。",
|
|
36
|
+
"Trust the exact command (e.g. `npm run test`).": "信任完全一致的命令(例如 `npm run test`)。",
|
|
37
|
+
"Trust the command and its first argument (e.g. `npm run *`).": "信任命令及其第一個引數(例如 `npm run *`)。",
|
|
38
|
+
"Trust the base command (e.g. `npm *`).": "信任基礎命令(例如 `npm *`)。",
|
|
39
|
+
"Pre-selected command pattern when you choose \"Always allow\"/\"Always deny\" for a shell command. Remembers your last choice; you can still change it per prompt.": "為某個 Shell 命令選擇 \"始終允許\" / \"始終拒絕\" 時預選的命令匹配範圍。會記住你上次的選擇,每次詢問時仍可更改。",
|
|
40
|
+
"All workspaces (persisted to your user permissions).": "所有工作區(寫入你的使用者權限配置)。",
|
|
41
|
+
"This workspace only.": "僅當前工作區。",
|
|
42
|
+
"This session only (not persisted to disk).": "僅當前會話(不寫入磁碟)。",
|
|
43
|
+
"Pre-selected scope when you choose \"Always allow\"/\"Always deny\". Remembers your last choice; you can still change it per prompt.": "選擇 \"始終允許\" / \"始終拒絕\" 時預選的生效範圍。會記住你上次的選擇,每次詢問時仍可更改。",
|
|
44
|
+
"Focus Chat Input": "聚焦聊天輸入框",
|
|
45
|
+
"Add Code Block to Chat": "將程式碼塊新增到聊天",
|
|
46
|
+
"Start New Chat Session": "開始新的聊天會話",
|
|
47
|
+
"Open Chat Session": "開啟聊天會話",
|
|
48
|
+
"Refresh Remote Tools": "重新整理遠端工具",
|
|
49
|
+
"Delete Account": "刪除賬戶",
|
|
50
|
+
"Create Debug Log Zip": "建立除錯日誌壓縮包",
|
|
51
|
+
"Delete Steering": "刪除指引文件",
|
|
52
|
+
"Delete Hook": "刪除鉤子",
|
|
53
|
+
"Delete Skill": "刪除技能",
|
|
54
|
+
"Refine": "完善",
|
|
55
|
+
"Previous document": "上一個文件",
|
|
56
|
+
"Next document": "下一個文件",
|
|
57
|
+
"Delete Spec": "刪除規格",
|
|
58
|
+
"Rename Spec": "重新命名規格",
|
|
59
|
+
"Retry": "重試",
|
|
60
|
+
"Ask Kiro": "詢問 Kiro",
|
|
61
|
+
"Reauthenticate": "重新認證",
|
|
62
|
+
"Reconnect": "重新連線",
|
|
63
|
+
"Disable": "停用",
|
|
64
|
+
"Show MCP Logs": "顯示 MCP 日誌",
|
|
65
|
+
"Test Tool": "測試工具",
|
|
66
|
+
"Enable": "啟用",
|
|
67
|
+
"Disable All Tools": "停用所有工具",
|
|
68
|
+
"Enable All Tools": "啟用所有工具",
|
|
69
|
+
"MCP: Disable All Servers": "MCP:停用所有伺服器",
|
|
70
|
+
"MCP: Enable All Servers": "MCP:啟用所有伺服器",
|
|
71
|
+
"Reset Approved MCP Environment Variables": "重置已批准的 MCP 環境變數",
|
|
72
|
+
"MCP: Install from Registry": "MCP:從登錄檔安裝",
|
|
73
|
+
"MCP: Reload Registry": "MCP:重新載入登錄檔",
|
|
74
|
+
"Generate Commit Message": "生成提交資訊",
|
|
75
|
+
"Show Account Dashboard": "顯示賬戶面板",
|
|
76
|
+
"Discuss": "討論",
|
|
77
|
+
"Next Chat Session Tab": "下一個聊天會話選項卡",
|
|
78
|
+
"Previous Chat Session Tab": "上一個聊天會話選項卡",
|
|
79
|
+
"Close Chat Session Tab": "關閉聊天會話選項卡",
|
|
80
|
+
"Find in Chat": "在聊天中查詢",
|
|
81
|
+
"Focus Migration Logs": "聚焦遷移日誌",
|
|
82
|
+
"Show Architectural Overview": "顯示架構總覽",
|
|
83
|
+
"Chat": "聊天",
|
|
84
|
+
"Powers": "能力",
|
|
85
|
+
"ACP Debug": "ACP 除錯",
|
|
86
|
+
"Specs": "規格",
|
|
87
|
+
"Safety Properties": "安全屬性",
|
|
88
|
+
"ACP Inspector": "ACP 檢查器",
|
|
89
|
+
"Open a project to start working with Kiro\n[Open Project](command:workbench.action.files.openFolder)": "開啟一個專案即可開始使用 Kiro\n[開啟專案](command:workbench.action.files.openFolder)",
|
|
90
|
+
"Open a project to start working with Kiro\n[Open Project](command:workbench.action.files.openFolderViaWorkspace)": "開啟一個專案即可開始使用 Kiro\n[開啟專案](command:workbench.action.files.openFolderViaWorkspace)",
|
|
91
|
+
"Create a project plan to develop complex features and services\n\n[$(add) Create New Spec](command:kiro.spec.explorerCreateSpec)": "建立專案計劃,用於開發複雜的功能與服務\n\n[$(add) 新建規格](command:kiro.spec.explorerCreateSpec)",
|
|
92
|
+
"Guide agent behavior and responses \n [Generate Steering Docs](command:kiro.steering.createInitialSteering)": "指引智慧體的行為與回覆 \n [生成指引文件](command:kiro.steering.createInitialSteering)",
|
|
93
|
+
"Automate tasks like documentation, code cleanup, or language localization\n\n[$(add) Create New Hook](command:kiroAgent.hooks.createNew)": "自動化文件編寫、程式碼清理、介面本地化等任務\n\n[$(add) 新建鉤子](command:kiroAgent.hooks.createNew)",
|
|
94
|
+
|
|
95
|
+
"Custom prompts for the Kiro editor context menu actions. Each value replaces the built-in prompt for that action.": "Kiro 編輯器右鍵選單動作的自定義提示。每一項都會替換該動作內建的提示。",
|
|
96
|
+
"Override the prompt used by the \"Fix Grammar / Spelling\" editor action.": "覆蓋 \"修正語法 / 拼寫\" 動作使用的提示。",
|
|
97
|
+
"Override the prompt used by the \"Write Comments for this Code\" editor action.": "覆蓋 \"為這段程式碼寫註釋\" 動作使用的提示。",
|
|
98
|
+
"Override the prompt used by the \"Write a Docstring for this Code\" editor action.": "覆蓋 \"為這段程式碼寫文件字串\" 動作使用的提示。",
|
|
99
|
+
"Override the prompt used by the \"Fix this Code\" editor action.": "覆蓋 \"修復這段程式碼\" 動作使用的提示。",
|
|
100
|
+
"Override the prompt used by the \"Optimize this Code\" editor action.": "覆蓋 \"最佳化這段程式碼\" 動作使用的提示。"
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
"extension": {
|
|
104
|
+
"Structured feature development": "按步驟做功能",
|
|
105
|
+
"Plan-only mode that helps break ideas down into an implementation plan without making any changes": "只做規劃的模式:把想法拆解成實施計劃,不做任何修改",
|
|
106
|
+
"Structured bug-fix workflow: investigate, diagnose, and resolve bugs": "按步驟修 Bug:排查、定位、修復",
|
|
107
|
+
"Fast spec workflow: clarify, then auto-generate requirements, design, and tasks": "快速 Spec 流程:先澄清,再自動生成需求、設計與任務"
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
"webview": {
|
|
111
|
+
"Let's build": "開始構建",
|
|
112
|
+
"New Workspace": "新建工作區",
|
|
113
|
+
"Plan, search, or build anything": "規劃、搜尋,或構建任何東西",
|
|
114
|
+
"I manage your workspaces, worktrees, and sessions. Try something like:": "我負責管理你的工作區、工作樹和會話。可以試試:",
|
|
115
|
+
"Start with a workflow": "選擇一個工作流",
|
|
116
|
+
"Autopilot ON: Kiro will make changes on your behalf.": "自動模式已開:Kiro 會直接代你修改。",
|
|
117
|
+
"Autopilot OFF: Kiro will ask for approval for making changes.": "自動模式已關:Kiro 修改前會先徵求你的同意。",
|
|
118
|
+
"View changes (": "檢視更改 (",
|
|
119
|
+
"Revert changes (": "撤銷更改 (",
|
|
120
|
+
"Reverting...": "正在撤銷...",
|
|
121
|
+
"files changed": "個檔案已更改",
|
|
122
|
+
"file changed": "個檔案已更改",
|
|
123
|
+
"See all": "檢視全部"
|
|
124
|
+
}
|
|
125
|
+
}
|