Repository navigation
ci(docs): check the japanese docs against deepl - #1878
Conversation
🟢 e2e web: 93 passedAll 93 tests in 42 files
Tested by e2e 0.23.1 · 1m 3s · web · run artifacts |
🟢 e2e web agent: 34 passed35 agent steps · 26 replayed from cache · 25 model calls · 119.7k tokens (94% cached) · $0.0048 All 34 tests in 5 files
Tested by e2e 0.23.1 · 1m 41s · web · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 34 model calls · 183.0k tokens (83% cached) · $0.0117 All 20 tests in 1 file
Tested by e2e 0.23.1 · 6m 26s · android-emulator · run artifacts |
🟢 e2e ios: 56 passed, 1 skippedAll 57 tests in 7 files
Tested by e2e 0.23.1 · 6m 44s · ios-simulator · run artifacts |
🟢 e2e android: 58 passed, 1 skippedAll 59 tests in 7 files
Tested by e2e 0.23.1 · 10m 10s · android-emulator · run artifacts |
🟢 e2e ios agent: 1 flaky, 20 passed, 1 skipped25 agent steps · 12 replayed from cache · 62 model calls · 496.9k tokens (83% cached) · $0.0337
|
| Test | Agent | Time | |
|---|---|---|---|
| tests-agent/scenarios.e2e.ts · 1 flaky, 20 passed, 1 skipped | 25 steps · 62 calls | 8m 42s | |
| 🟢 | act completes Login Form | 1 step | 39.4s |
| 🟢 | act completes Infinite Scroll List | 1 step | 35.6s |
| 🟢 | act completes Modal Flow | 1 step | 10.6s |
| 🟢 | act completes Bottom Tabs | 1 step | 7.6s |
| 🟢 | act completes Text Input Variations | 1 step | 12.9s |
| 🟢 | act completes Broken Accessibility | 2 steps · 6 calls | 25.5s |
| 🟢 | act completes Vision Only | 2 steps · 6 calls | 30.1s |
| act completes Gestures (1 failed attempt first) | 1 step · 11 calls | 47.8s | |
| 🟢 | act completes Async States | 1 step · 10 calls | 33.9s |
| 🟢 | act completes Debounced Search | 1 step · 1 call | 26.7s |
| 🟢 | act completes Flattened Registration Form | 2 steps · 1 call | 25.1s |
| 🟢 | act completes Flattened Login | 2 steps · 11 calls | 1m 6s |
| 🟢 | act completes Sticky Chrome Target | 1 step | 12.9s |
| 🟢 | act completes WebView Accessibility | 1 step | 11.9s |
| 🟢 | act completes Permission Prompt | 1 step | 11.2s |
| 🟢 | act completes Photo Picker | 1 step · 2 calls | 29.2s |
| 🟢 | act completes Product Catalog | 1 step | 10.3s |
| 🟢 | act completes Error Recovery | 1 step | 10.2s |
| 🟢 | act completes Choice Controls | 1 step · 6 calls | 35.4s |
| 🟢 | act completes Stripe PaymentSheet | 1 step · 8 calls | 29.7s |
| 🟢 | act completes Apple Pay | 1 step | 10.4s |
| ⏭️ | act completes Apple Pay Billing Address (skipped: the CI simulator's Apple Pay sheet skips the billing-address step, so the scenario cannot be completed there) |
Tested by e2e 0.23.1 · 9m 57s · ios-simulator · run artifacts
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.
19808f0 to
322543c
Compare
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.