Skip to content

Add Japanese localization for CLI, server messages, guide, and app UI - #8552

Closed
ozekimasaki wants to merge 7 commits into
get-bb:mainfrom
ozekimasaki:feat/ja-localization
Closed

ozekimasaki wants to merge 7 commits into
get-bb:mainfrom
ozekimasaki:feat/ja-localization

Conversation

@ozekimasaki

@ozekimasaki ozekimasaki commented Dec 2, 2026 •

Copy link
Copy Markdown

Human comments

What was wrong

bb shipped with English-only CLI help, server error messages, guide templates, and app UI. There was no locale switch, so Japanese users could not run the product in Japanese, and the app used a Latin-first font stack that rendered Japanese text with inconsistent glyph shapes and cramped line spacing.

What changed

  • Locale foundation. --lang / BB_LANG select the locale for the CLI and app (ja or en, default en). The app resolves the locale from ?lang, a persisted bb.uiLocale, the injected __BB_LOCALE__, then navigator.languages; it sets <html lang> and formats dates and numbers with Intl. The server resolves its locale from BB_LANG / LC_* and Accept-Language for shell injection and error responses.
  • Japanese catalogs. 592 CLI help strings, 391 server messages, 15 guide chapters, and a 1,487-key app UI catalog, plus README.ja.md. The UI catalog is wired through a build-time transform that wraps display strings in tr() and falls back to English for missing keys.
  • Japanese typography. Under html[lang="ja"], Japanese text uses a platform Japanese fallback stack while Latin glyphs keep Inter: "Inter Variable", Inter, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", Meiryo, sans-serif. No font files are bundled and no CDN is used. Line height is raised for the small UI tiers (13px text: 18.57px -> 23px, 12px text: 16px -> 19px, 15px text: 22px -> 24px), leading-snug uses 1.6, and body tracking is 0.01em. Headings, kbd, code, inputs, and tabular numbers keep normal tracking. Settings rows get 12px vertical padding and their descriptions 4px top margin.
  • Tests and tooling. Catalog coverage tests, locale resolution tests, CLI/server localization tests, and a typography regression test in theme.test.ts.

There are no wire-format changes and no HOST_DAEMON_PROTOCOL_VERSION bump. English output and layout are unchanged by default.

How you verified

  • pnpm typecheck, pnpm lint, pnpm build, and the workspace test suites were run. The app theme test (41 tests) and settings-related tests (49 tests) pass; the CLI and server localization suites pass.
  • The built CLI was walked through 273 --help paths; only pass-through content (plugin run) and JSON schema field names remain English.
  • A Playwright scan of the main screens checked for residual English. Remaining English is limited to product names, key notation (Ctrl, Shift), marketplace/skill prose, and plugin-owned UI (see limitations).
  • ja/en screenshots were captured for 10 screens at 1280x900. The en main content is pixel-identical in the settings screens; no page has horizontal overflow after the spacing change.

Known limitations:

  • Plugin-owned UI strings are not localized by this change, including the bundled thread-list sidebar ("Threads" / "No threads") and marketplace/skill metadata. Plugin catalog registration is a separate mechanism.
  • ThreadDetailPromptArea has two failing tests on this branch (inline-queued-message-editor not found and "Cancel queued edit" not found) that are independent of the catalog content.
  • The Japanese catalogs were reviewed for consistency, but domain terminology may still benefit from native-speaker review.

Related context: #3721 proposes a generic, plugin-extensible localization mechanism. This PR is a concrete Japanese locale for bb core and does not implement plugin-owned catalogs.

Fixes #8554

@github-actions github-actions Bot added needs-approval PR author is not on the approved contributor list needs-issue PR does not close an open issue labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @ozekimasaki. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change.

Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request.

Linked issue. Every pull request must close an open issue in this repository. The issue keeps the problem tracked even if this pull request closes or we take a different approach. Open an issue for the change, or find an existing one, and add Fixes #<number> to the pull request description. Feature requests and UI changes need a maintainer's sign-off on the issue first. Link the issue before you ask for approval.

See CONTRIBUTING.md for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-approval PR author is not on the approved contributor list needs-issue PR does not close an open issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Japanese localization for the CLI, app UI, and docs

1 participant