Files
lightcraft/docs/localization-ja.md
T
Brandon ThomasandClaude Opus 5.5 2aa236537f Fonts: use craft-fonts as an optional build input; move the Japanese fonts out
The Japanese fonts (BIZ UDPGothic Regular/Bold for the UI, BIZ UDMincho for text
watermarks; #110, #114) now come from storytold/craft-fonts instead of assets/fonts/.

- crates/engine/build.rs: the craft-fonts recipe. With CRAFT_FONTS_DIR set it embeds
  the manifest's fonts as lightcraft_engine::CRAFT_FONTS (wasm32: BIZ UDPGothic Regular
  only, for the web size budget); unset, CRAFT_FONTS is empty. Local files only, no
  network; craft-fonts is not in any Cargo.toml.
- UI: theme::font_definitions adds the Japanese faces after Inter and egui's defaults
  in every family (BIZ UDPGothic first, Bold first for semibold). About box lists the
  embedded families.
- Watermarks: Inter, then the craft-fonts Japanese faces (Mincho first).
- Removed BIZUDPGothic-Regular/Bold.ttf, BIZUDMincho-Regular.ttf and their OFL files,
  and their ATTRIBUTION rows; added an attribution row for craft-fonts as an optional
  build input; NOTICE updated.
- Tests: Japanese glyph tests use CRAFT_FONTS and skip without it; new tests for
  Japanese in the UI with craft-fonts and for the UI and watermarks without it.
- CI: the FreeBSD job builds/tests with craft-fonts. Releases check out craft-fonts at
  a pinned commit, build with CRAFT_FONTS_DIR + CRAFT_FONTS_REQUIRED=1, and ship the
  fonts' OFL licences (plus NOTICE) in every package.
- Docs: AGENTS.md, CLAUDE.md, README, docs/web.md, docs/localization-ja.md, ROADMAP,
  parity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-06 11:35:02 -04:00

1.9 KiB

LightCraft 日本語表示

LightCraft は日本語と英語(English)の表示に対応しています。 言語設定は ui.json の language に保存します。

  • 「編集 → 言語」または「設定 → 一般 → 言語」で日本語とEnglishを切り替えます。選択は次回起動にも引き継ぎます。
  • メニュー、写真編集、マスク、切り抜き、設定、読み込み、書き出し、主な処理状況を翻訳しています。
  • 通常表示と太字の双方に、SIL OFLのBIZ UDPGothicを使います。日本語フォントはこのリポジトリではなく storytold/craft-fonts にあり、任意のビルド入力 CRAFT_FONTS_DIR=../craft-fonts を指定したビルド(公式リリースはすべて)に組み込まれます。 指定しない場合も動作しますが、日本語の文字は表示されません。
  • 翻訳は表示層で行います。操作コマンドのID、写真のファイル名、入力したメタデータを変更しません。
  • 翻訳されていない技術的なエラー、追加情報、リリースノートは英語で表示します。

翻訳の保守

静的な表示文言は crates/ui-egui/locales/ja.json、可変値を含む表示文言は crates/ui-egui/locales/ja-formats.json にあります。英文をキーにして翻訳を管理します。 可変文言の両言語はビルド時にRustのフォーマット検査を受けます。 英語の単複数語尾を日本語で省略する場合、対応する文字列引数は {:.0} で空にします。 LIGHTCRAFT_LANGUAGE=ja lightcraft-cli snapshot ... で日本語の画面を描画できます。

表示・フォント・言語の切り替え・設定の保存・コマンドIDの保持は cargo test -p lightcraft-ui-egui i18n::tests で検証します(グリフの検査は CRAFT_FONTS_DIR 指定時のみ実行)。