feat(plugins): a plugin's own translations (i18n contract) and the i18n.read bridge #45
Closed
gabrielvidal
wants to merge 0 commits from
auto-translate into main
pull from: auto-translate
merge into: gabrielvidal:main
gabrielvidal:main
gabrielvidal:fresh-context-plugin
gabrielvidal:remove-hooks-page
gabrielvidal:palette-plugins
gabrielvidal:linear-projects
gabrielvidal:agent-messaging
gabrielvidal:model-router
gabrielvidal:conv-card-layout
gabrielvidal:ask-more-options
gabrielvidal:agent-limits
gabrielvidal:generic-ui-strings
gabrielvidal:android-push-bridge
gabrielvidal:filter-chips
gabrielvidal:plugin-catalog
gabrielvidal:file-viewers
gabrielvidal:plugins-page-rework
gabrielvidal:hub-mcp-plugin
gabrielvidal:translation-plugin
gabrielvidal:scheduled-doors
gabrielvidal:cron-jobs-plugin
gabrielvidal:context-skills-plugin
gabrielvidal:files-plugins
gabrielvidal:worker-names
gabrielvidal:details-panel-perf
gabrielvidal:services-plugin-only
gabrielvidal:fix-test-env-leaks
gabrielvidal:bg-shells-plugin
gabrielvidal:feat-commits-plugins
gabrielvidal:fix-branch-line-tag-rows
gabrielvidal:retire-dead-leftovers
gabrielvidal:runner-into-harness-pi
gabrielvidal:retire-tool-proxy
gabrielvidal:new-project-policy-plugin-only
gabrielvidal:guest-jobs-sonnet
gabrielvidal:push-buttons-everywhere
gabrielvidal:mail-send-plugin
gabrielvidal:ui-polish-batch
gabrielvidal:command-palette-plugin
gabrielvidal:keyboard-shortcuts-plugin
gabrielvidal:prompt-shortcuts-plugin
gabrielvidal:matomo-site-grants
gabrielvidal:lab-chrome-plugin
gabrielvidal:performance-plugin
gabrielvidal:whats-new-plugin
gabrielvidal:skills-agents-plugin
gabrielvidal:goals-plugin-only
gabrielvidal:storage-server-side
gabrielvidal:plugin-scheduled-conversations
gabrielvidal:plugin-fences
gabrielvidal:handoff-plugin
gabrielvidal:plugin-commands
gabrielvidal:plugin-speed
gabrielvidal:cleanup-provider-harness
gabrielvidal:plugin-conversation-labels
gabrielvidal:plugin-plan-usage
gabrielvidal:fix-worker-harness-sync
gabrielvidal:plugin-gcloud-reauth
gabrielvidal:feat/plugin-cards-in-thread
gabrielvidal:feat/plugin-proxy-wake
gabrielvidal:unify-subagents-children
gabrielvidal:wave3d-frontend-typed-plugins
gabrielvidal:wave3c-sidecar-strict-plugins
gabrielvidal:wave3a-catalog-accounts-profiles
gabrielvidal:wave3b-pricing-usage-cutover
gabrielvidal:wave1a-typed-plugins
gabrielvidal:wave1b-sidecar-runtime
gabrielvidal:fix-ios-overlay-scroll
gabrielvidal:batch2-work-resources-core
gabrielvidal:batch2-apikeys
gabrielvidal:plugin-blue-green-deploy
gabrielvidal:plugin-ship
gabrielvidal:plugin-project-env
gabrielvidal:plugin-memories
gabrielvidal:plugin-activity
gabrielvidal:plugin-templates
gabrielvidal:plugin-desk-phone
gabrielvidal:batch1-platform
gabrielvidal:plugins-list-view
gabrielvidal:dash-plugins
gabrielvidal:pets-plugin
gabrielvidal:ha-push-channel
gabrielvidal:mail-agents
gabrielvidal:graph-fix
gabrielvidal:graph-plugin
gabrielvidal:services-plugin
gabrielvidal:left-to-do-plugin
gabrielvidal:plugins-gallery
gabrielvidal:home-conv-menu
gabrielvidal:meta-business
gabrielvidal:agy-rdrand
gabrielvidal:bg-lag
gabrielvidal:conv-load-perf
gabrielvidal:askform-instant
gabrielvidal:fix/drawer-menu-done-chip
gabrielvidal:pi-midrun-compaction
gabrielvidal:interrupt-menu-btn
gabrielvidal:authz
gabrielvidal:inkling
gabrielvidal:repo-plugins
gabrielvidal:work-sync
gabrielvidal:leftovers
gabrielvidal:fix/agy-guest-guard
gabrielvidal:feat/model-presets
gabrielvidal:scroll-back
gabrielvidal:feedback-bell
gabrielvidal:feat/movies-tool
gabrielvidal:feat/running-thread-padding
gabrielvidal:feat/drawer-filter-button-card-chat
gabrielvidal:burn-rate
gabrielvidal:guest-install
gabrielvidal:guest-usage
gabrielvidal:guest-palette
gabrielvidal:guest-form-links
gabrielvidal:form-open-buttons
gabrielvidal:clarifier-lean
gabrielvidal:auto-archive
gabrielvidal:guests-profile
gabrielvidal:conv-motion
gabrielvidal:share-target
gabrielvidal:terminal-sync
gabrielvidal:work-context-past
gabrielvidal:work-context-brief
gabrielvidal:enroll-codes
gabrielvidal:open-image-file
gabrielvidal:worker-uploads
gabrielvidal:conv-drawer-search
gabrielvidal:stack-motion-v3
gabrielvidal:notif-stack-fixes
gabrielvidal:home-motion
gabrielvidal:i18n-fr
gabrielvidal:local-electricity-cost
gabrielvidal:cache-pill-thread
gabrielvidal:cache-scenarios
gabrielvidal:fresh-start
gabrielvidal:msg-select
gabrielvidal:shortcuts-setup
gabrielvidal:ui-0-40-3
gabrielvidal:outbox-landing
gabrielvidal:resume-scope
gabrielvidal:conv-filter-range
gabrielvidal:fix-subagent-form-session
gabrielvidal:ask-form-integration
gabrielvidal:form-visual-options
gabrielvidal:watcher-perf
gabrielvidal:last-msg-summary
gabrielvidal:secret-fields
gabrielvidal:commit-review
gabrielvidal:summary-mode-fixes
gabrielvidal:service-tag-parser
gabrielvidal:clarifier
gabrielvidal:fetch-diet-2
gabrielvidal:fetch-diet
gabrielvidal:conv-look
gabrielvidal:pwa-links
gabrielvidal:tool-widgets
gabrielvidal:worker-autoupdate
gabrielvidal:usage-rings
gabrielvidal:opencode-harness
gabrielvidal:notif-diet
gabrielvidal:conv-resources
gabrielvidal:scheduled-tasks
gabrielvidal:profiles
gabrielvidal:notify-exact-cost
gabrielvidal:usage-measuring
gabrielvidal:guest-projects
gabrielvidal:usage-calibration
gabrielvidal:account-switch
gabrielvidal:multiuser-improve
gabrielvidal:form-groups
gabrielvidal:multiuser
gabrielvidal:motion-reel
gabrielvidal:dashboards-fixes
gabrielvidal:split-big-files
gabrielvidal:held-regex
gabrielvidal:subagent-interrupts
gabrielvidal:form-html
gabrielvidal:tokunia-video
gabrielvidal:settings-uniform
gabrielvidal:worker-ask-fix
gabrielvidal:worker-generic-mac
gabrielvidal:runner-shortcuts
gabrielvidal:notify-unify
gabrielvidal:perf-list-cache
gabrielvidal:mac-worker
gabrielvidal:model-switch
gabrielvidal:pipeline-paths
gabrielvidal:multi-account
gabrielvidal:feature-flags
gabrielvidal:qwen38-support
gabrielvidal:url-prompt
gabrielvidal:running-pages
gabrielvidal:homelab-tag
gabrielvidal:root-project
gabrielvidal:or-models
gabrielvidal:deploying-loader
gabrielvidal:worktree-diff
gabrielvidal:conv-tags
gabrielvidal:tags-page
gabrielvidal:agents-page
gabrielvidal:icon-picker-shortcuts
gabrielvidal:conv-cta
gabrielvidal:stamp-refine
gabrielvidal:post-task-cache
gabrielvidal:post-tidy-completed
gabrielvidal:form-badge
gabrielvidal:hooks-delay-seconds
gabrielvidal:cost-dashboard
gabrielvidal:plan-forms
gabrielvidal:form-mobile
gabrielvidal:guidelines-dag
gabrielvidal:skills-view
gabrielvidal:navbar-hold
gabrielvidal:spawnbox-status
gabrielvidal:hold-editable-expand
gabrielvidal:drawer-transparent
gabrielvidal:hold-fix
gabrielvidal:hold-editable
gabrielvidal:charroll-bump
No Reviewers
Labels
No items
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
gabrielvidal (Gabriel Vidal)
Clear assignees
No Assignees
gabrielvidal
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gabrielvidal/ai-agent#45
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
A plugin can now carry its own translated strings in a shared format, and the hub reports what each plugin and each translation is missing. This is what the
auto-translateplugin (ai-agent-plugins #34) reads to keep translations up to date. Decided in formauto-translate-plugin_ovprq0.Merge after #38 and #39: this branch sits on top of both, so until they are merged the diff here shows their commits too.
Key changes
backend/plugins/plugin_i18n.py: the contract. A plugin declares"i18n": "i18n"; the folder holdsen.json(the English source list) and one<lang>.jsonper language. The hub adds every language that has a file to the plugin'slanguages.GET /api/plugins/i18n/{lang}: the caller's active plugins' dictionaries in one call (ETag). A guest gets their own installs and the managed plugins granted to them, nothing else.init.i18nand translate withaiAgentPlugin.t()/tn(); the device keeps a copy. Manifest labels use the plugin's dictionary, then the core's, then English. Handlers get the installed languages (AIA_LANGS).backend/plugins/hubi18n.py: an owner-only bridge,i18n.read, that reports from files only what each translation and each plugin is missing or holds stale.workers.readalso says when a machine was last seen and whether a run wakes it (about ten lines inplugins/hubruns.py), so a plugin can tell an asleep machine from a gone one.Key decisions
Changelog
i18n/<lang>.json, and each plugin's page shows what is missing per language.Test notes
test_typed_pluginswhen run from~/worktrees(it passes from a copy elsewhere; same on the base). I re-rantest_plugin_i18n(14),test_i18n(35),test_authz_matrix(2),test_plugin_categories(8) andtest_gate(15): all pass.tscclean; vitest 1105 of 1107.FreshContextfails the same way onmain;reachabilityis flaky (passed twice, failed once alone) and is not touched by this diff.i18n/fr.json; coverage rows on a plugin's page (screenshots below).Screenshots
The core speaks English only; every other language is a kind: "translation" plugin (translation-<lang>; the French one is translation-fr in ai-agent-plugins, seeded once at start). - plugins: kind translation (typed_manifest.parse_translation: lang, name, englishName, flag, locale, promptLine, ui/backend JSON dictionaries — strict, operator-only, in the fingerprint); a top-level "languages" field on any plugin (default ["en"]) shown on its page; seeding takes translation-*; plugins/translations.py reads the enabled ones (first by id wins a code). - core/i18n: tr / langs / localized / clean_pref / effective_lang read the installed translations; a pick whose translation is gone reads English and is kept; browserLang records any base code. core/i18n_fr.py and FRENCH_LINE are gone (language_line = the plugin's promptLine). - The owner picks a language too (users.json ownerLang, PUT /api/me {lang}; English by default). - Public GET /api/i18n/languages and /api/i18n/{lang} (ETag/304), guest host and sign-in included. - Coverage: backend/core/i18n_keys/{ui,backend}.json (kept by the two i18n tests, UPDATE_I18N_KEYS=1); a translation's page shows translated / missing / stale / placeholder mismatches. - Frontend: frontend/src/i18n/fr removed; the dictionary comes from the hub, cached in localStorage and revalidated in the background (first boot in a language waits <= 4 s, any failure is English); Lang is a string; number/currency style from the translation's locale; LanguageSelect lists English + installed translations (hidden when none); Settings → Plugins has a Translations kind (tab, catalog filter, group) and a Translation section with the missing-strings count; mock is English only. - Tests: test_i18n.py rewritten on a made-up translation; i18n_testkit.speaking() for the tests that need a second language. authz golden, openapi.json + src/generated regenerated; docs/plugins.md (Translations), CLAUDE.md, i18n README, docs/settings.md. Changelog - Added: languages are plugins — Settings → Plugins → Translations; the owner can pick a language. - Changed: French moved to the translation-fr plugin (seeded at start: nothing changes for guests). - Removed: the core's built-in French dictionaries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>A plugin's translations now live in that plugin: "i18n": "i18n" in plugin.json → i18n/en.json (the English source list, generated by the plugins repo's scripts/plugin_i18n.py) + i18n/<lang>.json (English → translation). - plugins/plugin_i18n.py: validation (the folder, en.json an array, each <lang>.json an object; every file's language added to `languages`), per-language coverage (missing / stale / placeholder mismatches), the bundle. - GET /api/plugins/i18n/{lang}: every active plugin's dictionary in one ETag'd body (a guest: their installs + the managed plugins granted to them). - Frames: init.i18n + init.locale, aiAgentPlugin.t / tn (English fallback). - Manifest labels (nav, drawers, header, Files/Projects/Dashboards, settings subtitle + fields) through pluginT: plugin dictionary → core t() → English. - Handlers get AIA_LANGS (the hub's languages); they read their own file. - /api/plugins/{id}/info|settings carry `i18n` coverage; the plugin page shows "Its strings in <language>" rows. - plugins/hubi18n.py: the owner-only i18n.read bridge (operator approval) — translations' and plugins' coverage, files only — for the auto-translate plugin. - docs/plugins.md ("A plugin's own strings"), CLAUDE.md, i18n README; openapi + generated types, authz golden, ui key list regenerated. Changelog - Added: plugins can ship their own translations (i18n/<lang>.json), shown per language on their page. - Added: the i18n.read bridge the auto-translate plugin uses to keep translations complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>Merged into
mainas1365b6aaby the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/cadefe6f-0940-4688-bc56-1306d9265430.Pull request closed