feat(installer): add --locale flag for translated docs installation

Adds `--locale <code>` support to the ECC installer so users can install
localized reference docs (agents, commands, skills, rules) into
`~/.claude/docs/<locale>/` alongside the existing English installation.

Changes:
- manifests/install-modules.json: add 8 locale doc modules (docs-ja-JP,
  docs-zh-CN, docs-ko-KR, docs-pt-BR, docs-ru, docs-tr, docs-vi-VN,
  docs-zh-TW), each with kind="docs" and defaultInstall=false
- manifests/install-components.json: add 8 locale: components mapping to
  the new modules
- scripts/lib/install-manifests.js: add locale: family prefix,
  SUPPORTED_LOCALES, LOCALE_ALIAS_TO_COMPONENT_ID (with aliases like
  ja=ja-JP, zh=zh-CN, ko=ko-KR), and listSupportedLocales()
- scripts/lib/install/request.js: add --locale flag to parseInstallArgs(),
  resolve locale alias → component ID in normalizeInstallRequest(), throw
  on unsupported locale codes
- scripts/lib/install-targets/claude-home.js: map docs/<locale>/ source
  paths to ~/.claude/docs/<locale>/ destination (side-by-side, no overwrite
  of English files)
- scripts/install-apply.js: import listSupportedLocales, add --locale
  usage line and available locales list to --help output

Usage examples:
  ./install.sh --locale ja                    # Japanese docs only
  ./install.sh --profile core --locale zh-CN  # core profile + zh-CN docs
  ./install.sh typescript --locale ja         # legacy + locale (errors)
This commit is contained in:
Claude
2026-05-18 07:57:10 +09:00
committed by Affaan Mustafa
parent 519c592a12
commit 71aedad889
6 changed files with 234 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ const os = require('os');
const {
SUPPORTED_INSTALL_TARGETS,
listLegacyCompatibilityLanguages,
listSupportedLocales,
} = require('./lib/install-manifests');
const {
LEGACY_INSTALL_TARGETS,
@@ -19,12 +20,14 @@ const {
function getHelpText() {
const languages = listLegacyCompatibilityLanguages();
const locales = listSupportedLocales();
return `
Usage: install.sh [--target <${LEGACY_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] <language> [<language> ...]
install.sh [--target <${SUPPORTED_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] --profile <name> [--with <component>]... [--without <component>]...
install.sh [--target <${SUPPORTED_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] --modules <id,id,...> [--with <component>]... [--without <component>]...
install.sh [--target <${SUPPORTED_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] --skills <skill-id[,skill-id...]>
install.sh [--target claude] [--dry-run] [--json] --locale <locale-code>
install.sh [--dry-run] [--json] --config <path>
Targets:
@@ -46,6 +49,8 @@ Options:
--skills <ids> Install one or more skill directories by ID, e.g. continuous-learning-v2
--without <component>
Exclude a user-facing install component
--locale <code> Install translated docs to ~/.claude/docs/<locale>/
(claude target only; can be combined with --profile or --with)
--config <path> Load install intent from ecc-install.json
--dry-run Show the install plan without copying files
--json Emit machine-readable plan/result JSON
@@ -53,6 +58,9 @@ Options:
Available languages:
${languages.map(language => ` - ${language}`).join('\n')}
Available locales (--locale):
${locales.map(locale => ` - ${locale}`).join('\n')}
`;
}