[PR #4345] [MERGED] Offer Japanese as a documentation language #6340

Closed
opened 2026-10-23 04:09:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4345
Author: @kolacheee
Created: 7/31/2026
Status: ✅ Merged
Merged: 7/31/2026
Merged by: @kolacheee

Base: staging ← Head: agent/docs-language-ja


📝 Commits (3)

  • 07678d6 Offer Japanese as a documentation language
  • 7f9667d Reference #4345 in the changelog entry
  • 7e2dd9b Merge branch 'staging' into agent/docs-language-ja

📊 Changes

6 files changed (+27 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 CONTRIBUTING.md (+1 -0)
📝 packages/client/src/components/modals/DocsViewerModal.tsx (+22 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+1 -1)
📝 packages/shared/src/constants/docs-languages.ts (+1 -0)
📝 scripts/regressions/docs-language.regression.ts (+1 -0)

📄 Description

Why

Japanese is the next language on the documentation-translation roadmap (all UI Language locales get a docs pack; 日本語 follows Russian). Japanese-speaking users currently read all 123 in-app guides in English. This PR makes the guides available in natural Japanese through the existing Settings → General → Documentation Language selector and the onboarding tutorial's language suggestion.

Follows up on #4100 (selector + pack architecture + Spanish), #4157 (German), #4191 (French), #4229 (Brazilian Portuguese), #4235 (Polish), and #4281 (Russian). The translated pack itself lives on the docs-i18n branch (pushed together with this PR); this Engine PR adds only the language wiring.

What changed

  • packages/shared/src/constants/docs-languages.ts — ja: { label: "日本語", englishLabel: "Japanese" }. The label byte-matches the Language dropdown's Intl.DisplayNames output (verified by executing the same code path; the capitalization step is a no-op for CJK).
  • packages/client/src/components/modals/DocsViewerModal.tsx — Japanese sidebar category labels (ガイド, ホーム, インストール, 接続, キャラクター, チャット, ロアブック, エージェント, メディア, プロンプト, 外観, 設定, データ, 拡張機能, 連携, 開発; mode names and Noodle stay English, matching the interface).
  • packages/client/src/components/panels/SettingsPanel.tsx — settings-search aliases japanese, 日本語 (the settings matcher is plain lowercase includes, so CJK needs no special handling — verified).
  • scripts/regressions/docs-language.regression.ts — asserts Japanese stays offered.
  • CONTRIBUTING.md — Japanese translation-convention bullet (see below).
  • CHANGELOG.md — release-notes entry under [Unreleased].

No server changes are needed per language: the pack list, download URL, verification, and serving all derive from the shared label map.

Japanese conventions (documented in CONTRIBUTING)

Because the in-app docs search is literal substring matching, the pack enforces one spelling per term and search-safe typography end to end:

  • Polite です・ます register (the universal Japanese software-documentation convention) with noun-phrase 体言止め headings, and no "あなた" floods — Japanese drops subjects, and the pack has zero あなた as reader address.
  • Product names stay in Latin script, never katakanized ("Marinara Engineでは", never "マリナーラ"); particles attach directly, so no carrier nouns are needed.
  • Katakana loanwords use the modern trailing-ー spelling (サーバー/ユーザー/フォルダー/ブラウザー — every banned short variant is at 0 across ~2,500 occurrences), with community-standard terms such as ロアブック per the Japanese SillyTavern community. セキュリティ and コミュニティ keep their universal short forms as documented exceptions.
  • All Latin letters and digits are half-width ASCII — full-width "7860" would never match a search for 7860. Zero full-width alphanumerics, zero ideographic spaces (U+3000), zero NBSP, and all text NFC-normalized (decomposed kana would silently break substring search).
  • 「」 for Japanese prose quoting, with quoted English UI strings kept byte-exact to what the app renders (including each label's own ellipsis character); no space between Japanese and Latin/bold/code spans (bare URLs keep a space so GitHub's autolinker cannot swallow adjacent kana).

Validation performed

  • Translation pipeline: 123 files through translate → structural verify → fix → re-verify (the verify stage checks NFC normalization, the full-width/U+3000 bans, byte-identical code fences, heading/link-target/table parity), then a consistency sweep (3,687 fixes: pack-wide spacing normalization, link-text↔H1 audit driven from 185 mismatches to 0, 長音符 unification, heading normalization so repeated section titles index as one search term).
  • Four independent native-reader QA panels read all 123 files end-to-end against the English source (~160 further fixes: mistranslations, 直訳調 rewrites, term splits), followed by a reconciliation pass that resolved every cross-panel conflict (quote-delimiter ruling: 126 ASCII-quoted UI strings → 「」 with 6 justified survivors whose quotes belong to the app's own strings; run-in-label spacing unified; all term stragglers at 0).
  • An adversarial engine-diff review verified the change surface file-for-file against #4281's shape, executed the label byte-match, and confirmed the tutorial matcher hits ja directly.
  • node scripts/docs-i18n/validate-pack.mjs passes for all seven packs against current staging; committed git blobs re-hashed against every manifest (7 × 123 files, 0 mismatches).
  • pnpm regression:docs passes (languages en, de, es, fr, ja, pl, pt-br, ru); pnpm check passes.
  • Runtime-verified on a smoke server with the pack materialized as installed, including the ideographic-search checks: Japanese queries (プロンプト, 接続, ロアブック, 設定) through the API and the docs viewer, CJK highlight behavior, and NFC input matching.
  • The companion docs-i18n push also carries a second all-pack catch-up (FAQ, TROUBLESHOOTING, storyboard, scene backgrounds/video incl. the #4331 Animation Director, prompt overrides) so every language ships current with this Engine PR.

Summary by CodeRabbit

  • New Features
    • Added Japanese documentation localization covering all in-app guides and developer documentation.
    • Added Japanese navigation labels while preserving English UI control names and glossary terms.
    • Japanese documentation can be downloaded and selected from Settings → General → Documentation Language.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4345 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 7/31/2026 **Status:** ✅ Merged **Merged:** 7/31/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `agent/docs-language-ja` --- ### 📝 Commits (3) - [`07678d6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07678d600148af6a4bd5d4bf83b61bc451d32419) Offer Japanese as a documentation language - [`7f9667d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f9667d7ed07ba49ae0f16082d4e7187671fa93d) Reference #4345 in the changelog entry - [`7e2dd9b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7e2dd9b5a0a775e39d295c4f81eb0585558e639b) Merge branch 'staging' into agent/docs-language-ja ### 📊 Changes **6 files changed** (+27 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `CONTRIBUTING.md` (+1 -0) 📝 `packages/client/src/components/modals/DocsViewerModal.tsx` (+22 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+1 -1) 📝 `packages/shared/src/constants/docs-languages.ts` (+1 -0) 📝 `scripts/regressions/docs-language.regression.ts` (+1 -0) </details> ### 📄 Description ## Why Japanese is the next language on the documentation-translation roadmap (all UI `Language` locales get a docs pack; 日本語 follows Russian). Japanese-speaking users currently read all 123 in-app guides in English. This PR makes the guides available in natural Japanese through the existing **Settings → General → Documentation Language** selector and the onboarding tutorial's language suggestion. Follows up on #4100 (selector + pack architecture + Spanish), #4157 (German), #4191 (French), #4229 (Brazilian Portuguese), #4235 (Polish), and #4281 (Russian). The translated pack itself lives on the `docs-i18n` branch (pushed together with this PR); this Engine PR adds only the language wiring. ## What changed - `packages/shared/src/constants/docs-languages.ts` — `ja: { label: "日本語", englishLabel: "Japanese" }`. The label byte-matches the **Language** dropdown's `Intl.DisplayNames` output (verified by executing the same code path; the capitalization step is a no-op for CJK). - `packages/client/src/components/modals/DocsViewerModal.tsx` — Japanese sidebar category labels (ガイド, ホーム, インストール, 接続, キャラクター, チャット, ロアブック, エージェント, メディア, プロンプト, 外観, 設定, データ, 拡張機能, 連携, 開発; mode names and Noodle stay English, matching the interface). - `packages/client/src/components/panels/SettingsPanel.tsx` — settings-search aliases `japanese`, `日本語` (the settings matcher is plain lowercase `includes`, so CJK needs no special handling — verified). - `scripts/regressions/docs-language.regression.ts` — asserts Japanese stays offered. - `CONTRIBUTING.md` — Japanese translation-convention bullet (see below). - `CHANGELOG.md` — release-notes entry under `[Unreleased]`. No server changes are needed per language: the pack list, download URL, verification, and serving all derive from the shared label map. ## Japanese conventions (documented in CONTRIBUTING) Because the in-app docs search is literal substring matching, the pack enforces one spelling per term and search-safe typography end to end: - **Polite です・ます register** (the universal Japanese software-documentation convention) with noun-phrase 体言止め headings, and no "あなた" floods — Japanese drops subjects, and the pack has zero あなた as reader address. - **Product names stay in Latin script**, never katakanized ("Marinara Engineでは", never "マリナーラ"); particles attach directly, so no carrier nouns are needed. - **Katakana loanwords use the modern trailing-ー spelling** (サーバー/ユーザー/フォルダー/ブラウザー — every banned short variant is at 0 across ~2,500 occurrences), with community-standard terms such as **ロアブック** per the Japanese SillyTavern community. セキュリティ and コミュニティ keep their universal short forms as documented exceptions. - **All Latin letters and digits are half-width ASCII** — full-width "7860" would never match a search for `7860`. Zero full-width alphanumerics, zero ideographic spaces (U+3000), zero NBSP, and **all text NFC-normalized** (decomposed kana would silently break substring search). - **「」 for Japanese prose quoting**, with quoted English UI strings kept byte-exact to what the app renders (including each label's own ellipsis character); no space between Japanese and Latin/bold/code spans (bare URLs keep a space so GitHub's autolinker cannot swallow adjacent kana). ## Validation performed - Translation pipeline: 123 files through translate → structural verify → fix → re-verify (the verify stage checks NFC normalization, the full-width/U+3000 bans, byte-identical code fences, heading/link-target/table parity), then a consistency sweep (3,687 fixes: pack-wide spacing normalization, link-text↔H1 audit driven from 185 mismatches to 0, 長音符 unification, heading normalization so repeated section titles index as one search term). - Four independent native-reader QA panels read all 123 files end-to-end against the English source (~160 further fixes: mistranslations, 直訳調 rewrites, term splits), followed by a reconciliation pass that resolved every cross-panel conflict (quote-delimiter ruling: 126 ASCII-quoted UI strings → 「」 with 6 justified survivors whose quotes belong to the app's own strings; run-in-label spacing unified; all term stragglers at 0). - An adversarial engine-diff review verified the change surface file-for-file against #4281's shape, executed the label byte-match, and confirmed the tutorial matcher hits `ja` directly. - `node scripts/docs-i18n/validate-pack.mjs` passes for all seven packs against current `staging`; committed git blobs re-hashed against every manifest (7 × 123 files, 0 mismatches). - `pnpm regression:docs` passes (`languages en, de, es, fr, ja, pl, pt-br, ru`); `pnpm check` passes. - Runtime-verified on a smoke server with the pack materialized as installed, including the ideographic-search checks: Japanese queries (プロンプト, 接続, ロアブック, 設定) through the API and the docs viewer, CJK highlight behavior, and NFC input matching. - The companion `docs-i18n` push also carries a second all-pack catch-up (`FAQ`, `TROUBLESHOOTING`, storyboard, scene backgrounds/video incl. the #4331 Animation Director, prompt overrides) so every language ships current with this Engine PR. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Japanese documentation localization covering all in-app guides and developer documentation. * Added Japanese navigation labels while preserving English UI control names and glossary terms. * Japanese documentation can be downloaded and selected from **Settings → General → Documentation Language**. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:09:29 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6340
No description provided.