cc-pets 2.1.2 → 2.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/CHANGELOG.zh-CN.md +17 -0
  3. package/CONTRIBUTING.md +54 -0
  4. package/CONTRIBUTING.zh-CN.md +45 -0
  5. package/README.md +31 -26
  6. package/README.zh-CN.md +22 -16
  7. package/Resources/Info.plist +3 -1
  8. package/Resources/en.lproj/InfoPlist.strings +1 -0
  9. package/Resources/phrases.default.en.txt +182 -0
  10. package/Resources/zh-Hans.lproj/InfoPlist.strings +1 -0
  11. package/Resources/zh-Hans.lproj/Localizable.strings +332 -0
  12. package/Sources/CCPets/CCPetsAppDelegate+AgentStatus.m +28 -28
  13. package/Sources/CCPets/CCPetsAppDelegate+Bridge.m +16 -14
  14. package/Sources/CCPets/CCPetsAppDelegate+Pets.m +7 -9
  15. package/Sources/CCPets/CCPetsAppDelegate+Private.h +3 -0
  16. package/Sources/CCPets/CCPetsAppDelegate+Settings.m +25 -4
  17. package/Sources/CCPets/CCPetsAppDelegate+Speech.m +1 -1
  18. package/Sources/CCPets/CCPetsAppDelegate+Update.m +36 -35
  19. package/Sources/CCPets/CCPetsAppDelegate.m +20 -14
  20. package/Sources/CCPets/CCPetsCleanup.m +9 -6
  21. package/Sources/CCPets/CCPetsEvents.m +4 -3
  22. package/Sources/CCPets/CCPetsL10n.h +55 -0
  23. package/Sources/CCPets/CCPetsL10n.m +219 -0
  24. package/Sources/CCPets/CCPetsPhrases.h +7 -1
  25. package/Sources/CCPets/CCPetsPhrases.m +86 -31
  26. package/Sources/CCPets/CCPetsPhrasesEditor.m +62 -64
  27. package/Sources/CCPets/CCPetsPreviews.m +7 -6
  28. package/Sources/CCPets/CCPetsVersion.h +7 -4
  29. package/Sources/CCPets/CCPetsVersion.m +14 -6
  30. package/Sources/CCPets/MenuToggleSwitch.m +3 -2
  31. package/Sources/CCPets/PetView.m +103 -74
  32. package/Sources/CCPets/QuotaDashboardView.m +122 -85
  33. package/Sources/CCPets/main.m +3 -1
  34. package/bin/cc-pets +21 -22
  35. package/bin/claude-with-pet +2 -1
  36. package/bin/codex-with-pet +2 -1
  37. package/package.json +3 -2
  38. package/scripts/bridge/cli.mjs +39 -38
  39. package/scripts/bridge/core.mjs +27 -26
  40. package/scripts/bridge/hook.mjs +7 -6
  41. package/scripts/bridge/install.mjs +24 -23
  42. package/scripts/bridge/mcp-server.mjs +79 -71
  43. package/scripts/bridge/options.mjs +7 -6
  44. package/scripts/bridge/reservations.mjs +6 -5
  45. package/scripts/bridge/store.mjs +10 -9
  46. package/scripts/build.sh +24 -5
  47. package/scripts/check-l10n.mjs +168 -0
  48. package/scripts/configure-updater.mjs +4 -3
  49. package/scripts/doctor.mjs +93 -79
  50. package/scripts/i18n.mjs +122 -0
  51. package/scripts/i18n.zsh +66 -0
  52. package/scripts/install-app.sh +3 -2
  53. package/scripts/install-claude-hooks.mjs +10 -9
  54. package/scripts/install-codex-hooks.mjs +7 -6
  55. package/scripts/install-shell-integration.sh +6 -5
  56. package/scripts/locales/zh-Hans.json +366 -0
  57. package/scripts/pet-store.mjs +45 -44
  58. package/scripts/uninstall-app.sh +4 -3
  59. package/scripts/uninstall-integrations.mjs +8 -7
  60. package/scripts/uninstall-shell-integration.sh +8 -7
  61. /package/Resources/{phrases.default.txt → phrases.default.zh-Hans.txt} +0 -0
@@ -11,6 +11,7 @@
11
11
  import fs from "node:fs";
12
12
  import os from "node:os";
