orca-zh-tw-installer 2.4.1 → 2.5.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/README.md +1 -6
- package/index.js +89 -1
- package/orca_zh_TW_translation.json +12 -1
- package/package.json +1 -1
- package/zh-TW-nested.cjs.js +20 -0
- package/zh-TW-nested.js +17 -0
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
[](https://nodejs.org)
|
|
12
12
|
[](#支援的作業系統)
|
|
13
13
|
[](LICENSE)
|
|
14
|
+
[](https://star-history.com/#Moksa1123/orca-zh-tw-installer&Date)
|
|
14
15
|
|
|
15
16
|
[快速開始](#快速開始) | [功能特色](#功能特色) | [支援系統](#支援的作業系統)
|
|
16
17
|
|
|
@@ -174,12 +175,6 @@ npm start
|
|
|
174
175
|
|
|
175
176
|
---
|
|
176
177
|
|
|
177
|
-
## Star 成長
|
|
178
|
-
|
|
179
|
-
[](https://star-history.com/#Moksa1123/orca-zh-tw-installer&Date)
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
178
|
## 免責聲明
|
|
184
179
|
|
|
185
180
|
此為非官方社群補丁,僅修改本地客戶端檔案。安裝過程會自動建立 `app.asar.bak` 備份檔,如遇應用程式異常,請自行還原備份檔案。
|
package/index.js
CHANGED
|
@@ -278,6 +278,69 @@ function patchSlashCommands(p, translateFn) {
|
|
|
278
278
|
+ `return ${translateFn}(${JSON.stringify(slashKey(en))}, ${JSON.stringify(en)}); }${s2}}`);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
+
// ── JSX 屬性裡寫死的字串 ───────────────────────────────────────────────
|
|
282
|
+
// 使用者回報原始碼控制的空狀態是英文:
|
|
283
|
+
//
|
|
284
|
+
// jsx(EmptyState, {
|
|
285
|
+
// heading: "No changes on this branch",
|
|
286
|
+
// supportingText: `This workspace is clean and this branch has no changes ahead of ${…}`
|
|
287
|
+
// })
|
|
288
|
+
//
|
|
289
|
+
// 這暴露了先前掃描的盲點——我只找雙引號字面值,反引號模板字串整類漏掉。
|
|
290
|
+
//
|
|
291
|
+
// 模板字串含插值,改寫時要把 ${expr} 轉成 i18next 的 {{name}} 佔位符,
|
|
292
|
+
// 並把原本的運算式搬到第三個參數。因為每處的運算式都不同,只能用
|
|
293
|
+
// 「完整字面值完全相符」逐句取代,不能用正則。
|
|
294
|
+
const JSX_HARDCODED = [
|
|
295
|
+
// ── 原始碼控制空狀態(使用者回報的那一處)──
|
|
296
|
+
['SourceControl', 'heading: "No changes on this branch"',
|
|
297
|
+
'heading: translate("sourceControl.noChangesHeading", "No changes on this branch")'],
|
|
298
|
+
['SourceControl',
|
|
299
|
+
'supportingText: `This workspace is clean and this branch has no changes ahead of ${branchSummary?.baseRef ?? "base"}`',
|
|
300
|
+
'supportingText: translate("sourceControl.noChangesDetail", '
|
|
301
|
+
+ '"This workspace is clean and this branch has no changes ahead of {{base}}", '
|
|
302
|
+
+ '{ base: branchSummary?.baseRef ?? "base" })'],
|
|
303
|
+
['SourceControl', 'heading: "No matching files"',
|
|
304
|
+
'heading: translate("sourceControl.noMatchingFilesHeading", "No matching files")'],
|
|
305
|
+
['SourceControl', 'supportingText: `No changed files match "${filterQuery}"`',
|
|
306
|
+
'supportingText: translate("sourceControl.noChangedFilesMatch", '
|
|
307
|
+
+ '"No changed files match \\"{{query}}\\"", { query: filterQuery })'],
|
|
308
|
+
['SourceControl', '"Operation in progress…"',
|
|
309
|
+
'translate("sourceControl.operationInProgress", "Operation in progress…")'],
|
|
310
|
+
['SourceControl', '`Abort the ${conflictOperation} in progress`',
|
|
311
|
+
'translate("sourceControl.abortConflictOperation", "Abort the {{operation}} in progress", '
|
|
312
|
+
+ '{ operation: conflictOperation })'],
|
|
313
|
+
['SourceControl', 'confirmLabel: `Abort ${label}`',
|
|
314
|
+
'confirmLabel: translate("sourceControl.abortConfirm", "Abort {{label}}", { label })'],
|
|
315
|
+
|
|
316
|
+
// ── 自動化排程描述。同一句英文出現兩次,插值運算式不同,故分開列 ──
|
|
317
|
+
['AutomationsPage', '`Hourly at :${String(schedule.minute).padStart(2, "0")}`',
|
|
318
|
+
'translate("automation.scheduleHourly", "Hourly at :{{minute}}", '
|
|
319
|
+
+ '{ minute: String(schedule.minute).padStart(2, "0") })'],
|
|
320
|
+
['AutomationsPage', '`Hourly at :${String(minute).padStart(2, "0")}`',
|
|
321
|
+
'translate("automation.scheduleHourly", "Hourly at :{{minute}}", '
|
|
322
|
+
+ '{ minute: String(minute).padStart(2, "0") })'],
|
|
323
|
+
['AutomationsPage', '`Daily at ${time}`',
|
|
324
|
+
'translate("automation.scheduleDaily", "Daily at {{time}}", { time })'],
|
|
325
|
+
['AutomationsPage', '`Weekdays at ${time}`',
|
|
326
|
+
'translate("automation.scheduleWeekdays", "Weekdays at {{time}}", { time })'],
|
|
327
|
+
|
|
328
|
+
// ── 新增 Agent 分頁的標題 ──
|
|
329
|
+
['I18nProvider', '`New ${TUI_AGENT_DISPLAY_NAMES[agent]} tab`',
|
|
330
|
+
'translate("tab.newAgentTab", "New {{agent}} tab", { agent: TUI_AGENT_DISPLAY_NAMES[agent] })'],
|
|
331
|
+
];
|
|
332
|
+
|
|
333
|
+
function patchJsxHardcoded(p, chunkTag) {
|
|
334
|
+
const items = JSX_HARDCODED.filter(x => x[0] === chunkTag);
|
|
335
|
+
for (const [, find, repl] of items) {
|
|
336
|
+
// 名稱取原文前 26 字,方便在輸出裡辨認是哪一句
|
|
337
|
+
const label = find.replace(/^[a-zA-Z]+:\s*/, '').slice(0, 26).replace(/\s+/g, ' ');
|
|
338
|
+
p.patchOptional(`寫死字串改走 i18n:${label}`,
|
|
339
|
+
c => c.includes(repl),
|
|
340
|
+
find, repl);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
281
344
|
function patchNativeMenus(p) {
|
|
282
345
|
p.patchOptional('原生選單:為無 label 的 role 注入譯文',
|
|
283
346
|
c => c.includes('nativeMenu.selectAll'),
|
|
@@ -403,6 +466,7 @@ async function patch() {
|
|
|
403
466
|
// main process 也有一份,但那份不用於顯示,動它只增加風險。
|
|
404
467
|
patchKeybindingTitles(rp, 'translate');
|
|
405
468
|
patchOptionLabels(rp, 'translate');
|
|
469
|
+
patchJsxHardcoded(rp, 'I18nProvider');
|
|
406
470
|
rp.save();
|
|
407
471
|
|
|
408
472
|
// Agent 斜線命令的說明在另一個 chunk。檔名帶 hash(index-DlEnJ7xL.js),
|
|
@@ -423,6 +487,29 @@ async function patch() {
|
|
|
423
487
|
console.log(' ⚠️ 找不到含 CODEX_COMMANDS 的 chunk,斜線命令說明將維持英文。');
|
|
424
488
|
}
|
|
425
489
|
|
|
490
|
+
// 原始碼控制空狀態與自動化排程描述各在自己的 chunk。
|
|
491
|
+
// 同樣靠內容找(檔名帶 hash),找不到就警告並繼續。
|
|
492
|
+
const extraPatchers = [];
|
|
493
|
+
for (const [tag, marker] of [
|
|
494
|
+
['SourceControl', 'No changes on this branch'],
|
|
495
|
+
['AutomationsPage', 'Weekdays at '],
|
|
496
|
+
]) {
|
|
497
|
+
const file = fs.readdirSync(assetsDir)
|
|
498
|
+
.filter(f => f.endsWith('.js') && f.startsWith(tag))
|
|
499
|
+
.map(f => path.join(assetsDir, f))
|
|
500
|
+
.find(f => {
|
|
501
|
+
try { return fs.readFileSync(f, 'utf8').includes(marker); } catch { return false; }
|
|
502
|
+
});
|
|
503
|
+
if (!file) {
|
|
504
|
+
console.log(` ⚠️ 找不到 ${tag} chunk,該部分字串將維持英文。`);
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
const xp = createPatcher(tag, file);
|
|
508
|
+
patchJsxHardcoded(xp, tag);
|
|
509
|
+
xp.save();
|
|
510
|
+
extraPatchers.push({ p: xp, file });
|
|
511
|
+
}
|
|
512
|
+
|
|
426
513
|
console.log('📂 4/6 正在植入繁體中文字典 (ESM + CJS 兩種格式)...');
|
|
427
514
|
const esmDict = path.join(__dirname, 'zh-TW-nested.js');
|
|
428
515
|
const cjsDict = path.join(__dirname, 'zh-TW-nested.cjs.js');
|
|
@@ -434,7 +521,7 @@ async function patch() {
|
|
|
434
521
|
fs.copyFileSync(cjsDict, path.join(chunksDir, 'zh-TW-nested.js'));
|
|
435
522
|
|
|
436
523
|
console.log('🔎 5/6 正在驗證所有注入點...');
|
|
437
|
-
const patchers =
|
|
524
|
+
const patchers = [mp, rp, ...(sp ? [sp] : []), ...extraPatchers.map(x => x.p)];
|
|
438
525
|
const allFailed = patchers.flatMap(p => p.failed.map(n => `[${p.label}] ${n}`));
|
|
439
526
|
const allWarned = patchers.flatMap(p => p.warned.map(n => `[${p.label}] ${n}`));
|
|
440
527
|
for (const p of patchers) {
|
|
@@ -465,6 +552,7 @@ async function patch() {
|
|
|
465
552
|
['renderer', rendererFile, '.mjs'],
|
|
466
553
|
];
|
|
467
554
|
if (slashFile) toCheck.push(['slash commands', slashFile, '.mjs']);
|
|
555
|
+
for (const x of extraPatchers) toCheck.push([x.p.label, x.file, '.mjs']);
|
|
468
556
|
for (const [label, file, ext] of toCheck) {
|
|
469
557
|
const probe = path.join(probeDir, 'probe' + ext);
|
|
470
558
|
fs.copyFileSync(file, probe);
|
|
@@ -11351,5 +11351,16 @@
|
|
|
11351
11351
|
"slashCommand.listBackgroundTerminals": "列出背景終端機",
|
|
11352
11352
|
"slashCommand.stopAllBackgroundTerminals": "停止所有背景終端機",
|
|
11353
11353
|
"slashCommand.clearTheTerminalAndStartANewChat": "清除終端機並開始新的聊天",
|
|
11354
|
-
"slashCommand.chooseACommunicationStyle": "選擇溝通風格"
|
|
11354
|
+
"slashCommand.chooseACommunicationStyle": "選擇溝通風格",
|
|
11355
|
+
"sourceControl.noChangesHeading": "此分支沒有變更",
|
|
11356
|
+
"sourceControl.noChangesDetail": "此工作區是乾淨的,且此分支沒有領先 {{base}} 的變更",
|
|
11357
|
+
"sourceControl.noMatchingFilesHeading": "沒有符合的檔案",
|
|
11358
|
+
"sourceControl.noChangedFilesMatch": "沒有變更的檔案符合「{{query}}」",
|
|
11359
|
+
"sourceControl.operationInProgress": "操作進行中…",
|
|
11360
|
+
"sourceControl.abortConflictOperation": "中止進行中的 {{operation}}",
|
|
11361
|
+
"sourceControl.abortConfirm": "中止 {{label}}",
|
|
11362
|
+
"automation.scheduleHourly": "每小時於 :{{minute}}",
|
|
11363
|
+
"automation.scheduleDaily": "每天於 {{time}}",
|
|
11364
|
+
"automation.scheduleWeekdays": "平日於 {{time}}",
|
|
11365
|
+
"tab.newAgentTab": "新增 {{agent}} 分頁"
|
|
11355
11366
|
}
|
package/package.json
CHANGED
package/zh-TW-nested.cjs.js
CHANGED
|
@@ -14091,6 +14091,23 @@ const zhTW = {
|
|
|
14091
14091
|
"stopAllBackgroundTerminals": "停止所有背景終端機",
|
|
14092
14092
|
"clearTheTerminalAndStartANewChat": "清除終端機並開始新的聊天",
|
|
14093
14093
|
"chooseACommunicationStyle": "選擇溝通風格"
|
|
14094
|
+
},
|
|
14095
|
+
"sourceControl": {
|
|
14096
|
+
"noChangesHeading": "此分支沒有變更",
|
|
14097
|
+
"noChangesDetail": "此工作區是乾淨的,且此分支沒有領先 {{base}} 的變更",
|
|
14098
|
+
"noMatchingFilesHeading": "沒有符合的檔案",
|
|
14099
|
+
"noChangedFilesMatch": "沒有變更的檔案符合「{{query}}」",
|
|
14100
|
+
"operationInProgress": "操作進行中…",
|
|
14101
|
+
"abortConflictOperation": "中止進行中的 {{operation}}",
|
|
14102
|
+
"abortConfirm": "中止 {{label}}"
|
|
14103
|
+
},
|
|
14104
|
+
"automation": {
|
|
14105
|
+
"scheduleHourly": "每小時於 :{{minute}}",
|
|
14106
|
+
"scheduleDaily": "每天於 {{time}}",
|
|
14107
|
+
"scheduleWeekdays": "平日於 {{time}}"
|
|
14108
|
+
},
|
|
14109
|
+
"tab": {
|
|
14110
|
+
"newAgentTab": "新增 {{agent}} 分頁"
|
|
14094
14111
|
}
|
|
14095
14112
|
};
|
|
14096
14113
|
exports.default = zhTW;
|
|
@@ -14109,3 +14126,6 @@ exports.keybindingGroup = zhTW.keybindingGroup;
|
|
|
14109
14126
|
exports.keybinding = zhTW.keybinding;
|
|
14110
14127
|
exports.optionLabel = zhTW.optionLabel;
|
|
14111
14128
|
exports.slashCommand = zhTW.slashCommand;
|
|
14129
|
+
exports.sourceControl = zhTW.sourceControl;
|
|
14130
|
+
exports.automation = zhTW.automation;
|
|
14131
|
+
exports.tab = zhTW.tab;
|
package/zh-TW-nested.js
CHANGED
|
@@ -14089,5 +14089,22 @@ export default {
|
|
|
14089
14089
|
"stopAllBackgroundTerminals": "停止所有背景終端機",
|
|
14090
14090
|
"clearTheTerminalAndStartANewChat": "清除終端機並開始新的聊天",
|
|
14091
14091
|
"chooseACommunicationStyle": "選擇溝通風格"
|
|
14092
|
+
},
|
|
14093
|
+
"sourceControl": {
|
|
14094
|
+
"noChangesHeading": "此分支沒有變更",
|
|
14095
|
+
"noChangesDetail": "此工作區是乾淨的,且此分支沒有領先 {{base}} 的變更",
|
|
14096
|
+
"noMatchingFilesHeading": "沒有符合的檔案",
|
|
14097
|
+
"noChangedFilesMatch": "沒有變更的檔案符合「{{query}}」",
|
|
14098
|
+
"operationInProgress": "操作進行中…",
|
|
14099
|
+
"abortConflictOperation": "中止進行中的 {{operation}}",
|
|
14100
|
+
"abortConfirm": "中止 {{label}}"
|
|
14101
|
+
},
|
|
14102
|
+
"automation": {
|
|
14103
|
+
"scheduleHourly": "每小時於 :{{minute}}",
|
|
14104
|
+
"scheduleDaily": "每天於 {{time}}",
|
|
14105
|
+
"scheduleWeekdays": "平日於 {{time}}"
|
|
14106
|
+
},
|
|
14107
|
+
"tab": {
|
|
14108
|
+
"newAgentTab": "新增 {{agent}} 分頁"
|
|
14092
14109
|
}
|
|
14093
14110
|
};
|