feat(plugins): add plugin i18n foundation (Phase 0-1)

- Add i18n field to PluginManifest type in plugin-api package
- Create PluginI18nService for translation management
  - Load translations from file paths or cached content
  - Nested key lookup with dot notation (e.g., BUTTONS.SAVE)
  - Smart fallback: current language → English → key
  - Parameter interpolation with {{param}} syntax
  - Language switching via signals
  - Memory cleanup for unloaded plugins
- Add type validation for cached translation content
- Document language sync integration points

Part of plugin internationalization system implementation.
Tests will be added in Phase 8.
This commit is contained in:
Johannes Millan 2026-01-16 16:17:41 +01:00
parent 0177b4860d
commit 95578ef77b
2 changed files with 213 additions and 0 deletions

View file

@ -116,6 +116,9 @@ export interface PluginManifest {
nodeScriptConfig?: PluginNodeScriptConfig;
sidePanel?: boolean; // If true, plugin loads in right panel instead of route
jsonSchemaCfg?: string; // Path to JSON schema file for plugin configuration relative to plugin root
i18n?: {
languages: string[]; // Array of supported language codes (e.g., ['en', 'de', 'fr'])
};
}
// Hook payload types