13
13
  import path from "node:path";
14
+ import { t } from "./i18n.mjs";
14
15
 
15
16
  // 一个源的完整定义就是这几项。以后接自建 registry 时在这里加一行即可,
16
17
  // 命令、目录结构和桌宠端都不用动。
@@ -40,7 +41,7 @@ const USER_AGENT = (() => {
40
41
  })();
41
42
 
42
43
  // 不能 add、只会出现在已装素材里的来源。桌宠的"导入 Codex 素材"开关会写 source: "codex"。
43
- const LOCAL_SOURCE_LABELS = { codex: "Codex(导入)" };
44
+ const LOCAL_SOURCE_LABELS = { codex: t("Codex (imported)") };
44
45
  const DEFAULT_SOURCE = process.env.CC_PETS_SOURCE || "petdex";
45
46
  const SIDECAR_NAME = ".source.json";
46
47
  const MANIFEST_TTL_MS = 6 * 60 * 60 * 1000;
@@ -86,7 +87,7 @@ function parseSpec(spec) {
86
87
  const source = spec.slice(0, separator);
87
88
  const slug = spec.slice(separator + 1);
88
89
  if (!SOURCES[source]) {
89
- fail(`未知的素材源 "${source}"。可用的源: ${Object.keys(SOURCES).join(", ")}`);
90
+ fail(t('Unknown pet source "{source}". Available sources: {SOURCES}', { source, SOURCES: Object.keys(SOURCES).join(", ") }));
90
91
  }
91
92
  return { source, slug };
92
93
  }
@@ -108,9 +109,9 @@ async function fetchManifest(sourceName, { refresh }) {
108
109
  redirect: "follow",
109
110
  headers: { "User-Agent": USER_AGENT }
110
111
  });
111
- if (!response.ok) fail(`拉取 ${SOURCES[sourceName].label} 素材清单失败: HTTP ${response.status}`);
112
+ if (!response.ok) fail(t("Failed to fetch the {label} pet list: HTTP {status}", { label: SOURCES[sourceName].label, status: response.status }));
112
113
  const body = await response.json();
113
- if (!Array.isArray(body?.pets)) fail(`${SOURCES[sourceName].label} 素材清单格式不符合预期`);
114
+ if (!Array.isArray(body?.pets)) fail(t("The {label} pet list has an unexpected format", { label: SOURCES[sourceName].label }));
114
115
  fs.mkdirSync(path.dirname(cache), { recursive: true });
115
116
  fs.writeFileSync(cache, JSON.stringify(body));
116
117
  return body.pets;
@@ -121,15 +122,15 @@ async function download(url, source) {
121
122
  try {
122
123
  parsed = new URL(url);
123
124
  } catch {
124
- throw new Error(`非法的素材地址: ${url}`);
125
+ throw new Error(t("Invalid pet URL: {url}", { url }));
125
126
  }
126
127
  if (parsed.protocol !== "https:" || !source.assetHosts.includes(parsed.hostname)) {
127
- throw new Error(`不受信任的素材来源: ${parsed.hostname || url}`);
128
+ throw new Error(t("Untrusted pet source: {url}", { url: parsed.hostname || url }));
128
129
  }
129
130
  const response = await fetch(parsed, {
130
131
  headers: { Referer: source.referer, "User-Agent": USER_AGENT }
131
132
  });
132
- if (!response.ok) throw new Error(`下载失败 ${parsed.pathname} -> HTTP ${response.status}`);
133
+ if (!response.ok) throw new Error(t("Download failed {pathname} -> HTTP {status}", { pathname: parsed.pathname, status: response.status }));
133
134
  return Buffer.from(await response.arrayBuffer());
134
135
  }
135
136
 
@@ -147,16 +148,16 @@ function assertInstallable(directory, sourceName, localName) {
147
148
  if (!fs.existsSync(directory)) return;
148
149
  const sidecar = readSidecar(directory);
149
150
  if (sidecar?.source === sourceName) return;
150
- const owner = sidecar ? `来自 ${sidecar.source}` : "不是 cc-pets pet 装的(没有来源记录)";
151
+ const owner = sidecar ? t("came from {source}", { source: sidecar.source }) : t("wasn't installed by cc-pets pet (no source record)");
151
152
  throw new Error(
152
- `${localName} 已存在且${owner}。换个名字装: ` +
153
+ t("{localName} already exists and {owner}. Install it under another name: ", { localName, owner }) +
153
154
  `cc-pets pet add ${sourceName}:${localName} --as ${localName}-${sourceName}`
154
155
  );
155
156
  }
