Repository navigation
ci(docs): check the japanese docs against deepl - #1878
Draft
kacperkapusciak wants to merge 5 commits into
Draft
kacperkapusciak wants to merge 5 commits into
kacperkapusciak wants to merge 5 commits into
Conversation
Each changed section of a docs/ja page is translated back into English and compared with the English page's section, and compared with DeepL's own Japanese for the English, both with chrF. A section far from DeepL in both directions, left in English, or missing a glossary term DeepL used gets a warning on its heading and a row in the job summary. Sections pair by position, which check-docs-translations.ts guarantees. The glossary in docs/ja/README.md is uploaded as a DeepL glossary.
Contributor
🟢 e2e web: 93 passedAll 93 tests in 42 files
Tested by e2e 0.23.1 · 1m 31s · web · run artifacts |
Contributor
🟢 e2e web agent: 34 passed35 agent steps · 26 replayed from cache · 25 model calls · 119.5k tokens (94% cached) · $0.0048 All 34 tests in 5 files
Tested by e2e 0.23.1 · 1m 50s · web · run artifacts |
Contributor
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 34 model calls · 184.8k tokens (84% cached) · $0.0119 All 20 tests in 1 file
Tested by e2e 0.23.1 · 6m 2s · android-emulator · run artifacts |
Contributor
🟢 e2e ios: 56 passed, 1 skippedAll 57 tests in 7 files
Tested by e2e 0.23.1 · 6m 48s · ios-simulator · run artifacts |
Contributor
🟢 e2e android: 58 passed, 1 skippedAll 59 tests in 7 files
Tested by e2e 0.23.1 · 10m 36s · android-emulator · run artifacts |
Contributor
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 12 replayed from cache · 61 model calls · 396.4k tokens (83% cached) · $0.0262 All 22 tests in 1 file
Tested by e2e 0.23.1 · 8m 47s · ios-simulator · run artifacts |
This branch has not been deployed
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.
What and why
Gives every translated docs section a second opinion from DeepL, so a mistranslated or stale section gets flagged in review.
scripts/check-docs-translations-deepl.tssplitsdocs/ja/<path>.mdxanddocs/<path>.mdxat their headings, which pair up by position becausecheck-docs-translations.tskeeps the outlines equal. For each section a pull request changes, in either language, DeepL translates our Japanese back into English and the English into Japanese.scripts/deepl-review.tsscores both with chrF (character n-grams, so no Japanese tokenizer). A section is flagged when it is far from DeepL in both directions, left in English, or missing a glossary term that DeepL's version uses. A correct translation that only words things differently usually stays close in one direction.docs/ja/README.mdis uploaded as a DeepL glossary (EN→JA and JA→EN), so DeepL uses our terms (ホスト型ブラウザ, サーバー). It is reused by a content hash, so an unchanged glossary costs nothing.deepl-reportartifact, since GitHub shows only 10 warnings per step. The summary ends with the month's DeepL usage..github/workflows/docs-translations.ymlruns it on pull requests that touch the docs. It is advisory and not a required check. It needs aDEEPL_API_KEYsecret (Free plan,:fxkey); without one, as on a fork, it skips.openai/gpt-6-lunaon the Vercel AI Gateway (AI_GATEWAY_API_KEY, already a repo secret). The model gets the glossary and the です・ます style in its prompt and answers a JSON list, one translation per section. The report and warnings name whoever translated. Without a gateway key, a used-up quota still skips the review with a warning.Stacked on #1875. e2e-inc/e2e-site checks its UI copy the same way.
Issue
ENG-1360
Verified
Ran it locally: yes
gpt-6-lunareviewed the 9 quickstart sections in 23 s. Scores ranged from 0.65 to 1.00, and the only flags were 2 glossary ones.node --test scripts/deepl-review.test.ts: chrF, glossary parsing (including the real README's 35 terms), the review rules, MDX section splitting, the real quickstart pairing up section by section, and the DeepL client (glossary created once and then reused, request shape, a 456 error surfaced).docs/ja/quickstart.mdxat each section's heading line, and--base HEADsends nothing.pnpm docs:check,oxlint scripts/, andtsc -p scriptspass.