{"record":{"id":"295ead724ebf99d5","repo":"affaan-m/ECC","slug":"locale-can-only-be-used-with-target-claude-or","errorCode":null,"errorMessage":"--locale can only be used with --target claude or --target claude-project","messagePattern":"--locale can only be used with --target claude or --target claude-project","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install/request.js","lineNumber":111,"sourceCode":"\nfunction normalizeInstallRequest(options = {}) {\n  const config = options.config && typeof options.config === 'object'\n    ? options.config\n    : null;\n  const profileId = options.profileId || config?.profileId || null;\n  const target = options.target || config?.target || 'claude';\n  const moduleIds = validateInstallModuleIds(\n    dedupeStrings([...(config?.moduleIds || []), ...(options.moduleIds || [])])\n  );\n  const locale = options.locale || config?.locale || null;\n  const localeComponentId = locale ? LOCALE_ALIAS_TO_COMPONENT_ID[locale] : null;\n  if (locale && !localeComponentId) {\n    throw new Error(\n      `Unsupported locale: \"${locale}\". Supported locales: ${listSupportedLocales().join(', ')}`\n    );\n  }\n  if (locale && target !== 'claude' && target !== 'claude-project') {\n    throw new Error('--locale can only be used with --target claude or --target claude-project');\n  }\n  const requestedIncludeComponentIds = dedupeStrings([\n    ...(config?.includeComponentIds || []),\n    ...(options.includeComponentIds || []),\n  ]);\n  const includeComponentIds = dedupeStrings([\n    ...requestedIncludeComponentIds,\n    ...(localeComponentId ? [localeComponentId] : []),\n  ]);\n  const excludeComponentIds = dedupeStrings([\n    ...(config?.excludeComponentIds || []),\n    ...(options.excludeComponentIds || []),\n  ]);\n  const legacyLanguages = dedupeStrings(dedupeStrings([\n    ...(Array.isArray(options.legacyLanguages) ? options.legacyLanguages : []),\n    ...(Array.isArray(options.languages) ? options.languages : []),\n  ]).map(language => language.toLowerCase()));\n  const hookConsent = resolveHookConsentFlags(options);","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install/request.js#L93-L129","documentation":"normalizeInstallRequest restricts locale installation to the Claude targets. If a valid locale is supplied but the resolved target is neither 'claude' nor 'claude-project', it throws this error. Translated component sets only exist for Claude targets, so combining a locale with another --target (e.g. codex, cursor) is rejected.","triggerScenarios":"Running the installer with both `--locale <code>` and `--target` set to anything other than `claude` or `claude-project` — e.g. `--target codex --locale ja-JP`, or a default/other target inherited from config while a locale is set in config.","commonSituations":"Installing the Codex or Cursor skill subset while a locale lingers in a config file; assuming translations are available cross-harness; scripting one install command and swapping --target without removing --locale.","solutions":["Change the target: use `--target claude` or `--target claude-project` with the locale.","Drop the `--locale` flag (and any `locale` key in your install config) when targeting a non-Claude harness.","Run two installs: a translated Claude install, then a separate non-Claude install without a locale.","Check the resolved target — config files may set a target you didn't pass explicitly."],"exampleFix":"// before\ninstall --target codex --locale ja-JP\n\n// after\ninstall --target claude --locale ja-JP","handlingStrategy":"validation","validationCode":"if (options.locale && !['claude', 'claude-project'].includes(options.target)) {\n  throw new Error('--locale requires --target claude or --target claude-project');\n}","typeGuard":"function localeTargetCompatible(opts) {\n  return !opts.locale || opts.target === 'claude' || opts.target === 'claude-project';\n}","tryCatchPattern":"try {\n  const req = normalizeInstallRequest(options);\n} catch (e) {\n  if (e.message.includes('only be used with --target claude')) {\n    console.error('Locale installs are Claude-only; drop --locale or switch the target.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Only pass --locale together with an explicit Claude target.","Scrub `locale` from install config files when targeting non-Claude harnesses.","Assert flag/target compatibility in wrapper scripts before invoking the installer.","Remember translations are Claude-specific — plan separate non-locale installs for Codex/Cursor."],"tags":["cli","locale","conflicting-options","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}