Skip to content

Add an extensible localization mechanism for the app and plugins #3721

Description

@airclear

The workflow

I want to use bb as a workbench for teams whose interface language is not English, while allowing independently distributed plugins to follow the same language setting.

The desired workflow is:

  1. Select System, English, or Simplified Chinese in bb settings.
  2. Have the app resolve and persist that preference without requiring a restart.
  3. Let plugin authors register plugin-owned message catalogs rather than adding their translations to bb core.
  4. Let plugin components and host-rendered plugin metadata react to the current locale.
  5. Preserve existing plugins that pass plain string titles and descriptions.

A working prototype based on main at 62fe3bc46 is available in airclear/bb:feat/i18n-extension. Its design note is docs/i18n-extension-design.md.

What happens today

bb has no shared locale preference or app-level localization runtime. Core interface text is embedded as English strings. Plugin components have no API for reading the app locale or formatting localized dates and numbers, and plugins cannot register isolated catalogs. Host-rendered plugin titles and descriptions only accept strings.

A plugin can implement its own unrelated localization state, but that creates duplicate language selectors, inconsistent locale resolution, and no way to localize labels rendered by the host.

What you would expect

bb should provide a small localization mechanism rather than a complete translation in the first change:

  • A persisted system | en | zh-CN locale preference and one canonical resolver shared by the web app and Desktop shell.
  • An app-level runtime that updates document.lang, lazy-loads the active catalog, and switches without restarting.
  • Experimental plugin APIs for registering plugin-owned eager or lazy catalogs and reading the current locale, translating messages, and formatting dates and numbers.
  • Backward-compatible localized descriptors for host-rendered homepage, settings, and command metadata; ordinary strings must remain valid.
  • Isolation by plugin id and frontend generation so unloads, reloads, invalid catalogs, and late lazy-loader results cannot affect other plugins.
  • Required English fallback messages, with no requirement to translate all existing bb UI as part of the mechanism.

The prototype uses platform Intl APIs and adds no third-party i18n dependency. It deliberately excludes agent output, prompts, terminal output, logs, provider content, and full Chinese translation.

Context and alternatives

I searched open and closed issues for i18n, internationalization, and localization and found no matching request.

Alternatives considered in the prototype design:

  • Plugin-only language settings: rejected because host-rendered metadata cannot follow them and users would manage multiple language preferences.
  • One global plugin message namespace: rejected because independently authored plugins could collide and unload/reload ownership would be unclear.
  • Adding a full ICU dependency immediately: deferred; the prototype covers fallback strings, named interpolation, zero/one/other plural forms, and Intl formatting with a contract that can evolve later.
  • Translating bb in the same change: explicitly out of scope so the mechanism can be reviewed independently from translation volume.

The prototype includes automated coverage for locale normalization, fallback, interpolation, plurals, runtime switching, document.lang, eager/lazy plugin catalogs, loader failure containment, generation isolation, host-rendered plugin metadata, old string compatibility, settings persistence, and the Desktop locale seam. The full app and Desktop suites and the repository build pass on the branch.

Checks

  • I searched open and closed issues for the same request.
  • The body ends with > AGENT GENERATED.

AGENT GENERATED

