Skip to content

[auto] update translations#246

Merged
NiveditJain merged 1 commit into
mainfrom
auto/translate-docs-20260429-2307
Apr 30, 2026
Merged

[auto] update translations#246
NiveditJain merged 1 commit into
mainfrom
auto/translate-docs-20260429-2307

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Automated translation update triggered by changes to English documentation sources.

  • Only changed pages were re-translated (content-hash cache)
  • All 14 languages across 3 tiers (parallel matrix)

@NiveditJain NiveditJain merged commit c13d811 into main Apr 30, 2026
1 check passed
NiveditJain added a commit that referenced this pull request Apr 30, 2026
* [docs] sanitize JSX attribute quotes in auto-translated MDX

The German translator periodically emits `<Tab title="Tab „Richtlinien"">`
where it intends `„…"` typographic quotes but uses ASCII `"` for the
closing — the inner straight `"` terminates the JSX attribute and the
real attribute close becomes a stray `"` before `>`, which trips
`mintlify validate` with `Unexpected character "`.

PR #229 fixed this once by hand on `docs/de/dashboard.mdx`. The next
auto-translation run regenerated the same broken markup, so the same
parse error landed on `main` again after #246.

Make it stick:

- `scripts/translate-docs/mdx-translator.ts` adds `sanitizeJsxAttributes`,
  which strips stray trailing ASCII `"` after a JSX attribute close and
  drops unmatched typographic opening quotes (`„`, `"`, `«`, `‹`, `「`,
  `『`) inside the same value. Matched pairs (e.g. `「ポリシー」`) are
  preserved. Wired into `translateMdxPage` ahead of `rewriteInternalLinks`.
- `scripts/translate-docs/translator.ts` extends rule #2 of the system
  prompt to forbid ASCII `"` inside JSX attribute values entirely, so
  the LLM is less likely to produce the pattern in the first place.
- `__tests__/scripts/translate-docs/mdx-translator.test.ts` covers the
  exact `de/dashboard.mdx` failure plus self-close, multi-attribute,
  matched typographic pairs, empty-value, and multiple-on-one-line cases.
- `docs/de/dashboard.mdx` drops the inner German quotes from the two
  `<Tab title>` attributes (mirrors #229) so CI on `main` goes green
  immediately rather than waiting for the next translation cycle.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* [docs] address CodeRabbit review on sanitizeJsxAttributes

Two findings on PR #247:

1. mdx-translator.ts:50 — `cleaned.split(open).join("")` removed *every*
   occurrence of an opener when `opens > closes`, so a value containing
   one matched typographic pair plus one stray opener (e.g.
   `„Foo“ und „Bar`) lost the matched pair too. Fix: drop only the
   surplus = opens - closes openers, scanning from the right with
   `lastIndexOf` so the leftmost matched pair is preserved.

2. mdx-translator.test.ts — add a regression test for that mixed case
   (one matched „…“ pair + one dangling „) so the bug above can't
   recur.

Also drop the English curly “…” pair from the openings list. U+201C
is both the German closer and the English-curly opener, so processing
the English pair after the German pair would strip the very German
closer we just preserved. The remaining pairs (German, French ×2,
Japanese ×2) all have unambiguous openers.

1177 unit tests pass (was 1176 — the new mixed-case test is the +1).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant