Conversation
Every hub-ui string now goes through a small in-house t() with ten
locales (en, zh-CN, zh-TW, ja, ko, es, fr, de, pt-BR, ru) and English as
the fallback. A Language select in Settings > Appearance persists the
visitor's pick per browser; createUi({ locale }) seeds the default via
ConnectionMeta.configs.ui.locale, and the running UI writes the effective
language back into the connection it publishes so same-origin frames read
it at boot.
refs #398
◈ PR Lens
Architecture 5 components touched across 2 lanes. Play the interactive walkthrough Inside the changed components — 2 viewsComponent view — Hub UI Localization Engine Internal localization engine, message catalogs, and UI translation integration Component view — Locale State & Connection Publishing Reactive locale watcher and cross-frame connection storage synchronization Data flow
Follow each request, response and payload View
Tip Untick Architecture lens or Data flow lens under View to hide a diagram, or tick Expand every detail to open every section. The comment redraws in a few seconds 🪧 More tips
Thanks for using PR Lens! It's built by Coldtea, free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Refs #398
What
@devframes/hub-uirenders through a small in-houset()(src/client/i18n) with typed keys fromen.json. Ten locales ship:en,zh-CN,zh-TW,ja,ko,es,fr,de,pt-BR,ru. English is the fallback.<select>, so it works inside the shadow root). The pick persists per browser underdevframes-locale, like the color scheme.Autofollows the host default, thennavigator.languages.createUi({ locale })publishes a host default asConnectionMeta.configs.ui.locale. The running UI writes the language it resolved back into the connection it publishes on its window (__DEVFRAME_CONNECTION__/__DEVFRAME_CONNECTION_META__), so a same-origin frame reads the effective language fromconnectionMeta.configs.ui.localeat boot.devframe/clientexportsstoreConnectionso the hub UI can refresh the published connection after mutating its meta.localeoption and how to add a language in the hub-initiate guide; at()rule in.agents/06-design-system.md.Translations
The non-English files are machine quality and marked for native review. The i18n test keeps every file in lockstep with
en.json(same keys, same{slot}placeholders), so a missing or renamed key fails CI.Deferred
@antfu/designFormSelectteleports its list todocument.body, which escapes the shadow root. Filed upstream as FormSelect: dropdown teleports to document.body and loses styles inside a shadow root antfu/design#30; the picker moves to it once fixed.Created with the help of an agent.