feat(docs): crowdin translations setup - #9368
Draft
joshistoast wants to merge 8 commits into
Draft
Conversation
The rule for prefixing a root-relative path with a locale, and the list of custom pages exempt from it, were hand-copied between the remark plugin and the runtime rewrite in MarkdownContent. Move both into src/lib/link-localization.mjs so a new page under src/pages/ only has to be registered once, and cover the helpers with unit tests. Claude-Session: https://claude.ai/code/session_016pdfTjHiM9inq24jMHDE2y
MDX components stay JSX nodes through rehype instead of becoming <a> elements, so rehypePrefixBaseToRootLinks skipped them and Starlight's LinkButton passes href straight to the DOM. The home page "Get Invoke" button therefore shipped as /download/ on the GitHub Pages target and 404'd. Rewrite href/link attributes on MDX JSX nodes too, derive the links-validator exclusions from the shared exemption list so they stay base-aware, and assert the button in the deploy output check. Claude-Session: https://claude.ai/code/session_016pdfTjHiM9inq24jMHDE2y
An href equal to the base with no trailing slash did not match the
`${base}/` test, so it fell through unstripped and the locale was inserted
after it, producing /InvokeAI/de/InvokeAI. Handle the exact-base case, adopt
the shared exemption list, and document why this rewrite happens at runtime
and what that costs.
Claude-Session: https://claude.ai/code/session_016pdfTjHiM9inq24jMHDE2y
starlight-links-validator errors on fallback pages by default, so the first Crowdin import fails the build: a translated page linking to a page that is not translated yet points at a route Starlight generates as fallback content and the validator rejects it. Only six trees are translated and pages arrive one batch at a time, so this is the expected state, not a broken link. Claude-Session: https://claude.ai/code/session_016pdfTjHiM9inq24jMHDE2y
The localized expectations required `lang="en" dir="ltr"` on start-here/installation, which only holds while that page is fallback content. Translating it would have failed the deploy check on the Crowdin import PR. Assert fallback rendering on contributing/translations instead, which sits outside crowdin.yml and stays untranslated. Claude-Session: https://claude.ai/code/session_016pdfTjHiM9inq24jMHDE2y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Initial setup for crowdin translations for documentation site.
Related Issues / Discussions
QA Instructions
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)