Skip to content

Conversation

@KariHall619
Copy link
Contributor

@KariHall619 KariHall619 commented Oct 12, 2025

What type of PR is this?
feat(console): improve extension plugin loading robustness

What this PR does / why we need it:

  • Make the necessary changes so that the plugin's front-end refactoring can run properly with the main project.
  • Pass i18n, API, and Cache context into extension plugins to keep them aligned with the host app
  • Harden the extension loading pipeline with retries and explicit error logging, replacing silent catches

Modified Extension.vue to pass i18n, API, and Cache context to plugins.
This enables plugins to use main app's resources directly for seamless integration.

- Import useI18n from vue-i18n and Cache from ./cache
- Initialize i18n in component setup
- Create context object with i18n, API, and Cache
- Pass context as second parameter to plugin.mount()
Added comprehensive AI-related translations for both English and Chinese locales.
This enables the AI plugin to use main app's i18n directly for seamless language switching.

- Added ai.title, ai.subtitle sections
- Added ai.settings with all configuration labels
- Added ai.button with action labels
- Added ai.status for connection states
- Added ai.input, ai.option for user inputs
- Added ai.welcome for welcome messages
- Added ai.provider for provider descriptions
- Added ai.message for user feedback messages
- Remove unused 'language' key from ai.settings (plugin no longer has language option)
- Add 'copiedSuccess' message for clipboard copy feedback
- Ensure consistency between English and Chinese translations

Plugin language is now fully controlled by main app settings,
with no duplicate language selection in plugin UI.
Added handleStore() calls in GetStores and getLoaderByStoreName to
automatically fill empty socket URLs using GetExtensionSocketPath().

This ensures stores loaded from config file get correct socket paths
without hardcoding user-specific paths, making the configuration
portable across different users and systems.

Fixes issue where AI extension showed "Not Ready" status due to
outdated socket path in stores.yaml configuration.
@sonarqubecloud
Copy link

};
try {
plugin.mount(container, context);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已有的插件只有一个参数,这样会导致不兼容。另外 i18n 应该是在插件里实现。不可能把所有插件的 i18n 都写在 core 里。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到这个问题!

@LinuxSuRen LinuxSuRen added ospp 开源之夏 https://summer-ospp.ac.cn/ chore skip-changelog labels Oct 25, 2025
@KariHall619 KariHall619 deleted the fronted branch October 27, 2025 12:16
@KariHall619
Copy link
Contributor Author

这个pr的提交存在一些问题, 我会把它的修改合并到另外一个pr里. 减少复杂度

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

Labels

chore ospp 开源之夏 https://summer-ospp.ac.cn/ skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants