Send the docs to Crowdin with the app's strings - #159
Conversation
The docs pages and their titles become Crowdin sources, so an edit to an English page reaches translators the way a new string does, and every language lands in the folder the app reads: src/docs/<code>/, by the app's own short code, because the URL carries it. Chinese is the only pair whose two letters would collide, so both forms are named. The upload workflow now watches the docs and this file too, not only the dictionary.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
PR Summary by QodoUpload documentation sources to Crowdin
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
|
| # link. The build refuses a page without them and `docs.test.ts` compares | ||
| # each translation with its English source. | ||
| - source: /src/docs/en/*.md | ||
| translation: /src/docs/%two_letters_code%/%original_file_name% |
There was a problem hiding this comment.
The new configuration downloads documentation translations into src/docs/<code>/, but the download workflow checks and stages only src/i18n/locales. A docs-only download is therefore reported as having no changes, while a mixed download commits only the dictionaries. In both cases, the approved documentation translations never reach the generated pull request. Update the download workflow's diff and staging paths to include src/docs.
There was a problem hiding this comment.
Fixed in eed096a: the workflow checks and stages src/docs alongside src/i18n/locales, so an export with only docs in it still opens the pull request.
| # metadata read. A language shows the pages listed here and falls back to | ||
| # English for the rest. | ||
| - source: /src/docs/en/pages.json | ||
| translation: /src/docs/%two_letters_code%/%original_file_name% |
There was a problem hiding this comment.
Downloading the first translated documentation folder makes the download job fail before it can open a pull request. DOC_LANGUAGES remains ['en'], but the docs test requires it to match every folder under src/docs. Register generated language folders during synchronization, or change the registry and test mechanism to support them.
There was a problem hiding this comment.
Fixed in eed096a: a sync step between the download and the build writes DOC_LANGUAGES from the folders that kept a translated page, so the first exported language no longer fails the test that compares the two.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df57b0567f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # link. The build refuses a page without them and `docs.test.ts` compares | ||
| # each translation with its English source. | ||
| - source: /src/docs/en/*.md | ||
| translation: /src/docs/%two_letters_code%/%original_file_name% |
There was a problem hiding this comment.
Include downloaded docs in the sync commit
When Crowdin downloads an approved translation to this new path, .github/workflows/crowdin-download.yml still checks for changes only under src/i18n/locales and stages only that directory. A docs-only export therefore exits as “No translation changes,” while even an export accompanied by dictionary changes leaves src/docs unstaged, so no documentation translation can reach the generated pull request.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in eed096a. Change detection and git add both cover src/docs now, and the pull request body names the docs pages as well as the app strings.
| # metadata read. A language shows the pages listed here and falls back to | ||
| # English for the rest. | ||
| - source: /src/docs/en/pages.json | ||
| translation: /src/docs/%two_letters_code%/%original_file_name% |
There was a problem hiding this comment.
Register documentation languages produced by the export
As soon as this mapping creates any non-English docs folder, the download workflow's pnpm test fails because DOC_LANGUAGES remains ['en'] while src/docs/docs.test.ts requires it to equal the folders on disk. The same registry also makes hasDocs ignore downloaded translations at runtime, so the sync needs to update or otherwise coordinate DOC_LANGUAGES for every exported language.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in eed096a. The sync step rewrites DOC_LANGUAGES from the pruned folders (and formats the file, since lint:ci runs before a deploy), so both the test and hasDocs see the exported languages.
…r the rest Review round on #159. The download workflow looked at src/i18n/locales alone, so a docs-only export reported no changes and a mixed one left the pages unstaged: no translated page could reach the pull request. It now checks, stages and describes src/docs too. An approved-only export fills the rest with the English source, so a language arrives listing pages nobody translated, sometimes as English Markdown under a translated name and sometimes with no file at all. Shown as they are, those pages look translated and the reader never sees the note; a listed page with no file throws on import. scripts/docs-translations.mjs keeps only the pages that differ from English, drops the files no index lists, removes a language that translated nothing, and writes DOC_LANGUAGES from the folders that remain, which is what made the first export fail the docs test that compares that list with the folders on disk.
Part of #152, the pipeline half.
The docs pages and
pages.json(the titles and descriptions) become Crowdin sources, so an edit to an English page reaches translators the same way a new app string does. Translations land in the folder the app already reads,src/docs/<code>/, using the app's own short code rather than a locale, because the URL carries it (/docs/de/oauth2). Chinese is the only pair whose two letters would collide, sozh-CNandzh-TWare named explicitly.The upload workflow watched only
src/i18n/locales/en-US.json; it now watchessrc/docs/en/**and this config too.What this does not do
The 16 English pages are 18,908 words. Translating them into the other 24 languages is about 454,000 words, which is a Crowdin job with a proofreading pass per language, not a repo edit. Nothing can flow until the repository variable
CROWDIN_PROJECT_IDand the secretCROWDIN_PERSONAL_TOKENare set, which is still open from #144.Already in place from #151, so #152 needs nothing more here:
docs.test.tscompares each translation with its English source and fails on a changed heading id, a lost or altered code block, or a changed linkDOC_LANGUAGESinsrc/docs/content.tsis checked against the folders that exist, so a language appears in the app only once its folder is thereVerification
crowdin.ymland the workflow both parse. Docs tests 8/8, typecheck clean.