156
157
 
157
158
  async function installPet(pet, sourceName, localName) {
158
159
  const source = SOURCES[sourceName];
159
- if (!isSafeSlug(pet.slug)) throw new Error(`素材名不合法: ${pet.slug}`);
160
+ if (!isSafeSlug(pet.slug)) throw new Error(t("Invalid pet name: {slug}", { slug: pet.slug }));
160
161
  const directory = path.join(petsRoot(), localName);
161
162
  assertInstallable(directory, sourceName, localName);
162
163
 
@@ -201,16 +202,16 @@ async function commandAdd(args) {
201
202
  const refresh = args.includes("--refresh");
202
203
  const asIndex = args.indexOf("--as");
203
204
  const alias = asIndex === -1 ? null : args[asIndex + 1];
204
- if (asIndex !== -1 && (!alias || alias.startsWith("--"))) fail("--as 后面要跟一个名字。");
205
- if (alias && !isSafeLocalName(alias)) fail(`--as 的名字不合法: ${alias}`);
205
+ if (asIndex !== -1 && (!alias || alias.startsWith("--"))) fail(t("--as needs a name after it."));
206
+ if (alias && !isSafeLocalName(alias)) fail(t("Invalid --as name: {alias}", { alias }));
206
207
 
207
208
  // asIndex 为 -1 时 asIndex + 1 是 0,会把第一个位置参数当成 --as 的取值吃掉。
208
209
  const aliasValueIndex = asIndex === -1 ? -1 : asIndex + 1;
209
210
  const positional = args.filter(
210
211
  (value, index) => !value.startsWith("--") && index !== aliasValueIndex);
211
212
  const specs = [...new Set(positional)];
212
- if (specs.length === 0) fail(`用法: ${cyan("cc-pets pet add [源:]<名称> [名称...] [--as <本地名>]")}`);
213
- if (alias && specs.length > 1) fail("--as 一次只能给一个素材改名。");
213
+ if (specs.length === 0) fail(t("Usage: {cyan}", { cyan: cyan(t("cc-pets pet add [source:]<name> [name...] [--as <local-name>]")) }));
214
+ if (alias && specs.length > 1) fail(t("--as can only rename one pet at a time."));
214
215
 
215
216
  // 按源分组,同一个源只拉一次清单。
216
217
  const wanted = specs.map(parseSpec);
@@ -229,7 +230,7 @@ async function commandAdd(args) {
229
230
  const pet = index.get(slug);
230
231
  if (!pet) {
231
232
  failed += 1;
232
- console.error(`${red("×")} ${sourceName}:${slug}: 清单里没有这个素材`);
233
+ console.error(t("{red} {sourceName}:{slug}: not in the pet list", { red: red("×"), sourceName, slug }));
233
234
  continue;
234
235
  }
235
236
  const localName = alias ?? slug;
@@ -246,8 +247,8 @@ async function commandAdd(args) {
246
247
  }
247
248
 
248
249
  if (installed > 0) {
249
- console.log(dim(`素材目录: ${petsRoot()}`));
250
- console.log(dim("桌宠菜单里点“重新扫描”或重启桌宠即可看到新素材。"));
250
+ console.log(dim(t("Pets directory: {petsRoot}", { petsRoot: petsRoot() })));
251
+ console.log(dim(t("Click “Rescan” in the pet menu or restart the pet to see new pets.")));
251
252
  }
252
253
  if (failed > 0) process.exit(1);
253
254
  }
@@ -267,23 +268,23 @@ async function commandSearch(args) {
267
268
  ? pets
268
269
  : pets.filter((pet) =>
269
270
  `${pet.slug} ${pet.displayName ?? ""} ${pet.submittedBy ?? ""}`.toLowerCase().includes(keyword));
270
- if (matched.length === 0) fail(`${SOURCES[sourceName].label} 上没有匹配 "${keyword}" 的素材。`);
271
+ if (matched.length === 0) fail(t('No pets on {label} match "{keyword}".', { label: SOURCES[sourceName].label, keyword }));
271
272
  const shown = matched.slice(0, 60);
272
273
  for (const pet of shown) {
273
274
  const author = pet.submittedBy ? dim(` by ${pet.submittedBy}`) : "";
274
275
  console.log(` ${cyan(pet.slug)} ${pet.displayName ?? ""}${author}`);
275
276
  }
276
277
  if (matched.length > shown.length) {
277
- console.log(dim(` … 共 ${matched.length} 个结果,只显示前 ${shown.length} 个。`));
278
+ console.log(dim(t(" … {length} results, showing the first {shown}.", { length: matched.length, shown: shown.length })));
278
279
  }
279
- console.log(dim(`装上其中一个: cc-pets pet add ${sourceName}:${shown[0].slug}`));
280
+ console.log(dim(t("Install one: cc-pets pet add {sourceName}:{slug}", { sourceName, slug: shown[0].slug })));
280
281
  }
281
282
 
282
283
  function commandList() {
283
284
  const pets = installedPets();
284
285
  if (pets.length === 0) {
285
- console.log(dim(`${petsRoot()} 里还没有素材。`));
286
- console.log(dim("试试: cc-pets pet add boba"));
286
+ console.log(dim(t("No pets in {petsRoot} yet.", { petsRoot: petsRoot() })));
287
+ console.log(dim(t("Try: cc-pets pet add boba")));
287
288
  return;
288
289
  }
289
290
  const groups = new Map();
@@ -300,7 +301,7 @@ function commandList() {
300
301
  });
301
302
  for (const key of keys) {
302
303
  const label = key === "__unknown__"
303
- ? "本地素材(无来源记录)"
304
+ ? t("Local pets (no source record)")
304
305
  : SOURCES[key]?.label ?? LOCAL_SOURCE_LABELS[key] ?? key;
305
306
  console.log(` ${label}`);
306
307
  for (const pet of groups.get(key)) {
@@ -309,38 +310,38 @@ function commandList() {
309
310
  console.log(` ${cyan(pet.name)}${origin}`);
310
311
  }
311
312
  }
312
- console.log(dim(`共 ${pets.length} 个,位于 ${petsRoot()}`));
313
+ console.log(dim(t("{length} in total, in {petsRoot}", { length: pets.length, petsRoot: petsRoot() })));
313
314
  }
314
315
 
315
316
  function commandRemove(args) {
316
317
  const names = args.filter((value) => !value.startsWith("--"));
317
- if (names.length === 0) fail(`用法: ${cyan("cc-pets pet remove <名称> [名称...]")}`);
318
+ if (names.length === 0) fail(t("Usage: {cyan}", { cyan: cyan(t("cc-pets pet remove <name> [name...]")) }));
318
319
  const root = petsRoot();
319
320
  let removed = 0;
320
321
  for (const name of names) {
321
322
  if (!isSafeLocalName(name)) {
322
- console.error(`${red("×")} ${name}: 名称不合法`);
323
+ console.error(t("{red} {name}: invalid name", { red: red("×"), name }));
323
324
  continue;
324
325
  }
325
326
  const directory = path.join(root, name);
326
327
  if (!fs.existsSync(directory)) {
327
- console.error(`${red("×")} ${name}: 没有安装`);
328
+ console.error(t("{red} {name}: not installed", { red: red("×"), name }));
328
329
  continue;
329
330
  }
330
331
  const sidecar = readSidecar(directory);
331
332
  fs.rmSync(directory, { recursive: true, force: true });
332
333
  removed += 1;
333
- console.log(`${green("✓")} 已删除 ${name}${sidecar ? dim(` (来自 ${sidecar.source})`) : ""}`);
334
+ console.log(t("{green} Removed {name}{source}", { green: green("✓"), name, source: sidecar ? dim(t(" (from {source})", { source: sidecar.source })) : "" }));
334
335
  }
335
336
  if (removed < names.length) process.exit(1);
336
337
  }
337
338
 
338
339
  function commandSource() {
339
340
  for (const [name, source] of Object.entries(SOURCES)) {
340
- const marker = name === DEFAULT_SOURCE ? green(" (默认)") : "";
341
+ const marker = name === DEFAULT_SOURCE ? green(t(" (default)")) : "";
341
342
  console.log(` ${cyan(name)}${marker} ${source.label} ${dim(source.homepage)}`);
342
343
  }
343
- console.log(dim("用 CC_PETS_SOURCE 换默认源,或在名称前加 `源:` 前缀。"));
344
+ console.log(dim(t("Change the default source with CC_PETS_SOURCE, or prefix a name with `source:`.")));
344
345
  }
345
346
 
346
347
  function commandDir() {
@@ -352,31 +353,31 @@ function commandDir() {
352
353
  function usage() {
353
354
  console.log([
354
355
  "",
355
- ` ${cyan("cc-pets pet")} — 把素材装进 cc-pets 自己的目录`,
356
+ t(" {cyan} — install pets into cc-pets' own directory", { cyan: cyan("cc-pets pet") }),
356
357
  "",
357
- ` ${cyan("add")} [源:]<名称>... 下载素材到 ${dim(petsRoot())}`,
358
- ` ${cyan("search")} [源:][关键词] 搜索可用素材(不带关键词就列全部)`,
359
- ` ${cyan("list")} 列出已安装的素材,按来源分组`,
360
- ` ${cyan("remove")} <名称>... 删除已安装的素材`,
361
- ` ${cyan("source")} 列出可用的素材源`,
362
- ` ${cyan("dir")} 打印素材目录路径`,
358
+ t(" {cyan} [source:]<name>... download pets to {petsRoot}", { cyan: cyan("add"), petsRoot: dim(petsRoot()) }),
359
+ t(" {cyan} [source:][keyword] search pets (no keyword lists all)", { cyan: cyan("search") }),
360
+ t(" {cyan} list installed pets, grouped by source", { cyan: cyan("list") }),
361
+ t(" {cyan} <name>... remove installed pets", { cyan: cyan("remove") }),
362
+ t(" {cyan} list available sources", { cyan: cyan("source") }),
363
+ t(" {cyan} print the pets directory", { cyan: cyan("dir") }),
363
364
  "",
364
- ` ${dim("名称可以带源前缀(petdex:boba);不带就用默认源 " + DEFAULT_SOURCE + "。")}`,
365
- ` ${dim("--as <本地名> 换个目录名安装,支持中文,用来避开同名素材的冲突。")}`,
366
- ` ${dim("--refresh 强制刷新素材清单缓存(默认缓存 6 小时)。")}`,
367
- ` ${dim("CC_PETS_PETS_DIR 换素材目录,CC_PETS_SOURCE 换默认源。")}`,
365
+ ` ${dim(t("Names can have a source prefix (petdex:boba); otherwise the default source is used: ") + DEFAULT_SOURCE + t("."))}`,
366
+ ` ${dim(t("--as <local-name> installs under another directory name (any language) to avoid name clashes."))}`,
367
+ ` ${dim(t("--refresh forces a refresh of the pet list cache (cached for 6 hours by default)."))}`,
368
+ ` ${dim(t("CC_PETS_PETS_DIR changes the pets directory; CC_PETS_SOURCE changes the default source."))}`,
368
369
  "",
369
370
  ` ${dim("$")} cc-pets pet search otter`,
370
371
  ` ${dim("$")} cc-pets pet add boba`,
371
372
  ` ${dim("$")} cc-pets pet add petdex:boba --as boba-petdex`,
372
- ` ${dim("$")} cc-pets pet add boba --as 波霸`,
373
+ t(" {dim} cc-pets pet add boba --as bubble-tea", { dim: dim("$") }),
373
374
  ""
374
375
  ].join("\n"));
375
376
  }
376
377
 
377
378
  const [command, ...args] = process.argv.slice(2);
378
379
  if (!SOURCES[DEFAULT_SOURCE]) {
379
- fail(`CC_PETS_SOURCE 指向未知的源 "${DEFAULT_SOURCE}"。可用的源: ${Object.keys(SOURCES).join(", ")}`);
380
+ fail(t('CC_PETS_SOURCE points to an unknown source "{DEFAULT_SOURCE}". Available sources: {SOURCES}', { DEFAULT_SOURCE, SOURCES: Object.keys(SOURCES).join(", ") }));
380
381
  }
381
382
  switch (command) {
382
383
  case "add":
@@ -408,7 +409,7 @@ switch (command) {
408
409
  usage();
409
410
  break;
410
411
  default:
411
- console.error(red(`未知子命令: ${command}`));
412
+ console.error(red(t("Unknown subcommand: {command}", { command })));
412
413
  usage();
413
414
  process.exit(2);
414
415
  }
@@ -1,5 +1,6 @@
1
1
  #!/bin/zsh
2
2
  set -eu
3
+ source "${0:A:h}/i18n.zsh"
3
4
 
4
5
  APPLICATIONS_DIR="${CC_PETS_APPLICATIONS_DIR:-${HOME}/Applications}"
5
6
  TARGET_APP="${APPLICATIONS_DIR}/CC Pets.app"
@@ -9,7 +10,7 @@ if [[ -e "${TARGET_APP}" ]]; then
9
10
  BUNDLE_ID="$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' \
10
11
  "${TARGET_APP}/Contents/Info.plist" 2>/dev/null || true)"
11
12
  if [[ "${BUNDLE_ID}" != "com.universewang.cc-pets" ]]; then
12
- print -u2 "拒绝删除:${TARGET_APP} 不是 CC Pets 应用(Bundle ID 不匹配)。"
13
+ print -u2 "$(cc_pets_t "Refusing to delete: {targetApp} isn't the CC Pets app (bundle ID mismatch)." targetApp="${TARGET_APP}")"
13
14
  exit 2
14
15
  fi
15
16
  fi
@@ -20,7 +21,7 @@ fi
20
21
 
21
22
  if [[ -e "${TARGET_APP}" ]]; then
22
23
  rm -rf "${TARGET_APP}"
23
- print "已删除应用: ${TARGET_APP}"
24
+ print "$(cc_pets_t "App removed: {targetApp}" targetApp="${TARGET_APP}")"
24
25
  else
25
- print "未安装应用: ${TARGET_APP}"
26
+ print "$(cc_pets_t "App not installed: {targetApp}" targetApp="${TARGET_APP}")"
26
27
  fi
@@ -9,6 +9,7 @@ import {
9
9
  STATUS_LINE_MARKER, STATUS_LINE_START_MARKER, isManagedHookCommand, isManagedStatusLine,
10
10
  resolveStatusLineScript
11
11
  } from "./integration-markers.mjs";
12
+ import { t } from "./i18n.mjs";
12
13
 
13
14
  const codexHome = process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
14
15
  const claudeHome = process.env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), ".claude");
@@ -85,7 +86,7 @@ function updateJSON(filePath, updater) {
85
86
  try {
86
87
  config = JSON.parse(fs.readFileSync(filePath, "utf8"));
87
88
  } catch (error) {
88
- console.error(`无法解析 ${filePath},未做修改: ${error.message}`);
89
+ console.error(t("Can't parse {filePath}, left unchanged: {message}", { filePath, message: error.message }));
89
90
  process.exitCode = 1;
90
91
  return false;
91
92
  }
@@ -194,11 +195,11 @@ if (!preparingInstall) {
194
195
  bridgeStore.setBridgeEnabled(false);
195
196
  }
196
197
 
197
- const action = preparingInstall ? "已迁移" : "已移除";
198
- if (codexChanged) console.log(`${action} ${codexHooksPath} 中的 CC Pets Hooks。`);
199
- if (claudeChanged) console.log(`${action} ${claudeSettingsPath} 中的 CC Pets Hooks,并恢复原 status line。`);
200
- if (shellChanged) console.log(`${action} ${shellRC} 中的 CC Pets shell 集成。`);
201
- if (shimChanged) console.log(`${action} ${shimDirectory} 中的 codex / claude shim。`);
198
+ const action = preparingInstall ? t("Migrated") : t("Removed");
199
+ if (codexChanged) console.log(t("{action} the CC Pets hooks in {codexHooksPath}.", { action, codexHooksPath }));
200
+ if (claudeChanged) console.log(t("{action} the CC Pets hooks in {claudeSettingsPath} and restored the original status line.", { action, claudeSettingsPath }));
201
+ if (shellChanged) console.log(t("{action} the CC Pets shell integration in {shellRC}.", { action, shellRC }));
202
+ if (shimChanged) console.log(t("{action} the codex / claude shims in {shimDirectory}.", { action, shimDirectory }));
202
203
  if (!codexChanged && !claudeChanged && !shellChanged && !shimChanged && !preparingInstall) {
203
- console.log("未发现需要移除的 CC Pets 集成。 ");
204
+ console.log(t("No CC Pets integrations to remove. "));
204
205
  }
@@ -3,6 +3,7 @@ set -eu
3
3
 
4
4
  SCRIPT_DIR="${0:A:h}"
5
5
  PROJECT_DIR="${SCRIPT_DIR:h}"
6
+ source "${PROJECT_DIR}/scripts/i18n.zsh"
6
7
  SHELL_RC="${ZDOTDIR:-${HOME}}/.zshrc"
7
8
  PET_BIN="${PROJECT_DIR}/.build/release/cc-pets"
8
9
  PET_APP_EXECUTABLE="${PROJECT_DIR}/.build/release/CC Pets.app/Contents/MacOS/cc-pets"
@@ -18,12 +19,12 @@ done
18
19
 
19
20
  if (( PURGE && ! ASSUME_YES )); then
20
21
  if [[ ! -t 0 ]]; then
21
- print -u2 "完整卸载会删除应用、额度历史、更新配置、日志和偏好(保留 ~/.cc-pets 的素材与台词)。非交互环境请显式添加 --yes。"
22
+ print -u2 "$(cc_pets_t "A full uninstall removes the app, quota history, updater config, logs and preferences (keeping pets and lines in ~/.cc-pets). Add --yes when running non-interactively.")"
22
23
  exit 2
23
24
  fi
24
- print -u2 "完整卸载会永久删除 CC Pets 应用、额度历史、更新配置、日志和偏好;~/.cc-pets 下的桌宠素材与台词会保留。是否继续?[y/N] "
25
+ print -u2 "$(cc_pets_t "A full uninstall permanently removes the CC Pets app, quota history, updater config, logs and preferences; pets and lines in ~/.cc-pets are kept. Continue? [y/N] ")"
25
26
  if ! read -r reply || [[ "${reply:l}" != "y" && "${reply:l}" != "yes" ]]; then
26
- print "已取消完整卸载。"
27
+ print "$(cc_pets_t "Full uninstall canceled.")"
27
28
  exit 0
28
29
  fi
29
30
  fi
@@ -46,7 +47,7 @@ if [[ "${CC_PETS_SKIP_APP_STOP:-0}" != "1" ]]; then
46
47
  sleep 0.1
47
48
  done
48
49
  if (( running != 0 )); then
49
- print -u2 "完整卸载失败:CC Pets 未能退出,尚未删除集成或本地数据。"
50
+ print -u2 "$(cc_pets_t "Full uninstall failed: CC Pets didn't quit, so no integrations or local data were removed.")"
50
51
  exit 1
51
52
  fi
52
53
  fi
@@ -56,13 +57,13 @@ node "${PROJECT_DIR}/scripts/uninstall-integrations.mjs" "${SHELL_RC}"
56
57
 
57
58
  if (( PURGE )); then
58
59
  if [[ ! -x "${PET_BIN}" ]]; then
59
- print -u2 "完整卸载失败:找不到 ${PET_BIN},本地数据尚未删除。"
60
+ print -u2 "$(cc_pets_t "Full uninstall failed: {petBin} not found, so local data wasn't removed." petBin="${PET_BIN}")"
60
61
  exit 1
61
62
  fi
62
63
  "${PET_BIN}" --purge-data
63
64
  CC_PETS_SKIP_APP_STOP=1 "${PROJECT_DIR}/scripts/uninstall-app.sh"
64
- print "完整卸载完成;桌宠素材与台词保留在 ~/.cc-pets,不再需要可手动删除。npm 包本身如仍存在,可继续执行 npm uninstall -g cc-pets。"
65
+ print "$(cc_pets_t "Full uninstall done. Pets and lines remain in ~/.cc-pets; delete them manually if you no longer need them. If the npm package is still installed, run npm uninstall -g cc-pets.")"
65
66
  exit 0
66
67
  fi
67
68
 
68
- print "卸载集成完成。执行 source ${(q)SHELL_RC} 更新当前终端;如需删除 npm 包,再执行 npm uninstall -g cc-pets。"
69
+ print "$(cc_pets_t "Integrations removed. Run source {shellRc} to update this terminal; to remove the npm package, run npm uninstall -g cc-pets." shellRc="${(q)SHELL_RC}")"