Translate — issue codes & troubleshooting
Product reference for generate translation: Translation config and Environment variables (translation backends section).
Each section below follows the topic page pattern (Code, Severity, When, …).
identity_streak_warning
Code: i18nprune.translate.identity_streak_warning
Severity: warning
When: generate sees many consecutive string leaves whose post-translation value still equals the source (identity streak approaching the abort threshold).
Who: translateLeaf / createIdentityStreakGuard (@i18nprune/core); invoked from runGenerate.
What to do: Check API keys, provider, source/target language codes, and network; confirm you are not repeatedly “translating” into the source language by mistake.
identity_streak_abort
Code: i18nprune.translate.identity_streak_abort
Severity: error
When: The identity streak guard stops the run to avoid burning quota on a broken configuration. In --json mode this typically yields ok: false on the primary envelope.
Who: runGenerate, translateLeaf, createIdentityStreakGuard. --yes in human/non-JSON flows may allow continuing without a prompt where implemented.
What to do: Same as identity_streak_warning — fix configuration; re-run with --yes only after you understand why translations were identical.
unknown_translation_provider
Code: i18nprune.translate.unknown_translation_provider
Severity: error
When: CLI exits with USAGE (e.g. Unknown translation provider "…" or unknown --provider), usually from a typo, an unsupported id, or a stale I18NPRUNE_TRANSLATE_PROVIDER value.
Who: parseProviderLabel / resolveTranslationProviderOptions (packages/cli); validateResolvedTranslationOptions (@i18nprune/core).
What to do:
- Run
i18nprune generate --helpand use a supported--providerid, or seelistTranslationProviders()in@i18nprune/core/ doctor output. - Fix
translate.primaryand matchingtranslate.providersrows (unknownidrejected at load;primarymust match an enabled row). - Unset or correct
I18NPRUNE_TRANSLATE_PROVIDERif it overrides your file unintentionally (precedence: flag → env → config → default — see translate config).
provider_not_implemented_yet
Code: i18nprune.translate.provider_not_implemented_yet
Severity: error
When: USAGE like Translation provider "…" is not implemented yet — a new provider id was added to the typed registry before its Translator shipped (today all registered ids are implemented; this code remains for forward compatibility).
Who: resolveTranslator (packages/core / registry.ts).
What to do: Run i18nprune providers for supported ids; upgrade @i18nprune/core / CLI.
missing_credentials
Code: i18nprune.translate.missing_credentials
Severity: error
When: generate aborts before the first outbound translation call: a backend that requires secrets or a base URL is selected, but assertTranslationProviderCredentialsReady (and resolveTranslator) still see missing apiKey / baseUrl / model after env merge.
Who: assertTranslationProviderCredentialsReady, executeGenerate / executeFill (packages/cli).
What to do:
- DeepL: set
apiKeyon thedeepltranslate.providersrow, or exportI18NPRUNE_TRANSLATE_DEEPL_API_KEY(env wins over file when both are set — see env.md). - LibreTranslate: set
baseUrlon thelibrerow (instance origin, no trailing slash) orI18NPRUNE_TRANSLATE_LIBRE_URL. - LLM: set
apiKey,baseUrl, andmodelon thellmrow, orI18NPRUNE_TRANSLATE_LLM_*env vars. - Confirm the effective backend:
--providerandI18NPRUNE_TRANSLATE_PROVIDERoverridetranslate.primary— credentials from the file apply only when the resolvedidmatches that row (enabled: falserows are skipped).
env_overrides_config_unexpectedly
Code: n/a — not emitted as issues[]; narrative anchor for env.md behavior.
Severity: info (troubleshooting only).
When: Translation-related values in i18nprune.config.* never seem to apply, because for each credential field a non-empty matching I18NPRUNE_TRANSLATE_* env var supersedes the same field on the active translate.providers row.
Who: resolveTranslationProviderOptions (packages/cli).
What to do: Print env in CI / shell (printenv | grep I18NPRUNE_TRANSLATE) and unset vars you do not intend, or rely on env-only secrets in CI and omit them from the committed config.
translate_block_ignored_wrong_id
Code: n/a — not emitted as issues[]; troubleshooting anchor.
Severity: info
When: You set apiKey (or other fields) on a translate.providers row, but the run still behaves like another backend — translate.providers merges only the row whose id matches the resolved backend (flag → env → primary). Example: I18NPRUNE_TRANSLATE_PROVIDER=google ignores deepl row fields.
Who: resolveTranslationProviderOptions.
What to do: Align id, --provider, and I18NPRUNE_TRANSLATE_PROVIDER, or remove the env override so the file’s id wins.
placeholder_sentinel_mangled
Code: n/a — not emitted as issues[]; troubleshooting anchor for mangled {{…}} placeholders after MT.
Severity: warning (troubleshooting only).
When: generate writes locale leaves that contain literal I18NPRUNE_0-style tokens (often with extra spaces) instead of {{var}} placeholders. Common with MyMemory and other free MT backends that treat mask sentinels as translatable text.
Who: mask / restore / validateRestored in @i18nprune/core; surfaced when translateLeaf cannot restore placeholders after the provider returns.
What to do:
- Re-run affected paths with a provider that preserves tokens better (Google, DeepL, LibreTranslate with a tuned instance).
- Re-run
generate(orgenerate --resume) — leaves that are only{{…}}placeholders plus punctuation/separators are copied from source without MT by default (e.g.{{pageTitle}} · {{siteName}}). - For prefix-wide protection (e.g. dynamic
t(item.labelKey)nav configs), usepolicies.preserve.copyPrefixesin your project config.
config_file_rejected_at_load
Code: See i18nprune.config.* on Config issues (usually invalid for bad translate.* shape).
Severity: error
When: Invalid i18nprune config on startup — each translate.providers element must match the strict discriminated union (no stray keys on google, etc.); translate.primary must reference an enabled row; duplicate id values are rejected.
Who: Config Zod load path (packages/cli / schema.ts).
What to do: Compare your object to translate config; run i18nprune init --rich for a fresh template.