Troubleshooting
Section anchor links do not work in translated docs
A link like [label](other.md#section-id) may open the correct translated file but fail to scroll to the intended heading — or jump to the wrong section. The #… fragment no longer matches any heading id in that locale.
Common causes:
- Source headings never had explicit anchor ids; the site derives slugs from visible heading text, which changes after translation.
- You renamed a heading in source but the preceding
<a id="…"></a>line is missing or still has the old id. - Anchor links use a
#…fragment guessed from English words instead of the idwrite-heading-idswould generate.
Fix
- Run
ai-i18n-tools write-heading-idson your source.md/.mdx(samedocs[]/contentPathsastranslate-docs). By default it inserts<a id="slug"></a>before each ATX heading, or refreshes an existing anchor when the heading text no longer matches the current slug. For Docusaurus MDX comment ids, use--slug-style mdx-comment. - Point anchor links at those ids — e.g.
[setup](guide.md#first-run)where#first-runmatches the anchor line above the target heading, not a slug inferred from the English title alone. - Re-run
translate-docs(orsync --force-update) so every locale copy includes the updated anchor lines.
Use --dry-run on write-heading-ids first to preview changes. See Anchor links for the full pattern.
Image or asset links 404 in translated docs
A markdown link or  works in English but returns 404 in translated copies — often because the URL still points at the source-locale folder or an English-only static path.
Fix
- Confirm your asset layout matches your
docsOutput.style(flat vs doc-system). See Link rewriting and Images & Screenshots. - Add or adjust
docsOutput.postProcessing.regexAdjustmentsto swap locale segments or bridge absolute/img/…paths. For flat layout, remember the flat link rewriter runs beforeregexAdjustments— match patterns against the already-prefixed URL. - Ensure locale-specific asset files exist at the paths the rewritten markdown references (
translate-docsrewrites URLs but does not copy raster files).
Hindi, Arabic, CJK, or Cyrillic output is romanized (Latin letters)
Some models translate the meaning but write the result in Latin/Roman letters (for example Hindi as Namaste instead of नमस्ते). Bare hi means Devanagari; use hi-Latn only when you want romanized Hindi.
Fix
- Confirm the locale code matches the script you want (
hivshi-Latn,zh-Hansvszh-Hant,srvssr-Latn). - Re-run translation so wrong-script cache rows are rejected:
translate-ui --forcefor UI strings, ortranslate-docs --check-cache/sync --check-cache(file-level skip is bypassed only for locales with an expected script; valid segment cache is still reused).--force-updatereprocesses every locale. - If a model keeps failing the script check, add a
localeModelsentry for that locale so a stronger model is tried first — see Providers and models.