Activity

  1. added
    plugins
    ui
    on Sep 15, 2026
  2. bb-slop-cop commented on Sep 15, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Type Feature, Priority Medium, Effort High, and labels ui, plugins. No existing classifications needed preserving; all values were verified after writing.

    Shared localization and plugin APIs add new functionality requiring architectural design. No reproduction report or pull request: this is a feature request, so the bug-only steps do not apply.

    AGENT GENERATED

  3. MainFrame100 commented on Oct 5, 2026

    @MainFrame100

    We'd also like to see this. We're a Russian-speaking team using bb every day, and an English-only interface is a real barrier for some of our teammates. Right now there's no clean way to localize it: theme overrides only cover styles, and replacing strings through a content script would break with every release.

    An extensible mechanism like the one proposed here, with a locale preference plus dictionaries for the core app and plugins, would solve this.

  4. dillonzq commented on Oct 14, 2026

    @dillonzq
    Contributor

    Strong +1 for this proposal! A built-in i18n foundation would make bb much more accessible to non-English-speaking users.

    I especially support having a shared locale preference across the web app and Desktop, switching languages without a restart, and giving plugins their own translation catalogs so the entire experience can follow one language setting. Simplified Chinese support would be particularly valuable to me.

    I also like the approach of landing the localization infrastructure first, without blocking it on a full UI translation. Thanks for putting together a working prototype — I'd love to see this adopted upstream!

  5. uzarsalan commented on Nov 8, 2026

    @uzarsalan

    I tried the other direction for the core app and have a working prototype, in case it helps decide how bb should do this.

    Prototype (not a PR): uzarsalan/bb@i18n-poc, 6 commits on top of 55135d1e50 (diff).

    What it does:

    • Lingui v5 with macros (msg, t, plural) and .po catalogs; en is the source locale, ru the first translation. Macros run in a second Babel pass before React Compiler, and the active catalog loads lazily.
    • A language key in generalSettings (en | ru, default en): domain schema, server handler, existing CLI settings command, docs. No migration is needed for a new key.
    • Settings → General translated (language selector, sections, settings navigation and search index, command palette settings actions, CLI/skills/voice sections, App links): 172 catalog entries, every ru entry translated, one/few/many/other plurals included.
    • A catalog gate in the app lint script: runs lingui extract, compares msgid sets before and after, and fails on empty ru translations, including plural forms.

    On the branch @bb/app typecheck, lint (0 errors), test (675 files) and build pass, and I ran the built app to confirm Settings → General renders in Russian.

    How this relates to the proposal here:

    • It does not cover plugin-owned catalogs or host-rendered plugin metadata, which is the main value of this issue. The two could fit together: the plugin API from this issue plus a catalog format and CI gate for core strings.
    • The real choice is the core mechanism: a small own runtime on Intl (no dependency) versus Lingui (macros and .po tooling, one added dependency). I can port the Russian catalog and the gate to whichever you prefer.
    • Known gaps in my prototype: only Settings → General is extracted; some helpers outside React hooks use the global t, and I have not verified that they re-render on a language change.

    Questions for maintainers: which core mechanism do you want, and is generalSettings.language the right place for the preference? If a direction is agreed, I would send small PRs by area after sign-off, per CONTRIBUTING.md.

    AGENT GENERATED

  6. Ilyafisk commented on Nov 13, 2026

    @Ilyafisk

    I put together two branches that may help with this issue:

    • Language toggle prototype: rebases @uzarsalan's Lingui prototype onto the current main, preserving their commit authorship, and adds a RU/EN button in the sidebar footer. The button updates the same persisted setting as Settings → General → Language and the CLI command, without a restart. I verified the button in the running app, then confirmed Settings → General rendered in Russian. The focused tests, app typecheck, lint, catalog gate, and production app build pass.
    • Full Russian literal translation: covers the app, Desktop menus, and many bundled plugins. It is useful as translation source material, but its strings are hardcoded and it does not include the language toggle.

    The toggle prototype currently translates the surfaces covered by the Lingui prototype, not the entire UI or plugin content. The full translation would need to be moved into catalogs in smaller patches before it could be merged. I am sharing these branches here for feedback and will follow the feature sign-off process in CONTRIBUTING.md before opening a PR against get-bb/bb.

    AGENT GENERATED

  7. wanettagrieme-spec commented on Nov 28, 2026

    @wanettagrieme-spec

    Hi BB team,

    I’m writing on behalf of a MacBook user who needs the Russian-language version of BB for their day-to-day work. Would you be willing to review this translation and consider including it in a signed, notarized macOS build? Having this version available on their MacBook would make a real difference to their ability to use BB at work.

    The Russian UI patch is based on BB 0.50.1 (a08e116). It adds a Russian/English language switch that persists across restarts and translates settings, chats, projects, and several bundled plugin screens. We tested those flows in an isolated Apple Silicon build. Some strings still need translation, and we’d welcome your guidance on how best to align the patch with the localization approach discussed here.

    Thank you for considering the request.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginsui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions