From 1a460646cd00137d513b8d010bf275ab5615c5cc Mon Sep 17 00:00:00 2001 From: insistence <3055204202@qq.com> Date: Fri, 30 Oct 2026 19:55:27 +0800 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20=E6=8E=A5=E5=85=A5=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E4=B8=8E=E5=85=AD=E7=AB=AF=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-backend.yml | 10 + .github/workflows/ci-frontend.yml | 4 + .gitignore | 3 + ruoyi-fastapi-backend/.dockerignore | 2 + ruoyi-fastapi-backend/.env.dev | 4 + ruoyi-fastapi-backend/.env.dockermy | 4 + ruoyi-fastapi-backend/.env.dockerpg | 4 + ruoyi-fastapi-backend/.env.prod | 4 + .../.x18n/tooling/package-lock.json | 1417 +++++++++++ .../.x18n/tooling/package.json | 15 + .../.x18n/tooling/tests/usage.test.mjs | 81 + ruoyi-fastapi-backend/Dockerfile.my | 2 + ruoyi-fastapi-backend/Dockerfile.pg | 2 + .../plugin/scaffold/assets/web/dev.html.tmpl | 1 + .../plugin/scaffold/assets/web/dev.js.tmpl | 12 +- .../plugin/scaffold/assets/web/i18n.js.tmpl | 107 + .../scaffold/assets/web/index.html.tmpl | 10 +- .../plugin/scaffold/assets/web/main.js.tmpl | 73 +- .../scaffold/assets/web/package.json.tmpl | 5 +- .../scaffold/assets/web/x18n.config.mjs.tmpl | 11 + .../cli/runtime/plugin/scaffold/builder.py | 2 + .../cli/runtime/plugin/scaffold/frontend.py | 75 +- .../runtime/plugin/scaffold/frontend_react.py | 58 +- .../runtime/plugin/scaffold/frontend_vue2.py | 80 +- .../cli/runtime/plugin/scaffold/locales.py | 199 ++ .../cli/runtime/plugin/scaffold/v2.py | 12 +- .../common/annotation/cache_annotation.py | 4 + .../common/aspect/interface_auth.py | 4 +- ruoyi-fastapi-backend/common/context.py | 63 +- ruoyi-fastapi-backend/common/vo.py | 4 + ruoyi-fastapi-backend/config/env.py | 17 + ruoyi-fastapi-backend/exceptions/exception.py | 66 +- ruoyi-fastapi-backend/exceptions/handle.py | 54 +- ruoyi-fastapi-backend/i18n/__init__.py | 3 + .../i18n/catalogs/en-US/LC_MESSAGES/core.po | 1885 ++++++++++++++ .../i18n/catalogs/zh-CN/LC_MESSAGES/core.po | 1869 ++++++++++++++ ruoyi-fastapi-backend/i18n/locale.py | 77 + ruoyi-fastapi-backend/i18n/message.py | 29 + ruoyi-fastapi-backend/i18n/registry.py | 109 + ruoyi-fastapi-backend/i18n/translation.py | 81 + ruoyi-fastapi-backend/i18n/translator.py | 130 + .../middlewares/context_middleware.py | 3 + .../middlewares/cors_middleware.py | 2 + .../middlewares/demo_mode_middleware.py | 2 +- ruoyi-fastapi-backend/middlewares/handle.py | 3 + .../middlewares/locale_middleware.py | 49 + .../transport_crypto_middleware.py | 12 +- .../controller/cache_controller.py | 18 +- .../controller/config_controller.py | 20 +- .../controller/dept_controller.py | 16 +- .../controller/dict_controller.py | 40 +- .../controller/file_controller.py | 58 +- .../module_admin/controller/job_controller.py | 51 +- .../module_admin/controller/log_controller.py | 28 +- .../controller/login_controller.py | 13 +- .../controller/menu_controller.py | 16 +- .../controller/notice_controller.py | 22 +- .../controller/online_controller.py | 6 +- .../controller/post_controller.py | 12 +- .../controller/role_controller.py | 40 +- .../controller/user_controller.py | 67 +- .../module_admin/dao/dict_dao.py | 15 + .../module_admin/dao/menu_dao.py | 7 + .../module_admin/entity/do/dict_do.py | 4 +- .../module_admin/entity/do/menu_do.py | 3 +- .../module_admin/entity/do/user_do.py | 1 + .../module_admin/entity/vo/config_vo.py | 30 +- .../module_admin/entity/vo/dept_vo.py | 32 +- .../module_admin/entity/vo/dict_vo.py | 102 +- .../module_admin/entity/vo/job_vo.py | 24 +- .../module_admin/entity/vo/login_vo.py | 3 +- .../module_admin/entity/vo/menu_vo.py | 59 +- .../module_admin/entity/vo/notice_vo.py | 17 +- .../module_admin/entity/vo/post_vo.py | 21 +- .../module_admin/entity/vo/role_vo.py | 21 +- .../module_admin/entity/vo/user_vo.py | 78 +- .../module_admin/service/cache_service.py | 16 +- .../module_admin/service/common_service.py | 35 +- .../module_admin/service/config_service.py | 55 +- .../module_admin/service/dept_service.py | 66 +- .../module_admin/service/dict_service.py | 123 +- .../service/file_access_service.py | 40 +- .../service/file_business_service.py | 70 +- .../module_admin/service/file_service.py | 176 +- .../module_admin/service/job_log_service.py | 58 +- .../module_admin/service/job_service.py | 94 +- .../module_admin/service/log_service.py | 86 +- .../module_admin/service/login_service.py | 39 +- .../module_admin/service/menu_service.py | 81 +- .../module_admin/service/notice_service.py | 26 +- .../module_admin/service/online_service.py | 4 +- .../module_admin/service/post_service.py | 65 +- .../module_admin/service/role_service.py | 75 +- .../module_admin/service/server_service.py | 7 +- .../module_admin/service/user_service.py | 223 +- .../controller/gen_controller.py | 26 +- .../module_generator/dao/gen_dao.py | 5 +- .../module_generator/entity/vo/gen_vo.py | 42 +- .../module_generator/service/gen_service.py | 177 +- .../templates/python/service.py.jinja2 | 55 +- .../templates/python/vo.py.jinja2 | 30 +- .../templates/vue/index-tree.vue.jinja2 | 134 +- .../templates/vue/index.vue.jinja2 | 164 +- .../templates/vue/v3/index-tree.vue.jinja2 | 128 +- .../templates/vue/v3/index.vue.jinja2 | 158 +- .../templates/vue/v3/view.vue.jinja2 | 7 +- .../templates/vue/view.vue.jinja2 | 6 +- .../controller/oauth_client_controller.py | 12 +- .../controller/oauth_resource_controller.py | 4 +- .../controller/oauth_session_controller.py | 10 +- .../controller/oidc_key_controller.py | 8 +- .../service/identity_service.py | 54 +- .../module_identity/service/key_service.py | 2 +- .../oauth_session_management_service.py | 10 +- .../controller/plugin_controller.py | 81 +- .../controller/plugin_metrics_controller.py | 2 +- .../controller/plugin_release_controller.py | 2 +- .../ai/controller/ai_chat_controller.py | 21 +- .../ai/controller/ai_model_controller.py | 16 +- .../plugins/ai/entity/vo/ai_model_vo.py | 19 +- ruoyi-fastapi-backend/plugins/ai/plugin.yaml | 19 + .../plugins/ai/service/ai_chat_service.py | 77 +- .../plugins/ai/service/ai_model_service.py | 14 +- .../plugins/core/deployment/catalog.py | 12 +- .../plugins/core/deployment/enablement.py | 5 +- .../plugins/core/deployment/service.py | 28 +- .../plugins/core/lifecycle/precheck.py | 25 +- .../plugins/core/management/dao/dao.py | 6 + .../plugins/core/management/service/menus.py | 2 + .../core/management/service/service.py | 43 +- .../plugins/core/manifest/schema.py | 39 + .../plugins/core/runtime/health.py | 13 +- .../plugins/core/runtime/result.py | 7 +- .../plugins/core/runtime/route_guard.py | 2 +- .../plugins/core/runtime/service/batch.py | 23 +- .../plugins/core/runtime/service/config.py | 11 +- .../plugins/core/runtime/service/context.py | 9 +- .../core/runtime/service/dependencies.py | 13 +- .../core/runtime/service/lifecycle/enable.py | 19 +- .../core/runtime/service/lifecycle/install.py | 15 +- .../core/runtime/service/lifecycle/purge.py | 17 +- .../core/runtime/service/lifecycle/upgrade.py | 11 +- .../core/runtime/service/lifecycle_lock.py | 11 +- .../plugins/core/runtime/service/migration.py | 35 +- .../plugins/core/runtime/service/precheck.py | 10 +- .../plugins/core/runtime/service/query.py | 42 +- .../plugins/core/runtime/service/tools.py | 5 +- .../core/runtime/support/batch_report.py | 18 +- .../core/runtime/support/payload/audit.py | 8 +- .../core/runtime/support/payload/base.py | 17 +- .../core/runtime/support/payload/common.py | 8 +- .../core/runtime/support/payload/config.py | 5 +- .../runtime/support/payload/dependencies.py | 7 +- .../runtime/support/payload/documentation.py | 3 +- .../core/runtime/support/payload/enable.py | 9 +- .../core/runtime/support/payload/lifecycle.py | 15 +- .../core/runtime/support/payload/plan.py | 9 +- .../core/runtime/support/payload/purge.py | 7 +- .../core/runtime/support/payload/runtime.py | 23 +- .../plugins/core/validation/dependencies.py | 17 +- .../plugins/core/validation/manifest.py | 138 +- .../plugins/core/validation/menus.py | 19 +- .../plugins/core/validation/plugin_deps.py | 25 +- .../plugins/core/validation/structure.py | 31 +- ruoyi-fastapi-backend/requirements-pg.txt | 1 + ruoyi-fastapi-backend/requirements-test.txt | 2 +- ruoyi-fastapi-backend/requirements.txt | 1 + ruoyi-fastapi-backend/scripts/compile_i18n.py | 35 + ruoyi-fastapi-backend/scripts/migrate_i18n.py | 170 ++ ruoyi-fastapi-backend/server.py | 2 + ruoyi-fastapi-backend/sql/i18n-seeds.json | 2204 +++++++++++++++++ .../sql/ruoyi-fastapi-pg.sql | 561 +++-- ruoyi-fastapi-backend/sql/ruoyi-fastapi.sql | 558 +++-- .../runtime/plugin/test_scaffold_locales.py | 59 + .../tests/config/test_i18n_settings.py | 104 + .../tests/i18n/test_excel_i18n.py | 121 + .../tests/i18n/test_locale.py | 294 +++ .../tests/i18n/test_plugin_messages.py | 55 + .../tests/i18n/test_translation_migration.py | 70 + .../tests/i18n/test_translations.py | 194 ++ .../controller/test_dept_controller.py | 9 +- .../controller/test_user_controller.py | 9 +- .../module_generator/test_generated_i18n.py | 362 +++ .../test_generated_time_contract.py | 8 +- .../module_generator/test_react_templates.py | 8 +- .../core/management/test_menu_installer.py | 29 + .../core/management/test_plugin_state.py | 1 + .../plugins/sample_plugins/test_ai_i18n.py | 50 + .../tests/sql/test_plugin_schema.py | 7 +- .../tests/utils/test_template_util.py | 5 +- ruoyi-fastapi-backend/utils/excel_util.py | 53 +- ruoyi-fastapi-backend/utils/exception_util.py | 1 + ruoyi-fastapi-backend/utils/file_util.py | 6 +- ruoyi-fastapi-backend/utils/gen_i18n_util.py | 361 +++ ruoyi-fastapi-backend/utils/jwt_util.py | 4 +- ruoyi-fastapi-backend/utils/response_util.py | 130 +- ruoyi-fastapi-backend/utils/template_util.py | 18 +- ruoyi-fastapi-backend/utils/time_util.py | 9 +- .../utils/user_import_util.py | 83 + ruoyi-fastapi-backend/x18n.config.yml | 19 + .../react/mobile/package.json | 7 +- .../react/mobile/pnpm-lock.yaml | 736 +++++- .../react/mobile/scripts/check-i18n.mjs | 18 + .../react/mobile/src/app.jsx | 15 +- .../react/mobile/src/app.rn.jsx | 25 +- .../src/components/LanguageSelect/index.jsx | 43 + .../react/mobile/src/i18n/adapter.js | 10 + .../react/mobile/src/i18n/error.js | 9 + .../react/mobile/src/i18n/help.js | 32 + .../react/mobile/src/i18n/index.js | 32 + .../react/mobile/src/i18n/locale-meta.json | 24 + .../mobile/src/i18n/locales/en-US/common.json | 33 + .../mobile/src/i18n/locales/en-US/mobile.json | 192 ++ .../mobile/src/i18n/locales/zh-CN/common.json | 33 + .../mobile/src/i18n/locales/zh-CN/mobile.json | 192 ++ .../react/mobile/src/i18n/navigation.js | 45 + .../react/mobile/src/i18n/preference.js | 17 + .../react/mobile/src/i18n/registry.js | 11 + .../react/mobile/src/i18n/runtime.mjs | 216 ++ .../src/pages/common/agreement/index.jsx | 44 +- .../mobile/src/pages/common/privacy/index.jsx | 63 +- .../src/pages/common/textview/index.jsx | 19 +- .../mobile/src/pages/common/webview/index.jsx | 6 +- .../react/mobile/src/pages/index.jsx | 46 +- .../react/mobile/src/pages/login.jsx | 49 +- .../mobile/src/pages/mine/about/index.jsx | 14 +- .../mobile/src/pages/mine/avatar/index.jsx | 25 +- .../mobile/src/pages/mine/help/index.jsx | 50 +- .../react/mobile/src/pages/mine/index.jsx | 24 +- .../react/mobile/src/pages/mine/info/edit.jsx | 43 +- .../mobile/src/pages/mine/info/index.jsx | 28 +- .../react/mobile/src/pages/mine/pwd/index.jsx | 31 +- .../mobile/src/pages/mine/setting/index.jsx | 26 +- .../src/pages/mine/setting/timezone.jsx | 54 +- .../react/mobile/src/pages/register.jsx | 57 +- .../react/mobile/src/pages/work/index.jsx | 40 +- .../react/mobile/src/plugins/modal.js | 9 +- .../react/mobile/src/store/modules/user.js | 3 + .../react/mobile/src/utils/common.js | 7 +- .../react/mobile/src/utils/errorCode.js | 20 +- .../react/mobile/src/utils/request.js | 22 +- .../react/mobile/src/utils/transportCrypto.js | 3 + .../react/mobile/src/utils/upload.js | 10 +- .../react/mobile/tests/i18n/runtime.test.mjs | 138 ++ .../react/mobile/tests/i18n/x18n.test.mjs | 70 + .../react/mobile/x18n.config.mjs | 29 + ruoyi-fastapi-frontend/react/web/package.json | 8 +- .../react/web/plugins/ai/locales/en-US.json | 97 + .../react/web/plugins/ai/locales/zh-CN.json | 97 + .../ai/views/chat/components/AiMessage.jsx | 10 +- .../react/web/plugins/ai/views/chat/index.jsx | 130 +- .../react/web/plugins/ai/views/chat/stream.js | 5 +- .../web/plugins/ai/views/model/index.jsx | 106 +- .../react/web/pnpm-lock.yaml | 872 ++++++- .../react/web/scripts/check-i18n.mjs | 21 + .../react/web/scripts/x18n-project.mjs | 26 + ruoyi-fastapi-frontend/react/web/src/App.jsx | 6 +- .../web/src/components/Breadcrumb/index.jsx | 19 +- .../BusinessDateTimePicker/index.jsx | 24 +- .../components/BusinessFileUpload/index.jsx | 30 +- .../components/BusinessFileUpload/model.js | 13 +- .../react/web/src/components/Crontab/day.jsx | 6 +- .../web/src/components/Crontab/field.jsx | 138 +- .../react/web/src/components/Crontab/hour.jsx | 6 +- .../web/src/components/Crontab/index.jsx | 40 +- .../react/web/src/components/Crontab/min.jsx | 6 +- .../web/src/components/Crontab/month.jsx | 6 +- .../web/src/components/Crontab/result.jsx | 19 +- .../web/src/components/Crontab/second.jsx | 6 +- .../react/web/src/components/Crontab/week.jsx | 6 +- .../react/web/src/components/Crontab/year.jsx | 6 +- .../web/src/components/DetailPanel/index.jsx | 16 +- .../react/web/src/components/EChart/index.jsx | 6 +- .../react/web/src/components/Editor/index.jsx | 14 +- .../components/ExcelImportDialog/index.jsx | 22 +- .../web/src/components/FileUpload/index.jsx | 30 +- .../web/src/components/FormLabel/index.jsx | 6 +- .../components/GeneratorControls/index.jsx | 26 +- .../web/src/components/Hamburger/index.jsx | 6 +- .../web/src/components/HeaderSearch/index.jsx | 37 +- .../web/src/components/IconSelect/index.jsx | 16 +- .../web/src/components/JsonEditor/index.jsx | 35 +- .../src/components/JsonEditor/validation.js | 6 +- .../src/components/LanguageSelect/index.jsx | 38 + .../src/components/LoadingProgress/index.jsx | 8 +- .../components/OAuthWorkspace/AccessMap.jsx | 30 +- .../components/OAuthWorkspace/EntityCell.jsx | 6 +- .../components/OAuthWorkspace/FieldLabel.jsx | 6 +- .../components/OAuthWorkspace/PageFrame.jsx | 8 +- .../OAuthWorkspace/StringListInput.jsx | 8 +- .../web/src/components/Pagination/index.jsx | 18 +- .../web/src/components/PluginFrame/index.jsx | 40 +- .../web/src/components/RightToolbar/index.jsx | 22 +- .../web/src/components/RuoYi/Doc/index.jsx | 8 +- .../web/src/components/RuoYi/Git/index.jsx | 8 +- .../web/src/components/Screenfull/index.jsx | 10 +- .../web/src/components/SizeSelect/index.jsx | 12 +- .../src/components/SystemLoading/index.jsx | 8 +- .../react/web/src/components/Table/index.jsx | 6 +- .../components/TranslationFields/index.jsx | 28 + .../web/src/components/TreePanel/index.jsx | 24 +- .../react/web/src/components/iFrame/index.jsx | 6 +- .../web/src/directive/common/copyText.js | 3 +- .../react/web/src/i18n/adapter.js | 10 + .../react/web/src/i18n/entities.mjs | 18 + .../react/web/src/i18n/form.js | 23 + .../react/web/src/i18n/generated.mjs | 9 + .../react/web/src/i18n/index.js | 49 + .../react/web/src/i18n/locale-meta.json | 24 + .../web/src/i18n/locales/en-US/auth.json | 46 + .../src/i18n/locales/en-US/authCenter.json | 151 ++ .../web/src/i18n/locales/en-US/common.json | 452 ++++ .../web/src/i18n/locales/en-US/file.json | 77 + .../web/src/i18n/locales/en-US/layout.json | 114 + .../web/src/i18n/locales/en-US/monitor.json | 437 ++++ .../src/i18n/locales/en-US/pluginAdmin.json | 123 + .../web/src/i18n/locales/en-US/system.json | 1177 +++++++++ .../web/src/i18n/locales/en-US/tool.json | 318 +++ .../web/src/i18n/locales/zh-CN/auth.json | 46 + .../src/i18n/locales/zh-CN/authCenter.json | 149 ++ .../web/src/i18n/locales/zh-CN/common.json | 452 ++++ .../web/src/i18n/locales/zh-CN/file.json | 77 + .../web/src/i18n/locales/zh-CN/layout.json | 114 + .../web/src/i18n/locales/zh-CN/monitor.json | 437 ++++ .../src/i18n/locales/zh-CN/pluginAdmin.json | 122 + .../web/src/i18n/locales/zh-CN/system.json | 1177 +++++++++ .../web/src/i18n/locales/zh-CN/tool.json | 318 +++ .../react/web/src/i18n/message.mjs | 10 + .../react/web/src/i18n/preference.js | 17 + .../react/web/src/i18n/registry.js | 49 + .../react/web/src/i18n/runtime.mjs | 216 ++ .../components/HeaderNotice/DetailView.jsx | 22 +- .../layout/components/HeaderNotice/index.jsx | 18 +- .../src/layout/components/InnerLink/index.jsx | 7 +- .../web/src/layout/components/Navbar.jsx | 24 +- .../src/layout/components/Settings/index.jsx | 70 +- .../layout/components/Sidebar/Scrollbar.jsx | 6 +- .../src/layout/components/Sidebar/index.jsx | 15 +- .../src/layout/components/TagsView/index.jsx | 71 +- .../src/layout/components/TopNav/index.jsx | 16 +- .../react/web/src/layout/index.jsx | 28 +- ruoyi-fastapi-frontend/react/web/src/main.jsx | 15 +- .../react/web/src/plugins/download.js | 67 +- .../react/web/src/plugins/modal.jsx | 15 +- .../react/web/src/plugins/tab.js | 4 +- .../react/web/src/router/index.jsx | 22 +- .../react/web/src/store/modules/tagsView.js | 40 +- .../react/web/src/store/modules/user.js | 7 +- .../react/web/src/utils/dict.js | 13 +- .../react/web/src/utils/errorCode.js | 21 +- .../react/web/src/utils/generator/config.js | 173 +- .../react/web/src/utils/generator/controls.js | 5 +- .../react/web/src/utils/generator/js.js | 32 +- .../react/web/src/utils/generator/model.js | 8 +- .../react/web/src/utils/generator/render.jsx | 10 +- .../react/web/src/utils/index.js | 28 +- .../react/web/src/utils/job.js | 91 +- .../react/web/src/utils/locale.js | 8 +- .../react/web/src/utils/oauthUri.js | 23 +- .../react/web/src/utils/passwordRule.js | 44 +- .../react/web/src/utils/pluginBridge.d.ts | 5 + .../react/web/src/utils/pluginBridge.js | 335 ++- .../web/src/utils/pluginPlanFormatter.js | 38 +- .../web/src/utils/pluginReleaseFormatter.js | 76 +- .../react/web/src/utils/pluginSse.js | 30 +- .../react/web/src/utils/request.js | 34 +- .../react/web/src/utils/time.js | 58 +- .../react/web/src/utils/transportCrypto.js | 66 +- .../src/views/auth-center/AuthCenterShell.jsx | 40 +- .../src/views/auth-center/changePassword.jsx | 75 +- .../web/src/views/auth-center/consent.jsx | 79 +- .../react/web/src/views/auth-center/error.jsx | 36 +- .../react/web/src/views/auth-center/login.jsx | 62 +- .../src/views/auth-center/useInteraction.js | 13 +- .../react/web/src/views/dashboard/data.js | 157 +- .../views/dashboard/editable-link-group.jsx | 22 +- .../react/web/src/views/dashboard/index.jsx | 54 +- .../react/web/src/views/error/401.jsx | 16 +- .../react/web/src/views/error/404.jsx | 14 +- .../react/web/src/views/lock.jsx | 37 +- .../react/web/src/views/login.jsx | 34 +- .../web/src/views/monitor/cache/index.jsx | 49 +- .../web/src/views/monitor/cache/list.jsx | 50 +- .../web/src/views/monitor/druid/index.jsx | 6 +- .../web/src/views/monitor/job/detail.jsx | 155 +- .../react/web/src/views/monitor/job/index.jsx | 165 +- .../react/web/src/views/monitor/job/log.jsx | 62 +- .../web/src/views/monitor/job/runtime.jsx | 104 +- .../src/views/monitor/logininfor/index.jsx | 64 +- .../src/views/monitor/oauthAudit/formatter.js | 313 ++- .../src/views/monitor/oauthAudit/index.jsx | 132 +- .../web/src/views/monitor/online/index.jsx | 46 +- .../web/src/views/monitor/operlog/detail.jsx | 45 +- .../web/src/views/monitor/operlog/index.jsx | 70 +- .../web/src/views/monitor/server/index.jsx | 68 +- .../views/monitor/transportCrypto/index.jsx | 209 +- .../react/web/src/views/register.jsx | 47 +- .../web/src/views/system/config/index.jsx | 92 +- .../react/web/src/views/system/dept/index.jsx | 84 +- .../react/web/src/views/system/dict/data.jsx | 146 +- .../web/src/views/system/dict/detail.jsx | 30 +- .../react/web/src/views/system/dict/index.jsx | 105 +- .../system/file/components/FileAclDrawer.jsx | 107 +- .../file/components/FileAuditDrawer.jsx | 154 +- .../file/components/FileDetailDialog.jsx | 68 +- .../file/components/FileReconcileDrawer.jsx | 147 +- .../file/components/FileReferenceDrawer.jsx | 31 +- .../components/FileRetentionPolicyDrawer.jsx | 72 +- .../FileRetentionReminderDrawer.jsx | 127 +- .../system/file/components/FileSearchForm.jsx | 60 +- .../system/file/components/FileStatistics.jsx | 49 +- .../system/file/components/FileTable.jsx | 78 +- .../file/components/FileTransferDialog.jsx | 45 +- .../system/file/components/fileFormatters.js | 125 +- .../file/components/reconcileFormatters.js | 153 +- .../react/web/src/views/system/file/index.jsx | 43 +- .../react/web/src/views/system/menu/index.jsx | 180 +- .../web/src/views/system/notice/ReadUsers.jsx | 43 +- .../web/src/views/system/notice/index.jsx | 68 +- .../web/src/views/system/oauth/client/form.js | 15 +- .../src/views/system/oauth/client/index.jsx | 269 +- .../src/views/system/oauth/client/secret.jsx | 26 +- .../system/oauth/grant/AccessPolicyDrawer.jsx | 110 +- .../src/views/system/oauth/grant/index.jsx | 224 +- .../src/views/system/oauth/key/formatter.js | 53 +- .../web/src/views/system/oauth/key/index.jsx | 173 +- .../src/views/system/oauth/resource/index.jsx | 170 +- .../src/views/system/oauth/scope/index.jsx | 187 +- .../src/views/system/oauth/session/index.jsx | 151 +- .../plugin/components/PluginActionDialog.jsx | 101 +- .../plugin/components/PluginConfigDialog.jsx | 54 +- .../plugin/components/PluginConfigStatus.jsx | 78 +- .../components/PluginDependencyDialog.jsx | 127 +- .../plugin/components/PluginDetailDialog.jsx | 317 ++- .../components/PluginDiagnosticDialog.jsx | 82 +- .../components/PluginOperationLogDrawer.jsx | 235 +- .../plugin/components/PluginPlanDialog.jsx | 126 +- .../components/PluginRuntimeMetrics.jsx | 82 +- .../web/src/views/system/plugin/formatter.js | 138 +- .../web/src/views/system/plugin/index.jsx | 172 +- .../react/web/src/views/system/post/index.jsx | 78 +- .../web/src/views/system/role/authUser.jsx | 46 +- .../react/web/src/views/system/role/index.jsx | 153 +- .../web/src/views/system/role/selectUser.jsx | 36 +- .../web/src/views/system/user/authRole.jsx | 28 +- .../react/web/src/views/system/user/index.jsx | 144 +- .../src/views/system/user/profile/index.jsx | 26 +- .../views/system/user/profile/resetPwd.jsx | 33 +- .../system/user/profile/timezoneSettings.jsx | 42 +- .../views/system/user/profile/userAvatar.jsx | 33 +- .../views/system/user/profile/userInfo.jsx | 34 +- .../react/web/src/views/system/user/view.jsx | 48 +- .../src/views/tool/build/CodeTypeDialog.jsx | 24 +- .../src/views/tool/build/DraggableItem.jsx | 16 +- .../web/src/views/tool/build/IconsDialog.jsx | 8 +- .../web/src/views/tool/build/RightPanel.jsx | 317 +-- .../src/views/tool/build/TreeNodeDialog.jsx | 30 +- .../react/web/src/views/tool/build/index.jsx | 67 +- .../web/src/views/tool/gen/CodePreview.jsx | 12 +- .../web/src/views/tool/gen/basicInfoForm.jsx | 18 +- .../web/src/views/tool/gen/createTable.jsx | 24 +- .../web/src/views/tool/gen/editTable.jsx | 76 +- .../web/src/views/tool/gen/genInfoForm.jsx | 140 +- .../web/src/views/tool/gen/importTable.jsx | 36 +- .../react/web/src/views/tool/gen/index.jsx | 75 +- .../web/src/views/tool/swagger/index.jsx | 6 +- .../react/web/tests/i18n/entities.test.mjs | 83 + .../web/tests/i18n/project-tooling.test.mjs | 77 + .../react/web/tests/i18n/runtime.test.mjs | 138 ++ .../react/web/tests/i18n/x18n.test.mjs | 70 + .../react/web/tests/plugins/pluginSse.test.js | 32 + .../react/web/tests/react/i18n.test.jsx | 178 ++ .../react/web/x18n.config.mjs | 44 + .../vue2/mobile/package.json | 6 +- .../vue2/mobile/pnpm-lock.yaml | 586 +++++ .../vue2/mobile/scripts/check-i18n.mjs | 18 + .../vue2/mobile/src/App.vue | 2 + .../src/components/LanguageSelect/index.vue | 53 + .../vue2/mobile/src/i18n/adapter.js | 21 + .../vue2/mobile/src/i18n/index.js | 28 + .../vue2/mobile/src/i18n/locale-meta.json | 24 + .../mobile/src/i18n/locales/en-US/auth.json | 26 + .../mobile/src/i18n/locales/en-US/common.json | 45 + .../mobile/src/i18n/locales/en-US/file.json | 6 + .../mobile/src/i18n/locales/en-US/mobile.json | 154 ++ .../src/i18n/locales/en-US/monitor.json | 5 + .../mobile/src/i18n/locales/en-US/system.json | 38 + .../mobile/src/i18n/locales/zh-CN/auth.json | 26 + .../mobile/src/i18n/locales/zh-CN/common.json | 45 + .../mobile/src/i18n/locales/zh-CN/file.json | 6 + .../mobile/src/i18n/locales/zh-CN/mobile.json | 154 ++ .../src/i18n/locales/zh-CN/monitor.json | 5 + .../mobile/src/i18n/locales/zh-CN/system.json | 38 + .../vue2/mobile/src/i18n/navigation.js | 43 + .../vue2/mobile/src/i18n/preference.js | 17 + .../vue2/mobile/src/i18n/registry.js | 11 + .../vue2/mobile/src/i18n/runtime.mjs | 216 ++ .../vue2/mobile/src/main.ts | 9 + .../src/pages/common/agreement/index.vue | 52 +- .../mobile/src/pages/common/privacy/index.vue | 73 +- .../vue2/mobile/src/pages/index.vue | 71 +- .../vue2/mobile/src/pages/login.vue | 34 +- .../mobile/src/pages/mine/about/index.vue | 10 +- .../mobile/src/pages/mine/avatar/index.vue | 10 +- .../vue2/mobile/src/pages/mine/help/index.vue | 42 +- .../vue2/mobile/src/pages/mine/index.vue | 26 +- .../vue2/mobile/src/pages/mine/info/edit.vue | 52 +- .../vue2/mobile/src/pages/mine/info/index.vue | 20 +- .../vue2/mobile/src/pages/mine/pwd/index.vue | 34 +- .../mobile/src/pages/mine/setting/index.vue | 19 +- .../src/pages/mine/setting/timezone.vue | 46 +- .../vue2/mobile/src/pages/register.vue | 36 +- .../vue2/mobile/src/pages/work/index.vue | 46 +- .../vue2/mobile/src/plugins/modal.js | 10 +- .../vue2/mobile/src/store/modules/user.js | 3 + .../vue2/mobile/src/utils/common.js | 7 +- .../vue2/mobile/src/utils/errorCode.js | 17 +- .../vue2/mobile/src/utils/request.js | 9 +- .../vue2/mobile/src/utils/session.js | 3 +- .../vue2/mobile/src/utils/transportCrypto.js | 3 + .../vue2/mobile/src/utils/upload.js | 16 +- .../mobile/tests/i18n/navigation.test.mjs | 57 + .../vue2/mobile/tests/i18n/runtime.test.mjs | 138 ++ .../vue2/mobile/tests/i18n/x18n.test.mjs | 70 + .../vue2/mobile/x18n.config.mjs | 29 + ruoyi-fastapi-frontend/vue2/web/package.json | 7 +- .../vue2/web/plugins/ai/locales/en-US.json | 121 + .../vue2/web/plugins/ai/locales/zh-CN.json | 121 + .../ai/views/chat/components/AiMessage.vue | 4 +- .../vue2/web/plugins/ai/views/chat/index.vue | 115 +- .../vue2/web/plugins/ai/views/model/index.vue | 132 +- .../vue2/web/pnpm-lock.yaml | 622 +++++ .../vue2/web/scripts/check-i18n.mjs | 18 + .../vue2/web/scripts/x18n-project.mjs | 26 + ruoyi-fastapi-frontend/vue2/web/src/App.vue | 24 +- .../vue2/web/src/api/system/dict/data.js | 5 +- .../vue2/web/src/api/system/dict/type.js | 5 +- .../vue2/web/src/api/system/menu.js | 5 +- .../web/src/components/Breadcrumb/index.vue | 13 +- .../BusinessDateTimePicker/index.vue | 12 +- .../components/BusinessFileUpload/index.vue | 47 +- .../vue2/web/src/components/Crontab/day.vue | 29 +- .../vue2/web/src/components/Crontab/hour.vue | 21 +- .../vue2/web/src/components/Crontab/index.vue | 37 +- .../vue2/web/src/components/Crontab/min.vue | 21 +- .../vue2/web/src/components/Crontab/month.vue | 21 +- .../web/src/components/Crontab/result.vue | 11 +- .../web/src/components/Crontab/second.vue | 21 +- .../vue2/web/src/components/Crontab/week.vue | 50 +- .../vue2/web/src/components/Crontab/year.vue | 21 +- .../vue2/web/src/components/DictData/index.js | 5 +- .../vue2/web/src/components/Editor/index.vue | 86 +- .../components/ExcelImportDialog/index.vue | 37 +- .../web/src/components/FileUpload/index.vue | 45 +- .../web/src/components/HeaderSearch/index.vue | 60 +- .../web/src/components/IconSelect/index.vue | 2 +- .../web/src/components/ImageUpload/index.vue | 45 +- .../web/src/components/JsonEditor/index.vue | 43 +- .../src/components/LanguageSelect/index.vue | 57 + .../src/components/LocaleTextFields/index.vue | 55 + .../components/OAuthWorkspace/AccessMap.vue | 34 +- .../components/OAuthWorkspace/FieldLabel.vue | 2 +- .../components/OAuthWorkspace/PageFrame.vue | 12 +- .../OAuthWorkspace/StringListInput.vue | 8 +- .../web/src/components/PluginFrame/index.vue | 69 +- .../web/src/components/RightToolbar/index.vue | 18 +- .../web/src/components/Screenfull/index.vue | 7 +- .../web/src/components/SizeSelect/index.vue | 2 +- .../web/src/components/TreePanel/index.vue | 18 +- .../vue2/web/src/i18n/adapter.js | 31 + .../vue2/web/src/i18n/components.js | 9 + .../vue2/web/src/i18n/forms.js | 18 + .../vue2/web/src/i18n/index.js | 45 + .../vue2/web/src/i18n/locale-meta.json | 24 + .../vue2/web/src/i18n/locales/en-US/auth.json | 107 + .../src/i18n/locales/en-US/authCenter.json | 504 ++++ .../web/src/i18n/locales/en-US/common.json | 222 ++ .../src/i18n/locales/en-US/components.json | 6 + .../vue2/web/src/i18n/locales/en-US/file.json | 366 +++ .../web/src/i18n/locales/en-US/layout.json | 191 ++ .../web/src/i18n/locales/en-US/monitor.json | 451 ++++ .../src/i18n/locales/en-US/pluginAdmin.json | 421 ++++ .../web/src/i18n/locales/en-US/system.json | 324 +++ .../vue2/web/src/i18n/locales/en-US/tool.json | 391 +++ .../vue2/web/src/i18n/locales/zh-CN/auth.json | 107 + .../src/i18n/locales/zh-CN/authCenter.json | 504 ++++ .../web/src/i18n/locales/zh-CN/common.json | 222 ++ .../src/i18n/locales/zh-CN/components.json | 6 + .../vue2/web/src/i18n/locales/zh-CN/file.json | 366 +++ .../web/src/i18n/locales/zh-CN/layout.json | 190 ++ .../web/src/i18n/locales/zh-CN/monitor.json | 451 ++++ .../src/i18n/locales/zh-CN/pluginAdmin.json | 421 ++++ .../web/src/i18n/locales/zh-CN/system.json | 324 +++ .../vue2/web/src/i18n/locales/zh-CN/tool.json | 391 +++ .../vue2/web/src/i18n/preference.js | 17 + .../vue2/web/src/i18n/registry.js | 19 + .../vue2/web/src/i18n/runtime.mjs | 216 ++ .../components/HeaderNotice/DetailView.vue | 16 +- .../layout/components/HeaderNotice/index.vue | 14 +- .../vue2/web/src/layout/components/Navbar.vue | 25 +- .../src/layout/components/Settings/index.vue | 46 +- .../layout/components/Sidebar/SidebarItem.vue | 4 +- .../src/layout/components/TagsView/index.vue | 49 +- .../src/layout/components/TopBar/index.vue | 2 +- .../src/layout/components/TopNav/index.vue | 6 +- ruoyi-fastapi-frontend/vue2/web/src/main.js | 21 + .../vue2/web/src/permission.js | 1 - .../vue2/web/src/plugins/download.js | 15 +- .../vue2/web/src/plugins/modal.js | 21 +- .../vue2/web/src/plugins/tab.js | 7 +- .../vue2/web/src/router/index.js | 32 +- .../vue2/web/src/store/modules/dict.js | 2 + .../vue2/web/src/store/modules/tagsView.js | 19 +- .../vue2/web/src/store/modules/user.js | 32 +- .../vue2/web/src/utils/dict/DictData.js | 8 +- .../vue2/web/src/utils/dict/index.js | 8 + .../vue2/web/src/utils/errorCode.js | 17 +- .../vue2/web/src/utils/generator/config.js | 169 +- .../vue2/web/src/utils/index.js | 11 +- .../vue2/web/src/utils/job.js | 12 +- .../vue2/web/src/utils/jobDisplay.js | 106 + .../vue2/web/src/utils/localePayload.mjs | 12 + .../vue2/web/src/utils/oauthUri.js | 23 +- .../vue2/web/src/utils/passwordRule.js | 57 +- .../vue2/web/src/utils/pluginBridge.d.ts | 1 + .../vue2/web/src/utils/pluginBridge.js | 30 +- .../vue2/web/src/utils/pluginPlanFormatter.js | 38 +- .../web/src/utils/pluginReleaseDisplay.js | 47 + .../vue2/web/src/utils/request.js | 39 +- .../vue2/web/src/utils/tagsView.js | 44 + .../vue2/web/src/utils/time.js | 22 +- .../src/views/auth-center/AuthCenterShell.vue | 59 +- .../src/views/auth-center/changePassword.vue | 92 +- .../web/src/views/auth-center/consent.vue | 83 +- .../vue2/web/src/views/auth-center/error.vue | 47 +- .../vue2/web/src/views/auth-center/login.vue | 71 +- .../src/views/auth-center/useInteraction.js | 7 +- .../vue2/web/src/views/dashboard/BarChart.vue | 25 +- .../web/src/views/dashboard/LineChart.vue | 19 +- .../web/src/views/dashboard/PanelGroup.vue | 8 +- .../vue2/web/src/views/dashboard/PieChart.vue | 29 +- .../vue2/web/src/views/dashboard/Radar.vue | 6 +- .../web/src/views/dashboard/RaddarChart.vue | 33 +- .../vue2/web/src/views/dashboard/index.vue | 228 +- .../vue2/web/src/views/error/401.vue | 12 +- .../vue2/web/src/views/error/404.vue | 10 +- .../vue2/web/src/views/index.vue | 66 +- .../vue2/web/src/views/lock.vue | 17 +- .../vue2/web/src/views/login.vue | 47 +- .../web/src/views/monitor/cache/index.vue | 77 +- .../vue2/web/src/views/monitor/cache/list.vue | 47 +- .../web/src/views/monitor/druid/index.vue | 2 +- .../vue2/web/src/views/monitor/job/detail.vue | 166 +- .../vue2/web/src/views/monitor/job/index.vue | 225 +- .../vue2/web/src/views/monitor/job/log.vue | 69 +- .../web/src/views/monitor/job/runtime.vue | 102 +- .../src/views/monitor/logininfor/index.vue | 65 +- .../src/views/monitor/oauthAudit/index.vue | 496 ++-- .../web/src/views/monitor/online/index.vue | 41 +- .../web/src/views/monitor/operlog/detail.vue | 76 +- .../web/src/views/monitor/operlog/index.vue | 73 +- .../web/src/views/monitor/server/index.vue | 127 +- .../views/monitor/transportCrypto/index.vue | 217 +- .../vue2/web/src/views/register.vue | 45 +- .../web/src/views/system/config/index.vue | 110 +- .../vue2/web/src/views/system/dept/index.vue | 106 +- .../vue2/web/src/views/system/dict/data.vue | 141 +- .../vue2/web/src/views/system/dict/detail.vue | 20 +- .../vue2/web/src/views/system/dict/index.vue | 117 +- .../system/file/components/FileAclDrawer.vue | 102 +- .../file/components/FileAuditDrawer.vue | 101 +- .../file/components/FileDetailDialog.vue | 64 +- .../file/components/FileReconcileDrawer.vue | 345 ++- .../file/components/FileReferenceDrawer.vue | 28 +- .../components/FileRetentionPolicyDrawer.vue | 77 +- .../FileRetentionReminderDrawer.vue | 133 +- .../system/file/components/FileSearchForm.vue | 57 +- .../system/file/components/FileStatistics.vue | 44 +- .../system/file/components/FileTable.vue | 74 +- .../file/components/FileTransferDialog.vue | 61 +- .../system/file/components/fileFormatters.js | 127 +- .../vue2/web/src/views/system/file/index.vue | 52 +- .../vue2/web/src/views/system/menu/index.vue | 177 +- .../web/src/views/system/notice/ReadUsers.vue | 23 +- .../web/src/views/system/notice/index.vue | 94 +- .../src/views/system/oauth/client/index.vue | 409 ++- .../src/views/system/oauth/client/secret.vue | 31 +- .../system/oauth/grant/AccessPolicyDrawer.vue | 123 +- .../src/views/system/oauth/grant/index.vue | 224 +- .../web/src/views/system/oauth/key/index.vue | 290 ++- .../src/views/system/oauth/resource/index.vue | 259 +- .../src/views/system/oauth/scope/index.vue | 281 ++- .../src/views/system/oauth/session/index.vue | 145 +- .../plugin/components/PluginConfigDialog.vue | 53 +- .../plugin/components/PluginConfigStatus.vue | 86 +- .../components/PluginDependencyDialog.vue | 108 +- .../plugin/components/PluginDetailDialog.vue | 289 ++- .../components/PluginDiagnosticDialog.vue | 76 +- .../plugin/components/PluginPlanDialog.vue | 91 +- .../plugin/components/PluginReleaseStatus.vue | 2 +- .../components/PluginRuntimeMetrics.vue | 85 +- .../web/src/views/system/plugin/index.vue | 719 +++--- .../vue2/web/src/views/system/post/index.vue | 94 +- .../web/src/views/system/role/authUser.vue | 45 +- .../vue2/web/src/views/system/role/index.vue | 181 +- .../web/src/views/system/role/selectUser.vue | 35 +- .../web/src/views/system/user/authRole.vue | 32 +- .../vue2/web/src/views/system/user/index.vue | 226 +- .../src/views/system/user/profile/index.vue | 22 +- .../views/system/user/profile/resetPwd.vue | 29 +- .../system/user/profile/timezoneSettings.vue | 37 +- .../views/system/user/profile/userAvatar.vue | 16 +- .../views/system/user/profile/userInfo.vue | 33 +- .../vue2/web/src/views/system/user/view.vue | 50 +- .../src/views/tool/build/CodeTypeDialog.vue | 24 +- .../src/views/tool/build/DraggableItem.vue | 5 +- .../web/src/views/tool/build/IconsDialog.vue | 4 +- .../web/src/views/tool/build/RightPanel.vue | 403 +-- .../src/views/tool/build/TreeNodeDialog.vue | 26 +- .../vue2/web/src/views/tool/build/index.vue | 42 +- .../web/src/views/tool/gen/basicInfoForm.vue | 45 +- .../web/src/views/tool/gen/createTable.vue | 25 +- .../vue2/web/src/views/tool/gen/editTable.vue | 73 +- .../web/src/views/tool/gen/genInfoForm.vue | 137 +- .../web/src/views/tool/gen/importTable.vue | 37 +- .../vue2/web/src/views/tool/gen/index.vue | 87 +- .../vue2/web/tests/i18n/charts.test.mjs | 58 + .../vue2/web/tests/i18n/navigation.test.mjs | 151 ++ .../web/tests/i18n/project-tooling.test.mjs | 77 + .../vue2/web/tests/i18n/runtime.test.mjs | 138 ++ .../vue2/web/tests/i18n/test-runtime.cjs | 40 + .../vue2/web/tests/i18n/uploads.test.mjs | 54 + .../vue2/web/tests/i18n/x18n.test.mjs | 70 + .../web/tests/job/vue2-components.test.cjs | 2 + .../tests/plugins/pluginConfigStatus.test.mjs | 3 + .../web/tests/plugins/pluginFrame.test.mjs | 3 + .../plugins/pluginHostIntegration.test.cjs | 4 + .../plugins/pluginRuntimeMetrics.test.mjs | 3 + .../vue2/web/tests/support/load-module.cjs | 2 + .../vue2/web/x18n.config.mjs | 37 + .../vue3/mobile/package.json | 6 +- .../vue3/mobile/pnpm-lock.yaml | 630 ++++- .../vue3/mobile/scripts/check-i18n.mjs | 18 + .../vue3/mobile/src/App.vue | 2 + .../src/components/LanguageSelect/index.vue | 53 + .../vue3/mobile/src/i18n/adapter.js | 32 + .../vue3/mobile/src/i18n/index.js | 28 + .../vue3/mobile/src/i18n/locale-meta.json | 24 + .../mobile/src/i18n/locales/en-US/common.json | 33 + .../mobile/src/i18n/locales/en-US/mobile.json | 251 ++ .../src/i18n/locales/en-US/utility.json | 37 + .../mobile/src/i18n/locales/zh-CN/common.json | 33 + .../mobile/src/i18n/locales/zh-CN/mobile.json | 251 ++ .../src/i18n/locales/zh-CN/utility.json | 37 + .../vue3/mobile/src/i18n/message.mjs | 10 + .../vue3/mobile/src/i18n/names.mjs | 15 + .../vue3/mobile/src/i18n/navigation.js | 35 + .../vue3/mobile/src/i18n/preference.js | 17 + .../vue3/mobile/src/i18n/registry.js | 15 + .../vue3/mobile/src/i18n/runtime.mjs | 216 ++ .../vue3/mobile/src/main.ts | 10 + .../src/pages/common/agreement/index.vue | 52 +- .../mobile/src/pages/common/privacy/index.vue | 73 +- .../src/pages/common/textview/index.vue | 4 +- .../vue3/mobile/src/pages/index.vue | 55 +- .../vue3/mobile/src/pages/login.vue | 34 +- .../mobile/src/pages/mine/about/index.vue | 10 +- .../mobile/src/pages/mine/avatar/index.vue | 9 +- .../vue3/mobile/src/pages/mine/help/index.vue | 37 +- .../vue3/mobile/src/pages/mine/index.vue | 29 +- .../vue3/mobile/src/pages/mine/info/edit.vue | 47 +- .../vue3/mobile/src/pages/mine/info/index.vue | 24 +- .../vue3/mobile/src/pages/mine/pwd/index.vue | 33 +- .../mobile/src/pages/mine/setting/index.vue | 18 +- .../src/pages/mine/setting/timezone.vue | 45 +- .../vue3/mobile/src/pages/register.vue | 37 +- .../vue3/mobile/src/pages/work/index.vue | 47 +- .../vue3/mobile/src/plugins/modal.js | 10 +- .../vue3/mobile/src/store/modules/user.js | 3 + .../vue3/mobile/src/utils/common.js | 7 +- .../vue3/mobile/src/utils/dict.js | 57 +- .../vue3/mobile/src/utils/errorCode.js | 17 +- .../vue3/mobile/src/utils/request.js | 11 +- .../vue3/mobile/src/utils/session.js | 3 +- .../vue3/mobile/src/utils/time.js | 56 +- .../vue3/mobile/src/utils/transportCrypto.js | 68 +- .../vue3/mobile/src/utils/transportForge.js | 8 +- .../vue3/mobile/src/utils/upload.js | 17 +- .../vue3/mobile/tests/i18n/names.test.mjs | 49 + .../vue3/mobile/tests/i18n/runtime.test.mjs | 138 ++ .../vue3/mobile/tests/i18n/x18n.test.mjs | 70 + .../vue3/mobile/x18n.config.mjs | 33 + ruoyi-fastapi-frontend/vue3/web/package.json | 7 +- .../vue3/web/plugins/ai/locales/en-US.json | 83 + .../vue3/web/plugins/ai/locales/zh-CN.json | 83 + .../ai/views/chat/components/AiMessage.vue | 4 +- .../vue3/web/plugins/ai/views/chat/index.vue | 105 +- .../vue3/web/plugins/ai/views/model/index.vue | 134 +- .../vue3/web/pnpm-lock.yaml | 681 ++++- .../vue3/web/scripts/check-i18n.mjs | 23 + .../vue3/web/scripts/x18n-project.mjs | 26 + ruoyi-fastapi-frontend/vue3/web/src/App.vue | 19 +- .../web/src/components/Breadcrumb/index.vue | 24 +- .../BusinessDateTimePicker/index.vue | 7 +- .../components/BusinessFileUpload/index.vue | 54 +- .../vue3/web/src/components/Crontab/day.vue | 79 +- .../vue3/web/src/components/Crontab/hour.vue | 63 +- .../vue3/web/src/components/Crontab/index.vue | 35 +- .../vue3/web/src/components/Crontab/min.vue | 63 +- .../vue3/web/src/components/Crontab/month.vue | 150 +- .../web/src/components/Crontab/result.vue | 9 +- .../web/src/components/Crontab/second.vue | 63 +- .../vue3/web/src/components/Crontab/week.vue | 82 +- .../vue3/web/src/components/Crontab/year.vue | 66 +- .../vue3/web/src/components/Editor/index.vue | 15 +- .../components/ExcelImportDialog/index.vue | 23 +- .../web/src/components/FileUpload/index.vue | 35 +- .../web/src/components/HeaderSearch/index.vue | 70 +- .../web/src/components/IconSelect/index.vue | 2 +- .../web/src/components/ImageUpload/index.vue | 33 +- .../web/src/components/JsonEditor/index.vue | 28 +- .../src/components/LanguageSelect/index.vue | 58 + .../src/components/LocaleNameInput/index.vue | 47 + .../src/components/LocalizedMessage/index.vue | 31 + .../components/OAuthWorkspace/AccessMap.vue | 33 +- .../components/OAuthWorkspace/FieldLabel.vue | 2 +- .../components/OAuthWorkspace/PageFrame.vue | 9 +- .../OAuthWorkspace/StringListInput.vue | 5 +- .../web/src/components/PluginFrame/index.vue | 30 +- .../web/src/components/RightToolbar/index.vue | 15 +- .../web/src/components/SizeSelect/index.vue | 11 +- .../web/src/components/TreePanel/index.vue | 11 +- .../vue3/web/src/composables/useLocaleForm.js | 18 + .../vue3/web/src/i18n/adapter.js | 36 + .../vue3/web/src/i18n/components.js | 9 + .../vue3/web/src/i18n/generated.mjs | 10 + .../vue3/web/src/i18n/index.js | 45 + .../vue3/web/src/i18n/locale-meta.json | 24 + .../vue3/web/src/i18n/locales/en-US/auth.json | 36 + .../src/i18n/locales/en-US/authCenter.json | 111 + .../web/src/i18n/locales/en-US/common.json | 33 + .../src/i18n/locales/en-US/components.json | 230 ++ .../web/src/i18n/locales/en-US/dashboard.json | 35 + .../web/src/i18n/locales/en-US/files.json | 308 +++ .../web/src/i18n/locales/en-US/layout.json | 108 + .../web/src/i18n/locales/en-US/monitor.json | 462 ++++ .../web/src/i18n/locales/en-US/oauth.json | 415 ++++ .../web/src/i18n/locales/en-US/plugins.json | 392 +++ .../web/src/i18n/locales/en-US/system.json | 324 +++ .../web/src/i18n/locales/en-US/tools.json | 329 +++ .../web/src/i18n/locales/en-US/utility.json | 70 + .../vue3/web/src/i18n/locales/zh-CN/auth.json | 36 + .../src/i18n/locales/zh-CN/authCenter.json | 109 + .../web/src/i18n/locales/zh-CN/common.json | 33 + .../src/i18n/locales/zh-CN/components.json | 229 ++ .../web/src/i18n/locales/zh-CN/dashboard.json | 35 + .../web/src/i18n/locales/zh-CN/files.json | 308 +++ .../web/src/i18n/locales/zh-CN/layout.json | 107 + .../web/src/i18n/locales/zh-CN/monitor.json | 462 ++++ .../web/src/i18n/locales/zh-CN/oauth.json | 413 +++ .../web/src/i18n/locales/zh-CN/plugins.json | 392 +++ .../web/src/i18n/locales/zh-CN/system.json | 324 +++ .../web/src/i18n/locales/zh-CN/tools.json | 329 +++ .../web/src/i18n/locales/zh-CN/utility.json | 67 + .../vue3/web/src/i18n/message.mjs | 10 + .../vue3/web/src/i18n/names.mjs | 15 + .../vue3/web/src/i18n/preference.js | 17 + .../vue3/web/src/i18n/registry.js | 76 + .../vue3/web/src/i18n/runtime.mjs | 216 ++ .../components/HeaderNotice/DetailView.vue | 16 +- .../layout/components/HeaderNotice/index.vue | 16 +- .../src/layout/components/InnerLink/index.vue | 2 +- .../vue3/web/src/layout/components/Navbar.vue | 30 +- .../src/layout/components/Settings/index.vue | 66 +- .../layout/components/Sidebar/SidebarItem.vue | 9 +- .../src/layout/components/TagsView/index.vue | 73 +- .../src/layout/components/TopBar/index.vue | 2 +- .../src/layout/components/TopNav/index.vue | 7 +- ruoyi-fastapi-frontend/vue3/web/src/main.js | 22 +- .../vue3/web/src/permission.js | 2 - .../vue3/web/src/plugins/download.js | 15 +- .../vue3/web/src/plugins/modal.js | 21 +- .../vue3/web/src/plugins/tab.js | 6 +- .../vue3/web/src/router/index.js | 37 +- .../vue3/web/src/store/modules/tagsView.js | 25 +- .../vue3/web/src/store/modules/user.js | 31 +- .../vue3/web/src/utils/dict.js | 56 +- .../vue3/web/src/utils/dynamicTitle.js | 2 +- .../vue3/web/src/utils/errorCode.js | 15 +- .../vue3/web/src/utils/generator/config.js | 174 +- .../web/src/utils/generator/drawingDefault.js | 8 +- .../vue3/web/src/utils/generator/html.js | 11 +- .../vue3/web/src/utils/generator/js.js | 20 +- .../vue3/web/src/utils/index.js | 18 +- .../vue3/web/src/utils/job.js | 56 +- .../vue3/web/src/utils/oauthUri.js | 26 +- .../vue3/web/src/utils/passwordRule.js | 48 +- .../vue3/web/src/utils/pluginBridge.d.ts | 5 + .../vue3/web/src/utils/pluginBridge.js | 260 +- .../vue3/web/src/utils/pluginPlanFormatter.js | 58 +- .../web/src/utils/pluginReleaseFormatter.js | 97 +- .../vue3/web/src/utils/pluginSse.js | 28 +- .../vue3/web/src/utils/request.js | 36 +- .../vue3/web/src/utils/tagsView.js | 44 + .../vue3/web/src/utils/time.js | 78 +- .../vue3/web/src/utils/transportCrypto.js | 55 +- .../src/views/auth-center/AuthCenterShell.vue | 61 +- .../src/views/auth-center/changePassword.vue | 95 +- .../web/src/views/auth-center/consent.vue | 73 +- .../vue3/web/src/views/auth-center/error.vue | 41 +- .../vue3/web/src/views/auth-center/login.vue | 78 +- .../src/views/auth-center/useInteraction.js | 7 +- .../views/dashboard/editable-link-group.vue | 28 +- .../vue3/web/src/views/dashboard/index.vue | 254 +- .../vue3/web/src/views/error/401.vue | 10 +- .../vue3/web/src/views/error/404.vue | 14 +- .../vue3/web/src/views/lock.vue | 37 +- .../vue3/web/src/views/login.vue | 54 +- .../web/src/views/monitor/cache/index.vue | 180 +- .../vue3/web/src/views/monitor/cache/list.vue | 39 +- .../web/src/views/monitor/druid/index.vue | 2 +- .../vue3/web/src/views/monitor/job/detail.vue | 168 +- .../vue3/web/src/views/monitor/job/index.vue | 247 +- .../vue3/web/src/views/monitor/job/log.vue | 69 +- .../web/src/views/monitor/job/runtime.vue | 96 +- .../src/views/monitor/logininfor/index.vue | 63 +- .../src/views/monitor/oauthAudit/index.vue | 548 ++-- .../web/src/views/monitor/online/index.vue | 39 +- .../web/src/views/monitor/operlog/detail.vue | 69 +- .../web/src/views/monitor/operlog/index.vue | 69 +- .../web/src/views/monitor/server/index.vue | 125 +- .../views/monitor/transportCrypto/index.vue | 229 +- .../vue3/web/src/views/register.vue | 57 +- .../web/src/views/system/config/index.vue | 130 +- .../vue3/web/src/views/system/dept/index.vue | 134 +- .../vue3/web/src/views/system/dict/data.vue | 182 +- .../vue3/web/src/views/system/dict/detail.vue | 25 +- .../vue3/web/src/views/system/dict/index.vue | 135 +- .../system/file/components/FileAclDrawer.vue | 101 +- .../file/components/FileAuditDrawer.vue | 102 +- .../file/components/FileDetailDialog.vue | 65 +- .../file/components/FileReconcileDrawer.vue | 373 ++- .../file/components/FileReferenceDrawer.vue | 28 +- .../components/FileRetentionPolicyDrawer.vue | 86 +- .../FileRetentionReminderDrawer.vue | 145 +- .../system/file/components/FileSearchForm.vue | 56 +- .../system/file/components/FileStatistics.vue | 34 +- .../system/file/components/FileTable.vue | 79 +- .../file/components/FileTransferDialog.vue | 70 +- .../system/file/components/fileFormatters.js | 125 +- .../vue3/web/src/views/system/file/index.vue | 59 +- .../vue3/web/src/views/system/menu/index.vue | 237 +- .../web/src/views/system/notice/ReadUsers.vue | 24 +- .../web/src/views/system/notice/index.vue | 98 +- .../src/views/system/oauth/client/index.vue | 317 ++- .../src/views/system/oauth/client/secret.vue | 21 +- .../system/oauth/grant/AccessPolicyDrawer.vue | 113 +- .../src/views/system/oauth/grant/index.vue | 194 +- .../web/src/views/system/oauth/key/index.vue | 296 ++- .../src/views/system/oauth/resource/index.vue | 222 +- .../src/views/system/oauth/scope/index.vue | 246 +- .../src/views/system/oauth/session/index.vue | 151 +- .../plugin/components/PluginConfigDialog.vue | 45 +- .../plugin/components/PluginConfigStatus.vue | 70 +- .../components/PluginDependencyDialog.vue | 93 +- .../plugin/components/PluginDetailDialog.vue | 281 ++- .../components/PluginDiagnosticDialog.vue | 71 +- .../plugin/components/PluginPlanDialog.vue | 88 +- .../components/PluginRuntimeMetrics.vue | 119 +- .../web/src/views/system/plugin/index.vue | 573 +++-- .../vue3/web/src/views/system/post/index.vue | 112 +- .../web/src/views/system/role/authUser.vue | 43 +- .../vue3/web/src/views/system/role/index.vue | 222 +- .../web/src/views/system/role/selectUser.vue | 33 +- .../web/src/views/system/user/authRole.vue | 25 +- .../vue3/web/src/views/system/user/index.vue | 227 +- .../src/views/system/user/profile/index.vue | 22 +- .../views/system/user/profile/resetPwd.vue | 42 +- .../system/user/profile/timezoneSettings.vue | 35 +- .../views/system/user/profile/userAvatar.vue | 14 +- .../views/system/user/profile/userInfo.vue | 64 +- .../vue3/web/src/views/system/user/view.vue | 46 +- .../src/views/tool/build/CodeTypeDialog.vue | 29 +- .../src/views/tool/build/DraggableItem.vue | 4 +- .../web/src/views/tool/build/IconsDialog.vue | 9 +- .../web/src/views/tool/build/RightPanel.vue | 398 +-- .../src/views/tool/build/TreeNodeDialog.vue | 31 +- .../vue3/web/src/views/tool/build/index.vue | 58 +- .../web/src/views/tool/gen/basicInfoForm.vue | 59 +- .../web/src/views/tool/gen/createTable.vue | 19 +- .../vue3/web/src/views/tool/gen/editTable.vue | 67 +- .../web/src/views/tool/gen/genInfoForm.vue | 186 +- .../web/src/views/tool/gen/importTable.vue | 35 +- .../vue3/web/src/views/tool/gen/index.vue | 87 +- .../vue3/web/tests/i18n/generated.test.mjs | 38 + .../vue3/web/tests/i18n/generator.test.mjs | 54 + .../vue3/web/tests/i18n/localeFixture.mjs | 25 + .../web/tests/i18n/localizedMessage.test.mjs | 54 + .../vue3/web/tests/i18n/names.test.mjs | 49 + .../vue3/web/tests/i18n/navigation.test.mjs | 221 ++ .../vue3/web/tests/i18n/pluginSdk.test.mjs | 22 + .../web/tests/i18n/project-tooling.test.mjs | 77 + .../vue3/web/tests/i18n/runtime.test.mjs | 143 ++ .../vue3/web/tests/i18n/x18n.test.mjs | 94 + .../tests/plugins/pluginConfigStatus.test.js | 3 + .../web/tests/plugins/pluginFrame.test.js | 3 + .../plugins/pluginRuntimeMetrics.test.js | 3 + .../vue3/web/x18n.config.mjs | 41 + .../frontend/logout-behavior.mjs | 204 +- .../frontend/mobile-harness.mjs | 4 + 1010 files changed, 68341 insertions(+), 15975 deletions(-) create mode 100644 ruoyi-fastapi-backend/.x18n/tooling/package-lock.json create mode 100644 ruoyi-fastapi-backend/.x18n/tooling/package.json create mode 100644 ruoyi-fastapi-backend/.x18n/tooling/tests/usage.test.mjs create mode 100644 ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/assets/web/i18n.js.tmpl create mode 100644 ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/assets/web/x18n.config.mjs.tmpl create mode 100644 ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/locales.py create mode 100644 ruoyi-fastapi-backend/i18n/__init__.py create mode 100644 ruoyi-fastapi-backend/i18n/catalogs/en-US/LC_MESSAGES/core.po create mode 100644 ruoyi-fastapi-backend/i18n/catalogs/zh-CN/LC_MESSAGES/core.po create mode 100644 ruoyi-fastapi-backend/i18n/locale.py create mode 100644 ruoyi-fastapi-backend/i18n/message.py create mode 100644 ruoyi-fastapi-backend/i18n/registry.py create mode 100644 ruoyi-fastapi-backend/i18n/translation.py create mode 100644 ruoyi-fastapi-backend/i18n/translator.py create mode 100644 ruoyi-fastapi-backend/middlewares/locale_middleware.py create mode 100644 ruoyi-fastapi-backend/scripts/compile_i18n.py create mode 100644 ruoyi-fastapi-backend/scripts/migrate_i18n.py create mode 100644 ruoyi-fastapi-backend/sql/i18n-seeds.json create mode 100644 ruoyi-fastapi-backend/tests/cli/runtime/plugin/test_scaffold_locales.py create mode 100644 ruoyi-fastapi-backend/tests/config/test_i18n_settings.py create mode 100644 ruoyi-fastapi-backend/tests/i18n/test_excel_i18n.py create mode 100644 ruoyi-fastapi-backend/tests/i18n/test_locale.py create mode 100644 ruoyi-fastapi-backend/tests/i18n/test_plugin_messages.py create mode 100644 ruoyi-fastapi-backend/tests/i18n/test_translation_migration.py create mode 100644 ruoyi-fastapi-backend/tests/i18n/test_translations.py create mode 100644 ruoyi-fastapi-backend/tests/module_generator/test_generated_i18n.py create mode 100644 ruoyi-fastapi-backend/tests/plugins/sample_plugins/test_ai_i18n.py create mode 100644 ruoyi-fastapi-backend/utils/gen_i18n_util.py create mode 100644 ruoyi-fastapi-backend/utils/user_import_util.py create mode 100644 ruoyi-fastapi-backend/x18n.config.yml create mode 100644 ruoyi-fastapi-frontend/react/mobile/scripts/check-i18n.mjs create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/components/LanguageSelect/index.jsx create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/adapter.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/error.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/help.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/index.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/locale-meta.json create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/locales/en-US/common.json create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/locales/en-US/mobile.json create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/locales/zh-CN/common.json create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/locales/zh-CN/mobile.json create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/navigation.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/preference.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/registry.js create mode 100644 ruoyi-fastapi-frontend/react/mobile/src/i18n/runtime.mjs create mode 100644 ruoyi-fastapi-frontend/react/mobile/tests/i18n/runtime.test.mjs create mode 100644 ruoyi-fastapi-frontend/react/mobile/tests/i18n/x18n.test.mjs create mode 100644 ruoyi-fastapi-frontend/react/mobile/x18n.config.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/plugins/ai/locales/en-US.json create mode 100644 ruoyi-fastapi-frontend/react/web/plugins/ai/locales/zh-CN.json create mode 100644 ruoyi-fastapi-frontend/react/web/scripts/check-i18n.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/scripts/x18n-project.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/src/components/LanguageSelect/index.jsx create mode 100644 ruoyi-fastapi-frontend/react/web/src/components/TranslationFields/index.jsx create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/adapter.js create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/entities.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/form.js create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/generated.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/index.js create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locale-meta.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/auth.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/authCenter.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/common.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/file.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/layout.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/monitor.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/pluginAdmin.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/system.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/en-US/tool.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/auth.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/authCenter.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/common.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/file.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/layout.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/monitor.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/pluginAdmin.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/system.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/locales/zh-CN/tool.json create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/message.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/preference.js create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/registry.js create mode 100644 ruoyi-fastapi-frontend/react/web/src/i18n/runtime.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/tests/i18n/entities.test.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/tests/i18n/project-tooling.test.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/tests/i18n/runtime.test.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/tests/i18n/x18n.test.mjs create mode 100644 ruoyi-fastapi-frontend/react/web/tests/react/i18n.test.jsx create mode 100644 ruoyi-fastapi-frontend/react/web/x18n.config.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/scripts/check-i18n.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/components/LanguageSelect/index.vue create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/adapter.js create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/index.js create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locale-meta.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/en-US/auth.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/en-US/common.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/en-US/file.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/en-US/mobile.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/en-US/monitor.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/en-US/system.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/zh-CN/auth.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/zh-CN/common.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/zh-CN/file.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/zh-CN/mobile.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/zh-CN/monitor.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/locales/zh-CN/system.json create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/navigation.js create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/preference.js create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/registry.js create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/src/i18n/runtime.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/tests/i18n/navigation.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/tests/i18n/runtime.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/tests/i18n/x18n.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/mobile/x18n.config.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/plugins/ai/locales/en-US.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/plugins/ai/locales/zh-CN.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/scripts/check-i18n.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/scripts/x18n-project.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/components/LanguageSelect/index.vue create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/components/LocaleTextFields/index.vue create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/adapter.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/components.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/forms.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/index.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locale-meta.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/auth.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/authCenter.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/common.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/components.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/file.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/layout.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/monitor.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/pluginAdmin.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/system.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/en-US/tool.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/auth.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/authCenter.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/common.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/components.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/file.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/layout.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/monitor.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/pluginAdmin.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/system.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/locales/zh-CN/tool.json create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/preference.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/registry.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/i18n/runtime.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/utils/jobDisplay.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/utils/localePayload.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/utils/pluginReleaseDisplay.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/src/utils/tagsView.js create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/charts.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/navigation.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/project-tooling.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/runtime.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/test-runtime.cjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/uploads.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/tests/i18n/x18n.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue2/web/x18n.config.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/scripts/check-i18n.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/components/LanguageSelect/index.vue create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/adapter.js create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/index.js create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locale-meta.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/common.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/mobile.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/utility.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/common.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/mobile.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/utility.json create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/message.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/names.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/navigation.js create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/preference.js create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/registry.js create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/src/i18n/runtime.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/tests/i18n/names.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/tests/i18n/runtime.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/tests/i18n/x18n.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/mobile/x18n.config.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/plugins/ai/locales/en-US.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/plugins/ai/locales/zh-CN.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/scripts/check-i18n.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/scripts/x18n-project.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/components/LanguageSelect/index.vue create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/components/LocalizedMessage/index.vue create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/composables/useLocaleForm.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/adapter.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/components.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/generated.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/index.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locale-meta.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/auth.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/authCenter.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/common.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/components.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/dashboard.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/files.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/layout.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/monitor.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/oauth.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/plugins.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/system.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/tools.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/utility.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/auth.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/authCenter.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/common.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/components.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/dashboard.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/files.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/layout.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/monitor.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/oauth.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/plugins.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/system.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/tools.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/utility.json create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/message.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/names.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/preference.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/registry.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/i18n/runtime.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/src/utils/tagsView.js create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/generated.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/generator.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/localeFixture.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/localizedMessage.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/names.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/navigation.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/pluginSdk.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/project-tooling.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/runtime.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/tests/i18n/x18n.test.mjs create mode 100644 ruoyi-fastapi-frontend/vue3/web/x18n.config.mjs diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index df6a0085e..af2b74903 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -33,6 +33,16 @@ jobs: ruoyi-fastapi-backend/plugins/ai/plugin.yaml - name: Install MySQL, PostgreSQL and test dependencies run: python -m pip install -r requirements.txt -r requirements-pg.txt -r requirements-test.txt + - name: Compile and validate gettext catalogs + run: python scripts/compile_i18n.py + - uses: actions/setup-node@v6 + with: + node-version: '22' + - name: Install locked backend translation tooling and run read-only checks + run: | + npm ci --prefix .x18n/tooling --ignore-scripts + node .x18n/tooling/node_modules/@x18n/cli/bin.mjs --root . check --json + npm test --prefix .x18n/tooling - name: Install AI plugin dependencies from its manifest run: python ../.github/scripts/install_ai_test_dependencies.py - name: Check dependency consistency diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml index 5457108b3..0b1b02237 100644 --- a/.github/workflows/ci-frontend.yml +++ b/.github/workflows/ci-frontend.yml @@ -56,6 +56,10 @@ jobs: if ! pnpm list --depth Infinity --json > test-results/dependency-tree.json; then echo "Dependency tree includes peer diagnostics; inspect dependency-tree.json." >&2 fi + - name: Verify independent locale resources and runtime contracts + run: | + pnpm run i18n:check > test-results/i18n.json.log + pnpm run test:i18n - name: Run unit and component behavior tests run: pnpm run test:unit - name: Verify time contracts in three host timezones diff --git a/.gitignore b/.gitignore index f13d541cb..51a077062 100644 --- a/.gitignore +++ b/.gitignore @@ -153,3 +153,6 @@ cython_debug/ .opencode/ .qoder/ .trae/ + +# Backend development-only translation tool dependencies +/ruoyi-fastapi-backend/.x18n/tooling/node_modules/ diff --git a/ruoyi-fastapi-backend/.dockerignore b/ruoyi-fastapi-backend/.dockerignore index 9ed186256..2c0e9d07d 100644 --- a/ruoyi-fastapi-backend/.dockerignore +++ b/ruoyi-fastapi-backend/.dockerignore @@ -10,3 +10,5 @@ target logs *.log *.egg-info + +.x18n diff --git a/ruoyi-fastapi-backend/.env.dev b/ruoyi-fastapi-backend/.env.dev index e11547f4e..5cefef25d 100644 --- a/ruoyi-fastapi-backend/.env.dev +++ b/ruoyi-fastapi-backend/.env.dev @@ -40,6 +40,10 @@ APP_DEFAULT_ENABLED_PLUGINS = 'ai' # 应用业务时区,使用IANA时区名称(如Asia/Shanghai),用于时间展示、日期范围查询和定时任务默认时区 APP_TIMEZONE = 'Asia/Shanghai' +# -------- 国际化配置 -------- +# 默认响应语言,必须使用后端语言注册表中已启用的语言标识 +I18N_DEFAULT_LOCALE = 'zh-CN' + # -------- Jwt配置 -------- # Jwt秘钥,留空时自动生成,开发环境下不要留空;也可使用 openssl rand -hex 32 手动生成 JWT_SECRET_KEY = 'b01c66dc2c58dc6a0aabfe2144256be36226de378bf87f72c0c795dda67f4d55' diff --git a/ruoyi-fastapi-backend/.env.dockermy b/ruoyi-fastapi-backend/.env.dockermy index ddce0fa84..02dafd946 100644 --- a/ruoyi-fastapi-backend/.env.dockermy +++ b/ruoyi-fastapi-backend/.env.dockermy @@ -40,6 +40,10 @@ APP_DEFAULT_ENABLED_PLUGINS = 'ai' # 应用业务时区,使用IANA时区名称(如Asia/Shanghai),用于时间展示、日期范围查询和定时任务默认时区 APP_TIMEZONE = 'Asia/Shanghai' +# -------- 国际化配置 -------- +# 默认响应语言,必须使用后端语言注册表中已启用的语言标识 +I18N_DEFAULT_LOCALE = 'zh-CN' + # -------- Jwt配置 -------- # Jwt秘钥,留空时自动生成;也可使用 openssl rand -hex 32 手动生成 JWT_SECRET_KEY = '' diff --git a/ruoyi-fastapi-backend/.env.dockerpg b/ruoyi-fastapi-backend/.env.dockerpg index c81575a86..2e9dd5ef3 100644 --- a/ruoyi-fastapi-backend/.env.dockerpg +++ b/ruoyi-fastapi-backend/.env.dockerpg @@ -40,6 +40,10 @@ APP_DEFAULT_ENABLED_PLUGINS = 'ai' # 应用业务时区,使用IANA时区名称(如Asia/Shanghai),用于时间展示、日期范围查询和定时任务默认时区 APP_TIMEZONE = 'Asia/Shanghai' +# -------- 国际化配置 -------- +# 默认响应语言,必须使用后端语言注册表中已启用的语言标识 +I18N_DEFAULT_LOCALE = 'zh-CN' + # -------- Jwt配置 -------- # Jwt秘钥,留空时自动生成;也可使用 openssl rand -hex 32 手动生成 JWT_SECRET_KEY = '' diff --git a/ruoyi-fastapi-backend/.env.prod b/ruoyi-fastapi-backend/.env.prod index 1b11e6f6d..aa3f77c29 100644 --- a/ruoyi-fastapi-backend/.env.prod +++ b/ruoyi-fastapi-backend/.env.prod @@ -40,6 +40,10 @@ APP_DEFAULT_ENABLED_PLUGINS = 'ai' # 应用业务时区,使用IANA时区名称(如Asia/Shanghai),用于时间展示、日期范围查询和定时任务默认时区 APP_TIMEZONE = 'Asia/Shanghai' +# -------- 国际化配置 -------- +# 默认响应语言,必须使用后端语言注册表中已启用的语言标识 +I18N_DEFAULT_LOCALE = 'zh-CN' + # -------- Jwt配置 -------- # Jwt秘钥,留空时自动生成;也可使用 openssl rand -hex 32 手动生成 JWT_SECRET_KEY = '' diff --git a/ruoyi-fastapi-backend/.x18n/tooling/package-lock.json b/ruoyi-fastapi-backend/.x18n/tooling/package-lock.json new file mode 100644 index 000000000..0b5caaa5f --- /dev/null +++ b/ruoyi-fastapi-backend/.x18n/tooling/package-lock.json @@ -0,0 +1,1417 @@ +{ + "name": "ruoyi-backend-i18n-tools", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ruoyi-backend-i18n-tools", + "version": "1.0.0", + "devDependencies": { + "@x18n/cli": "0.1.3" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.11", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.11.tgz", + "integrity": "sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.12", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.12.tgz", + "integrity": "sha512-WJ7JBp/Q4+z/ImydtI7jS6NVco5++632ExBemSX+Ysb+G1lCwQ5BVo3SY+jGGOcZXI4ZccbZSUSJLNBW6eEpJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.11" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.11", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.11.tgz", + "integrity": "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.11", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@devframes/agentic": { + "version": "1.2.5", + "resolved": "https://registry.npmmirror.com/@devframes/agentic/-/agentic-1.2.5.tgz", + "integrity": "sha512-2bVZFxGD7C+U1y0vkesUnLWHtrU3qD/Gq/Ri+aWkpXhDe/0EQ64ODA9gxCqFunUvJZ5z1rFvP1XLRLfUiSpvGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@modelcontextprotocol/client": "^2.3.1", + "@modelcontextprotocol/server": "^2.3.1", + "h3": "^2.0.1", + "pathe": "^2.0.3" + }, + "peerDependencies": { + "devframe": "1.2.5" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@modelcontextprotocol/client": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/@modelcontextprotocol/client/-/client-2.4.0.tgz", + "integrity": "sha512-LgrD2OphHuG12vfKFKz6SOnq7bKHQmhGJIAYdD+MZBn2npHEyry6uD8zvktodtl5CQM85MO0anUyD9JwmUmxww==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@modelcontextprotocol/core": "2.4.0", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.8", + "jose": "^6.1.3", + "pkce-challenge": "^5.0.0", + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@modelcontextprotocol/core": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/@modelcontextprotocol/core/-/core-2.4.0.tgz", + "integrity": "sha512-z8QBKqdfXLPzkLQuG4xp8hrVEMm1PZ1IgxMN2sMbJiFiAKOWXnAzogXn2W4aqIBlP1ea6U5yiqVquvUNM1Cj6Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@modelcontextprotocol/server": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/@modelcontextprotocol/server/-/server-2.4.0.tgz", + "integrity": "sha512-rgR9yxSaAJ+bcsi/XroT/S2AfPiIWloXAnrdfYSCms9ivVju0ishu/wW0J21Ho6+ZOR1r7RyeRbjiRuF87ix5Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@modelcontextprotocol/core": "2.4.0", + "zod": "^4.2.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@oxc-parser/binding-android-arm-eabi": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.155.0.tgz", + "integrity": "sha512-A6xv7hDtnTm+xlZ7utn6rRQpRMJHRhVr3gjRGqlx0RUX84mNk0pAsy6YN/wWhuOTkaZhRrrzaLxf0NfbH77j2w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.155.0.tgz", + "integrity": "sha512-T1wWwH9/JI5g7Z4kEQwDOwhToxdDhRyOTklH+uuNpJ16m3MZFmGl+l2rKc0NHQdbVRG2LTOBsNjpW3h1BWytPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.155.0.tgz", + "integrity": "sha512-ZoRB3qJxJ8DWA41jHja+YeB0lLfjBy4T+Kr15vnN1k65X3zbJt3rPZftEwN4Ju4tmA4K/T9dWWD7Z8ewQLnrVA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.155.0.tgz", + "integrity": "sha512-vxtL86BtM+IgrpejA86nbTk5j0HKTIMeuaJ1fQciw6p9RfavPtIPjI7gN34owap0yG9txXBaAWpGdxokNwdqIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.155.0.tgz", + "integrity": "sha512-tN6Ru5e0UVnWaIuiH8jEwnvxuxg7FvhWwSd3oe5oDhOD4ObsSr9/N6WfHLjilUWlPPj65ptwrSDH0Y7lzwTzmw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.155.0.tgz", + "integrity": "sha512-h4ozA5n6L6lwolsz9iwunEhKWnIVbmFRots5QxEix0H6nJ5ICpuDa7PuShuhfpIDFe3+Qvyscioyiv+9g+4Syg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.155.0.tgz", + "integrity": "sha512-058/+LardpfuUlsKIvBGk/CYoakEVcMgqYx8GgyUZeOxFWTojYLlCc1Gb60/y21v3esDhHidgiY/Zbq9LpBhaQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.155.0.tgz", + "integrity": "sha512-nrOt2Y3xIAzu+lSPzH0864ieO+iCCXgoo9qFlGANE8Xh0cQ+RP8Wstfp+/wXN2YCyb98cAGzX0VruKYw7it/jw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.155.0.tgz", + "integrity": "sha512-KYAayyN5hQbJPtGKtRxlyc8XYmyntOplyXSQzTDrmbz7l/GCrzQbSswvyJFBTH1LGtsZrbXOAfN52i/Kz6kLKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.155.0.tgz", + "integrity": "sha512-CSuSY5hfjtsBnHXydOj8jiNfS1qHbdPZuPz1YL1cSgK7VmNYP+QlZIbG0BBYYBgX/vYEgZwbG9mBdW4YairZ5w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.155.0.tgz", + "integrity": "sha512-7KCfOQm+Nz2N8trAXbQkal4TQ5756WVEmhm35y816YHvyFnEfVsICsiV5k0pEszNf/fRm4cm2i6i18SJ6/iCWg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-musl": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.155.0.tgz", + "integrity": "sha512-JSlhgoK+/g1TGJI5NuADx2+6syhxnQNLCWLXyO5QLFyetomcr/vIxSdiNlmyAv963YXUzCuwAwRG6npZ5xyJ1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.155.0.tgz", + "integrity": "sha512-WFIX+dPokWp64mi434Md3U3lJaTwNxAphvGjpltoyQjGUsdXavOIRrnp9dOS34Hd75HOAwDxAI+YwWOwqmJbtg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.155.0.tgz", + "integrity": "sha512-g6xSDC/JpbnVOz5uafMGyK3txBVRFMQTx8opv/yHXGxqV3ZMVl3bf7W8XrSnF68dmy3gM4dgReNryuE53+WkeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.155.0.tgz", + "integrity": "sha512-6/4xlxKlZJWrQ0uwDFPc0H9+xLu7068CKhX3vIDW3SbvP/lVgnVuT5v6dyugeWskWpuxqF/WJ4WKwhxjU3pG2w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-openharmony-arm64": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.155.0.tgz", + "integrity": "sha512-tltklL0J0XjDxIRTBXWOBhvc2mitcmES45pIxhwDWfxRyqz7Vkeu0NekTZEIxGE4f/lXgq3vZcjjffteQOVorg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.155.0.tgz", + "integrity": "sha512-alAb9TzjatUEsOeoncAziUnfdTDxfyswhalFZ9sC6plUgATIUx2NIZ0+bMn6aJ28AduS1OpG/OAisr/YISn4Ig==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-ia32-msvc": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.155.0.tgz", + "integrity": "sha512-yc5cbSfcGmRv/KpxDFuyk8adEBaWd/9HilWvBbQ4bFbus1V2PUh2mGB2Cfq9rqZTqLeiMT8x0skV+LKp9hOMgQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.155.0.tgz", + "integrity": "sha512-8heq6jGq+rfpTDRDjoQiBHw0maQZf3IXkS99pdHQZPoTL5kyF5qyPS0RidUlSdnWDIqxXb5nux7GBD9cT+imUw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.155.0.tgz", + "integrity": "sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.13", + "resolved": "https://registry.npmmirror.com/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.13.tgz", + "integrity": "sha512-wgKggnhZVL9Bfx1OaKKTrYY9BFRk6C8UAkQNUcIv1+llzYrIqy+RZm5HPKzn0NpEBvTVhTqB4kQyllZywsRBRQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@valibot/to-json-schema": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@valibot/to-json-schema/-/to-json-schema-1.8.0.tgz", + "integrity": "sha512-a0M+uwCuQZEPAo65NYkFSJ14O5c213KoSZmPdoCfuFvUhfULi4T2Z6Tpjv6lTVMW9RoLm74RpRAjNEa43KcN+g==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "valibot": "^1.5.0" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.44", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.44.tgz", + "integrity": "sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.9", + "@vue/shared": "3.5.44", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.44", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.44.tgz", + "integrity": "sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.44", + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.44", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.44.tgz", + "integrity": "sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.9", + "@vue/compiler-core": "3.5.44", + "@vue/compiler-dom": "3.5.44", + "@vue/compiler-ssr": "3.5.44", + "@vue/shared": "3.5.44", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.29", + "source-map-js": "^1.2.2" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.44", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.44.tgz", + "integrity": "sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.44", + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.44", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.44.tgz", + "integrity": "sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@x18n/builtins": { + "version": "0.1.3", + "resolved": "https://registry.npmmirror.com/@x18n/builtins/-/builtins-0.1.3.tgz", + "integrity": "sha512-/T2q1xQ513oZ19VjGLmXVZjxAdzDahDZ4Ssh0IbAVlcOpSSfgZkRgo5uh8JAdQSPxtWBTKHslOYxSptWJq9j7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vue/compiler-sfc": "^3.5.44", + "@x18n/core": "0.1.3", + "json5": "^2.2.3", + "jsonc-parser": "^3.3.1", + "oxc-parser": "^0.155.0", + "svelte": "^5.57.2", + "yaml": "^2.9.1" + } + }, + "node_modules/@x18n/cli": { + "version": "0.1.3", + "resolved": "https://registry.npmmirror.com/@x18n/cli/-/cli-0.1.3.tgz", + "integrity": "sha512-aOG1FJ1tJsnnjU3O13CktETY1GLW6FRmsw9KC5Mv35vEhah54O2+JAs0HBrqcmwADZAe7xwm6ZNY4DcaaV+BAQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@x18n/builtins": "0.1.3", + "@x18n/core": "0.1.3", + "@x18n/node": "0.1.3", + "@x18n/ui": "0.1.3", + "cac": "^7.1.0", + "devframe": "^1.2.6", + "nostics": "^1.3.0", + "yaml": "^2.9.1" + }, + "bin": { + "x18n": "bin.mjs" + }, + "engines": { + "node": ">=22" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@x18n/cli/node_modules/@devframes/agentic": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/@devframes/agentic/-/agentic-1.2.6.tgz", + "integrity": "sha512-MNUuFdkWBYsLv8/GToerFYUEjBloNVm8jyNKH7Sm0PNyU/vtiYgIgh1vv4CBIFDsdwaj5aTbmIu92S1UhPddXA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@modelcontextprotocol/client": "^2.3.1", + "@modelcontextprotocol/server": "^2.3.1", + "h3": "^2.0.1", + "pathe": "^2.0.3" + }, + "peerDependencies": { + "devframe": "1.2.6" + } + }, + "node_modules/@x18n/cli/node_modules/devframe": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/devframe/-/devframe-1.2.6.tgz", + "integrity": "sha512-mHzcm6ADzXgRMWdoSX+5PjwhmwAuC3SpDPi3+URznlpzxJF6tXwy5h1xr82zPKju38EVtdnYRnnP4hZwLK01vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "crossws": "^0.4.12", + "h3": "^2.0.1", + "nostics": "^1.3.0", + "pathe": "^2.0.3" + }, + "bin": { + "devframe": "bin/devframe.mjs" + }, + "peerDependencies": { + "@devframes/agentic": "1.2.6", + "cac": "^7.0.0" + }, + "peerDependenciesMeta": { + "@devframes/agentic": { + "optional": true + }, + "cac": { + "optional": true + } + } + }, + "node_modules/@x18n/core": { + "version": "0.1.3", + "resolved": "https://registry.npmmirror.com/@x18n/core/-/core-0.1.3.tgz", + "integrity": "sha512-u4lYzCPwuEctDenT6ZlvElj3LJvR23PJ+XCgWfqhNfgDSrPmippljekba9Hfcl2jBhaWx0SiE63A/wWVVoY4wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "nostics": "^1.3.0", + "valibot": "^1.5.0" + } + }, + "node_modules/@x18n/node": { + "version": "0.1.3", + "resolved": "https://registry.npmmirror.com/@x18n/node/-/node-0.1.3.tgz", + "integrity": "sha512-ALZVZ8jMblM552yC/ERZXLcmXxNjha1l4OqYUhkcZXibRhKwNqw5k2PvgdN1hcHVoC9DnS02zhyc7Cqbtm/O3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@x18n/builtins": "0.1.3", + "@x18n/core": "0.1.3", + "chokidar": "^6.0.0", + "ignore": "^7.0.13", + "jiti": "^2.7.0", + "jsonc-parser": "^3.3.1", + "tinyglobby": "^0.2.17", + "yaml": "^2.9.1" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@x18n/ui": { + "version": "0.1.3", + "resolved": "https://registry.npmmirror.com/@x18n/ui/-/ui-0.1.3.tgz", + "integrity": "sha512-X7c1MZd9Q5p0hflDYTkvEpZsD9twjvzBfauEDEF8kiz2qcig2uM8jEiieMboEA/yd5ikNc4uS9b2Q7MGcFyaGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@devframes/agentic": "1.2.5", + "@valibot/to-json-schema": "^1.8.0", + "@x18n/builtins": "0.1.3", + "@x18n/core": "0.1.3", + "devframe": "^1.2.6", + "valibot": "^1.5.0" + }, + "engines": { + "node": ">=22" + } + }, + "node_modules/@x18n/ui/node_modules/devframe": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/devframe/-/devframe-1.2.6.tgz", + "integrity": "sha512-mHzcm6ADzXgRMWdoSX+5PjwhmwAuC3SpDPi3+URznlpzxJF6tXwy5h1xr82zPKju38EVtdnYRnnP4hZwLK01vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "crossws": "^0.4.12", + "h3": "^2.0.1", + "nostics": "^1.3.0", + "pathe": "^2.0.3" + }, + "bin": { + "devframe": "bin/devframe.mjs" + }, + "peerDependencies": { + "@devframes/agentic": "1.2.6", + "cac": "^7.0.0" + }, + "peerDependenciesMeta": { + "@devframes/agentic": { + "optional": true + }, + "cac": { + "optional": true + } + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aria-query": { + "version": "5.3.1", + "resolved": "https://registry.npmmirror.com/aria-query/-/aria-query-5.3.1.tgz", + "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmmirror.com/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/cac": { + "version": "7.1.0", + "resolved": "https://registry.npmmirror.com/cac/-/cac-7.1.0.tgz", + "integrity": "sha512-LMDU/U2yA4IPIY8KT0NsNPWEYZvAMkbgyspxJ6btJaYV+WMDOHAZCmB0lsTObiHaRS1V/ztKAl7+TSkTqXyeoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/chokidar": { + "version": "6.0.0", + "resolved": "https://registry.npmmirror.com/chokidar/-/chokidar-6.0.0.tgz", + "integrity": "sha512-Ec2Z7wpcKBiMpR7DxteoqS/sq5G5d2A4fpxzPv6+fD7xNNdrTghn7L11YwV5EN1B3i72Erc3XVT5FkWIDx90+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^5.1.1" + }, + "engines": { + "node": ">= 22.22" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crossws": { + "version": "0.4.17", + "resolved": "https://registry.npmmirror.com/crossws/-/crossws-0.4.17.tgz", + "integrity": "sha512-YG2kyfafNXKmu7e6k64yrj6whrw7m5sBIsOSXOlJ/72X3TQWRQuw8DhvXFDcBk8HF77PnTSygnm7xpYCTnFpow==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "srvx": ">=0.11.5" + }, + "peerDependenciesMeta": { + "srvx": { + "optional": true + } + } + }, + "node_modules/devalue": { + "version": "5.9.4", + "resolved": "https://registry.npmmirror.com/devalue/-/devalue-5.9.4.tgz", + "integrity": "sha512-sPAT4pztbu6586/hrhOnMKS17IJrvg12mXiSPSS3W5qDeN2RGgvZ0diZCm31dBbnevfVmujNO3IM2wrS4Y2Rhg==", + "dev": true, + "license": "MIT" + }, + "node_modules/devframe": { + "version": "1.2.5", + "resolved": "https://registry.npmmirror.com/devframe/-/devframe-1.2.5.tgz", + "integrity": "sha512-7txhfBgFafXHN/KIyP/M6F1W5WF1VPypoB4mZtZEa4KM8n1Y57EtnVm281Y3cg7SHti/PtfCtmmmtDh/k/CS3g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "crossws": "^0.4.12", + "h3": "^2.0.1", + "nostics": "^1.3.0", + "pathe": "^2.0.3" + }, + "bin": { + "devframe": "bin/devframe.mjs" + }, + "peerDependencies": { + "@devframes/agentic": "1.2.5", + "cac": "^7.0.0" + }, + "peerDependenciesMeta": { + "@devframes/agentic": { + "optional": true + }, + "cac": { + "optional": true + } + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmmirror.com/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esrap": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/esrap/-/esrap-2.4.0.tgz", + "integrity": "sha512-CQPcneEHw/czj32uwQC52nYnax8H4SXt25FCM+LIwGZ49cMIxpOj3bP8wmzcI+Z0HIy5KkClaPhRLfCySzwHPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "peerDependencies": { + "@typescript-eslint/types": "^8.2.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/types": { + "optional": true + } + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/eventsource-parser/-/eventsource-parser-3.1.1.tgz", + "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmmirror.com/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/h3": { + "version": "2.0.8", + "resolved": "https://registry.npmmirror.com/h3/-/h3-2.0.8.tgz", + "integrity": "sha512-ENuKlF9kC6E6PrvY1PUyE0qkrnnPTIt2/v48uyEEfTVfgoiqBCE0uwwf++2XrWwT1gxjQBDLQ8PAsmZVniKvTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "rou3": "^1.0.0", + "srvx": "^1.0.6" + }, + "bin": { + "h3": "bin/h3.mjs" + }, + "engines": { + "node": ">=20.19.0" + }, + "peerDependencies": { + "crossws": "^0.4.12", + "ocache": ">=0.3.0" + }, + "peerDependenciesMeta": { + "crossws": { + "optional": true + }, + "ocache": { + "optional": true + } + } + }, + "node_modules/ignore": { + "version": "7.0.14", + "resolved": "https://registry.npmmirror.com/ignore/-/ignore-7.0.14.tgz", + "integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmmirror.com/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/jose": { + "version": "6.2.14", + "resolved": "https://registry.npmmirror.com/jose/-/jose-6.2.14.tgz", + "integrity": "sha512-3JasLuki1NRLQvY4wCoC37KZk4qxoBx2k2aFqLxT84IezqW0bkJKnNtxnZj/Fu1xsQivoc/lytxaRHJoGLjJ1A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmmirror.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nostics": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/nostics/-/nostics-1.3.0.tgz", + "integrity": "sha512-wzRsrJwNlFbqIRQt8aCeL2WE8USip/uuvGSOZV1D02CxX8ABTMbw8IywKjH7yWHETMXbWJI4OBpihg9rmz2Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/oxc-parser": { + "version": "0.155.0", + "resolved": "https://registry.npmmirror.com/oxc-parser/-/oxc-parser-0.155.0.tgz", + "integrity": "sha512-C/ReSf1JUFukK/zvk6jhcNibSssvas5+ktIzK7fbKVd3CedWe59C3QwHEOrEZj/4Rt9+xg0Jeis/Jv1F/KM1mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "^0.155.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxc-parser/binding-android-arm-eabi": "0.155.0", + "@oxc-parser/binding-android-arm64": "0.155.0", + "@oxc-parser/binding-darwin-arm64": "0.155.0", + "@oxc-parser/binding-darwin-x64": "0.155.0", + "@oxc-parser/binding-freebsd-x64": "0.155.0", + "@oxc-parser/binding-linux-arm-gnueabihf": "0.155.0", + "@oxc-parser/binding-linux-arm-musleabihf": "0.155.0", + "@oxc-parser/binding-linux-arm64-gnu": "0.155.0", + "@oxc-parser/binding-linux-arm64-musl": "0.155.0", + "@oxc-parser/binding-linux-ppc64-gnu": "0.155.0", + "@oxc-parser/binding-linux-riscv64-gnu": "0.155.0", + "@oxc-parser/binding-linux-riscv64-musl": "0.155.0", + "@oxc-parser/binding-linux-s390x-gnu": "0.155.0", + "@oxc-parser/binding-linux-x64-gnu": "0.155.0", + "@oxc-parser/binding-linux-x64-musl": "0.155.0", + "@oxc-parser/binding-openharmony-arm64": "0.155.0", + "@oxc-parser/binding-win32-arm64-msvc": "0.155.0", + "@oxc-parser/binding-win32-ia32-msvc": "0.155.0", + "@oxc-parser/binding-win32-x64-msvc": "0.155.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmmirror.com/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/postcss": { + "version": "8.5.32", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.32.tgz", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/readdirp": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rou3": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/rou3/-/rou3-1.0.0.tgz", + "integrity": "sha512-ySeaQkSrua+ut9g+65I7FHqOFBaY8tV0FmccXItoq0q21se32Q3u4YiW7/RqXSosWgYJaaKwRHXy3BST9PeCNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.19.0" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/srvx": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/srvx/-/srvx-1.0.8.tgz", + "integrity": "sha512-ngFS/J6St4PJfHRHGjr78xkPPtbyXtdMOLNE4x/XZunEK3OhV7aGUWMHf9WTUEy6wm1U0W4okkd82ZFFWRVQTw==", + "dev": true, + "license": "MIT", + "bin": { + "srvx": "bin/srvx.mjs" + }, + "engines": { + "node": ">=20.16.0" + } + }, + "node_modules/svelte": { + "version": "5.57.3", + "resolved": "https://registry.npmmirror.com/svelte/-/svelte-5.57.3.tgz", + "integrity": "sha512-5mAftM3SoDV9X0zdF386F9p2pv8iKOwi/KfBS1XnBAkVCKFzVOLHUoa8iGWAt4buoicLmyWVRpuuD5wplXOQsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "@jridgewell/sourcemap-codec": "^1.6.0", + "@sveltejs/acorn-typescript": "^1.0.13", + "@types/estree": "^1.0.9", + "acorn": "^8.18.0", + "aria-query": "5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "devalue": "^5.9.2", + "esm-env": "^1.2.1", + "esrap": "^2.3.6", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/valibot": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/valibot/-/valibot-1.5.0.tgz", + "integrity": "sha512-nil6AkP2TChWL43Z5uJ6GTxX01CUA+g8LWUM+N/rB9NBbkUMaUsi9PUNzlUPgoKASgmx9f7eGOYpJ04/fSa6FQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typescript": ">=5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmmirror.com/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/zimmerframe": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/zimmerframe/-/zimmerframe-1.1.5.tgz", + "integrity": "sha512-msJxIvYDYcoNL+PJsu+7qmpDWsYmAxTY+2TNYXXF0hzBzBk0BMecOqDOG/EckUoKCuKwObfbugIl8QpqHDXeFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/zod": { + "version": "4.6.7", + "resolved": "https://registry.npmmirror.com/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/ruoyi-fastapi-backend/.x18n/tooling/package.json b/ruoyi-fastapi-backend/.x18n/tooling/package.json new file mode 100644 index 000000000..121de129b --- /dev/null +++ b/ruoyi-fastapi-backend/.x18n/tooling/package.json @@ -0,0 +1,15 @@ +{ + "name": "ruoyi-backend-i18n-tools", + "private": true, + "version": "1.0.0", + "engines": { + "node": ">=22" + }, + "devDependencies": { + "@x18n/cli": "0.1.3" + }, + "scripts": { + "i18n:check": "x18n --root ../.. check --json", + "test": "node --test tests/*.test.mjs" + } +} diff --git a/ruoyi-fastapi-backend/.x18n/tooling/tests/usage.test.mjs b/ruoyi-fastapi-backend/.x18n/tooling/tests/usage.test.mjs new file mode 100644 index 000000000..eb0a3758b --- /dev/null +++ b/ruoyi-fastapi-backend/.x18n/tooling/tests/usage.test.mjs @@ -0,0 +1,81 @@ +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import { cp, mkdtemp, rm, writeFile } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join } from 'node:path' +import { test } from 'node:test' +import { fileURLToPath } from 'node:url' + +const backend = new URL('../../../', import.meta.url) +const cli = fileURLToPath(new URL('../node_modules/@x18n/cli/bin.mjs', import.meta.url)) + +test('Python translation entry points are scanned with the project config', async () => { + const root = await mkdtemp(join(tmpdir(), 'ruoyi-python-x18n-')) + function check() { + const result = spawnSync(process.execPath, [cli, '--root', root, 'check', '--json'], { + encoding: 'utf8', + }) + assert.ifError(result.error) + assert.ok(result.stdout, result.stderr) + return { status: result.status, report: JSON.parse(result.stdout) } + } + + try { + await cp(new URL('x18n.config.yml', backend), join(root, 'x18n.config.yml')) + await cp(new URL('i18n/catalogs/', backend), join(root, 'i18n/catalogs'), { recursive: true }) + await writeFile( + join(root, 'messages.py'), + `from i18n import t +from i18n.translator import I18nUtil + +t('common.success') +t("common.failure", locale='en-US') +I18nUtil.translate('common.error') +I18nUtil.translate("common.forbidden") +t( + 'common.unavailable', + locale='en-US', +) +ResponseUtil.success(msg_key='profile.localeSaved') +my_t('missing.otherFunction') +item.t('missing.otherObject') +OtherI18nUtil.translate('missing.otherClass') +t('missing.' + suffix) +t(f'missing.{suffix}') +` + ) + let result = check() + assert.equal(result.status, 0, JSON.stringify(result.report)) + assert.ok(result.report.data.projects[0].coverage.every((item) => item.total > 0)) + const unused = new Set( + result.report.diagnostics.filter((item) => item.code === 'unused-key').map((item) => item.key) + ) + for (const key of [ + 'common.success', + 'common.failure', + 'common.error', + 'common.forbidden', + 'common.unavailable', + 'profile.localeSaved', + ]) { + assert.ok(!unused.has(key), `Usage was not found: ${key}`) + } + + await writeFile( + join(root, 'missing.py'), + `t('missing.shortEntry')\nI18nUtil.translate("missing.classEntry")\n` + ) + result = check() + assert.equal(result.status, 1) + assert.deepEqual( + new Set( + result.report.diagnostics + .filter((item) => item.code === 'missing-key') + .map((item) => item.key) + ), + new Set(['missing.shortEntry', 'missing.classEntry']) + ) + } finally { + await rm(root, { recursive: true, force: true }) + } +}) diff --git a/ruoyi-fastapi-backend/Dockerfile.my b/ruoyi-fastapi-backend/Dockerfile.my index f872739dc..62973ce19 100644 --- a/ruoyi-fastapi-backend/Dockerfile.my +++ b/ruoyi-fastapi-backend/Dockerfile.my @@ -10,6 +10,8 @@ COPY . . # 安装依赖 RUN pip install --no-cache-dir -r requirements.txt -i ${PIP_INDEX_URL} +RUN python scripts/compile_i18n.py + # 暴露端口 EXPOSE 9099 diff --git a/ruoyi-fastapi-backend/Dockerfile.pg b/ruoyi-fastapi-backend/Dockerfile.pg index 28ddb35bd..daa2907d9 100644 --- a/ruoyi-fastapi-backend/Dockerfile.pg +++ b/ruoyi-fastapi-backend/Dockerfile.pg @@ -10,6 +10,8 @@ COPY . . # 安装依赖 RUN pip install --no-cache-dir -r requirements-pg.txt -i ${PIP_INDEX_URL} +RUN python scripts/compile_i18n.py + # 暴露端口 EXPOSE 9099 diff --git a/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/assets/web/dev.html.tmpl b/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/assets/web/dev.html.tmpl index d895436db..3d21dc786 100644 --- a/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/assets/web/dev.html.tmpl +++ b/ruoyi-fastapi-backend/cli/runtime/plugin/scaffold/assets/web/dev.html.tmpl @@ -63,6 +63,7 @@

__PLUGIN_ID__ · 模拟宿主

仅使用本地模拟响应,不连接真实后端。此页面不进入生产构建。

+
新建对话{{ $t('plugin.ai:newConversation') }}
- {{ session.sessionTitle || '新对话' }} + {{ session.sessionTitle || $t('plugin.ai:newConversation') }}
{{ formatTime(session.createdAt) }} @@ -48,7 +48,7 @@ v-if="sessionList.length === 0 && !sessionLoading" class="empty-session" > - 暂无历史对话 + {{ $t('plugin.ai:noConversationHistory') }}
@@ -57,11 +57,11 @@
- AI 智能助手 + {{ $t('plugin.ai:aIAssistant') }}
@@ -104,8 +104,8 @@
-

你好!我是你的 AI 助手

-

请在下方输入问题开始对话...

+

{{ $t('plugin.ai:helloIAmYourAIAssistant') }}

+

{{ $t('plugin.ai:enterAQuestionBelowToStartAConversation') }}

- {{ msg.role === 'user' ? '我' : 'AI 助手' }} + {{ msg.role === 'user' ? $t('plugin.ai:me') : $t('plugin.ai:aIAssistant') }}
@@ -241,7 +242,7 @@ type="textarea" :rows="3" resize="none" - placeholder="请输入您的问题... (Enter 发送,Shift + Enter 换行)" + :placeholder="$t('plugin.ai:enterYourQuestionEnterToSendShiftEnterForA')" @keydown.enter.exact.prevent="handleSend" :disabled="loading" /> @@ -266,7 +267,7 @@ currentModelInfo.supportImages === 'Y' && userConfig.visionEnabled == '0' " - content="上传图片" + :content="$t('plugin.ai:uploadImages')" placement="top" > - 深度思考 - + {{ $t('plugin.ai:deepReasoning') }}
- {{ loading ? '停止' : '发送' }} + {{ loading ? $t('plugin.ai:stop') : $t('plugin.ai:send') }}
@@ -307,7 +308,7 @@ - + - + - + - + diff --git a/ruoyi-fastapi-frontend/vue2/web/src/components/FileUpload/index.vue b/ruoyi-fastapi-frontend/vue2/web/src/components/FileUpload/index.vue index 2a7ea2e0c..727f41661 100644 --- a/ruoyi-fastapi-frontend/vue2/web/src/components/FileUpload/index.vue +++ b/ruoyi-fastapi-frontend/vue2/web/src/components/FileUpload/index.vue @@ -225,7 +225,9 @@ export default { }, // 文件个数超出 handleExceed() { - this.$modal.msgError(t('file:interface.youCanUploadAtMostValueFiles', { value0: this.limit })) + this.$modal.msgError( + t('file:interface.youCanUploadAtMostValueFiles.index', { value0: this.limit }) + ) }, // 上传失败 handleUploadError(err) { diff --git a/ruoyi-fastapi-frontend/vue2/web/src/components/LanguageSelect/index.vue b/ruoyi-fastapi-frontend/vue2/web/src/components/LanguageSelect/index.vue index bf4f50f5f..6339bf270 100644 --- a/ruoyi-fastapi-frontend/vue2/web/src/components/LanguageSelect/index.vue +++ b/ruoyi-fastapi-frontend/vue2/web/src/components/LanguageSelect/index.vue @@ -1,14 +1,13 @@ + ', path, hljs), + '<script>&</script>' + ) + } +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/dict-cache.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/dict-cache.test.mjs new file mode 100644 index 000000000..7d9ef90a0 --- /dev/null +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/dict-cache.test.mjs @@ -0,0 +1,77 @@ +import assert from 'node:assert/strict' +import { readFileSync } from 'node:fs' +import { createRequire } from 'node:module' +import { test } from 'node:test' + +const require = createRequire(import.meta.url) +const Vue = require('vue') +const Vuex = require('vuex') +Vue.use(Vuex) +const read = (path) => + readFileSync(new URL(`../../src/${path}`, import.meta.url), 'utf8').replace(/^import .*$/gm, '') + +test('dictionary consumers retain their array and ignore late responses after invalidation or logout', async () => { + let token = 'account-one' + const requests = [] + const module = new Function( + 'getDicts', + 'getToken', + read('store/modules/dict.js').replace('export default', 'return') + )( + () => new Promise((resolve) => requests.push(resolve)), + () => token + ) + const store = new Vuex.Store({ modules: { dict: module } }) + const DictData = new Function( + 'resolveText', + read('utils/dict/DictData.js').replace('export default class', 'return class') + )((text) => text) + const DictMeta = { + parse: (type) => ({ + type, + request: () => store.dispatch('dict/loadDict', type), + responseConverter: (rows) => + rows.map((row) => new DictData(row.dictLabel, row.dictValue, row)), + }), + } + const Dict = new Function( + 'Vue', + 'mergeRecursive', + 'DictMeta', + 'DictData', + read('utils/dict/Dict.js').replace('export default class Dict', 'class Dict') + ';return Dict' + )(Vue, (_defaults, options) => options, DictMeta, DictData) + const install = new Function( + 'Dict', + 'mergeOptions', + read('utils/dict/index.js').replace('export default function', 'return function') + )(Dict, () => {}) + const LocalVue = Vue.extend() + install(LocalVue, {}) + const first = new LocalVue({ store, dicts: ['status'] }) + const second = new LocalVue({ store, dicts: ['status'] }) + const held = first.dict.type.status + assert.equal(requests.length, 1) + store.commit('dict/REMOVE_DICT', 'status') + await Vue.nextTick() + assert.equal(requests.length, 2) + requests[1]({ data: [{ dictLabel: 'new', dictLabelI18n: { 'en-US': 'New' }, dictValue: '1' }] }) + await new Promise(setImmediate) + assert.equal(held[0].label, 'new') + assert.equal(second.dict.type.status[0].label, 'new') + requests[0]({ data: [{ dictLabel: 'old', dictLabelI18n: {}, dictValue: '1' }] }) + await new Promise(setImmediate) + assert.equal(held[0].label, 'new') + assert.equal(first.dict.type.status, held, 'existing consumer references stay attached') + store.commit('dict/REMOVE_DICT', 'status') + await Vue.nextTick() + token = null + store.commit('dict/CLEAN_DICT') + await Vue.nextTick() + requests[2]({ data: [{ dictLabel: 'old account', dictValue: '1' }] }) + await new Promise(setImmediate) + assert.equal(held.length, 0) + assert.equal(requests.length, 3) + first.$destroy() + second.$destroy() +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/message-shapes.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/message-shapes.test.mjs new file mode 100644 index 000000000..e24dbafc8 --- /dev/null +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/message-shapes.test.mjs @@ -0,0 +1,97 @@ +import assert from 'node:assert/strict' +import { test } from 'node:test' +import { mkdtemp, mkdir, writeFile, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { dirname, join, sep } from 'node:path' +import { pathToFileURL } from 'node:url' +import { checkLocaleRegistration } from '../../scripts/check-i18n.mjs' + +async function fixture() { + const root = await mkdtemp(join(tmpdir(), 'ruoyi-message-shapes-')) + const url = pathToFileURL(root + sep) + const write = async (file, content) => { + const path = join(root, file) + await mkdir(dirname(path), { recursive: true }) + await writeFile(path, content) + } + const metadata = (codes) => ({ + sourceLocale: 'zh-CN', + defaultLocale: 'zh-CN', + locales: codes.map((code) => ({ + code, + enabled: true, + aliases: [], + fallback: [], + direction: 'ltr', + })), + }) + await write('src/i18n/locale-meta.json', JSON.stringify(metadata(['zh-CN', 'en-US']))) + for (const code of ['zh-CN', 'en-US']) { + await write( + `src/i18n/locales/${code}/common.json`, + JSON.stringify({ ready: code, branch: { leaf: code }, list: [code] }) + ) + } + // A host language must not become an implicit requirement of the plugin. + await write('plugins/example/locale-meta.json', JSON.stringify(metadata(['zh-CN']))) + await write('plugins/example/locales/zh-CN.json', JSON.stringify({ ready: '插件' })) + return { root, url, write } +} + +test('literal string messages pass and comments, examples and missing keys remain separate concerns', async () => { + const { root, url, write } = await fixture() + try { + await write( + 'src/Example.jsx', + `// t('common:branch') +const example = "t('common:list')"; +export const render = () => {t('common:branch.leaf')}{t('common:missing')}; +const dynamic = 'common:' + name; t(dynamic);` + ) + await write( + 'src/Example.vue', + ` +` + ) + assert.deepEqual(await checkLocaleRegistration(url), [ + { name: 'host', locales: ['zh-CN', 'en-US'] }, + { name: 'plugin.example', locales: ['zh-CN'] }, + ]) + } finally { + await rm(root, { recursive: true, force: true }) + } +}) + +for (const locale of ['zh-CN', 'en-US']) { + for (const [shape, message] of [ + ['object', { nested: 'text' }], + ['array', ['text']], + ]) { + test(`rejects ${locale} ${shape} messages referenced from Vue templates and JS calls`, async () => { + const { root, url, write } = await fixture() + try { + for (const code of ['zh-CN', 'en-US']) { + await write( + `src/i18n/locales/${code}/common.json`, + JSON.stringify({ ready: 'OK', invalid: code === locale ? message : 'Valid string' }) + ) + } + await write('src/script.js', "this.$t('common:invalid')") + await write( + 'src/views/tool/build/Example.vue', + `` + ) + await assert.rejects(checkLocaleRegistration(url), (error) => { + assert.match(error.message, /Invalid translation message shape/) + assert.ok(error.message.includes(`common:invalid resolves to ${shape} in ${locale}`)) + assert.ok(error.message.includes('src/script.js:1')) + assert.ok(error.message.includes('src/views/tool/build/Example.vue:1')) + assert.equal(error.message.includes(locale === 'zh-CN' ? 'in en-US' : 'in zh-CN'), false) + return true + }) + } finally { + await rm(root, { recursive: true, force: true }) + } + }) + } +} diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/navigation.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/navigation.test.mjs index 96f12ccc6..734c9caa2 100644 --- a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/navigation.test.mjs +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/navigation.test.mjs @@ -4,7 +4,9 @@ import { createRequire } from 'node:module' import { test } from 'node:test' import { withLocalePatch } from '../../src/utils/localePayload.mjs' import { restoreVisitedViews, serializeVisitedViews } from '../../src/utils/tagsView.js' +import { createPluginLocaleRuntime } from '../../src/i18n/plugin.mjs' import { createLocaleRuntime } from '../../src/i18n/runtime.mjs' +import LocaleForms from '../../src/i18n/forms.js' const require = createRequire(import.meta.url) const Vue = require('vue') @@ -25,12 +27,14 @@ const source = readFileSync(new URL('../../src/i18n/adapter.js', import.meta.url const adapter = new Function( 'Vue', 'i18n', + 'createPluginLocaleRuntime', source - .replace(/^import .*\n/gm, '') + .replace(/^import .*\r?\n/gm, '') .replace(/export const /g, 'const ') + .replace(/export function /g, 'function ') .replace('export default', 'const plugin =') + - '\nreturn { t, resolveRouteTitle, resolveText, localeState, plugin }' -)(Vue, i18n) + '\nreturn { t, resolveRouteTitle, resolveText, localeState, plugin, createPluginI18n }' +)(Vue, i18n, createPluginLocaleRuntime) Vue.use(adapter.plugin) function router() { @@ -62,7 +66,7 @@ test('route and dictionary labels react without changing the route, input or val ) const DictData = new Function( 'resolveText', - dataSource.replace(/^import .*\n/gm, '').replace('export default class', 'return class') + dataSource.replace(/^import .*\r?\n/gm, '').replace('export default class', 'return class') )(adapter.resolveText) const option = new DictData('正常', '0', { dictLabelI18n: { 'en-US': 'Active' } }) const vm = new Vue({ @@ -103,13 +107,6 @@ test('persisted tabs restore current metadata and explicit custom titles', () => assert.equal(restored[0].customTitle, 'User title') assert.equal(restored[0].params.id, '7') assert.equal(restored[0].hash, '#details') - const legacy = restoreVisitedViews( - [{ path: '/menu/1', title: '旧名称', meta: { title: '旧名称' } }, { path: '/removed' }, null], - (location) => instance.resolve(location).route - ) - assert.equal(legacy.length, 1) - assert.equal(legacy[0].meta.titleI18n['en-US'], 'Menu') - assert.equal(legacy[0].customTitle, undefined) }) test('locale patches preserve omitted languages and distinguish updates from deletion', () => { @@ -128,10 +125,8 @@ test('locale patches preserve omitted languages and distinguish updates from del }) test('a locale change revalidates only fields already displaying errors', () => { - const formSource = readFileSync(new URL('../../src/i18n/forms.js', import.meta.url), 'utf8') - const plugin = new Function(formSource.replace('export default', 'return'))() let mixin - plugin.install({ + LocaleForms.install({ mixin(value) { mixin = value }, @@ -149,3 +144,27 @@ test('a locale change revalidates only fields already displaying errors', () => mixin.watch['$locale.locale'].call(form) assert.deepEqual(calls, ['']) }) + +test('a plugin translator tracks Vue computed text without replacing its draft', async () => { + const plugin = adapter.createPluginI18n( + meta, + { + 'zh-CN': { 'plugin.test': { title: '插件标题' } }, + 'en-US': { 'plugin.test': { title: 'Plugin title' } }, + }, + 'plugin.test' + ) + const vm = new Vue({ + data: () => ({ draft: 'unsaved' }), + computed: { title: () => plugin.t('title') }, + }) + await i18n.setPreference('zh-CN') + await Vue.nextTick() + assert.equal(vm.title, '插件标题') + await i18n.setPreference('en-US') + await Vue.nextTick() + assert.equal(vm.title, 'Plugin title') + assert.equal(vm.draft, 'unsaved') + plugin.removePluginLocales() + vm.$destroy() +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/plugin.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/plugin.test.mjs new file mode 100644 index 000000000..d70a3043c --- /dev/null +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/plugin.test.mjs @@ -0,0 +1,80 @@ +import assert from 'node:assert/strict' +import { test } from 'node:test' +import { createLocaleRuntime } from '../../src/i18n/runtime.mjs' +import { createPluginLocaleRuntime } from '../../src/i18n/plugin.mjs' + +const entry = (code, fallback = []) => ({ + code, + enabled: true, + direction: 'ltr', + aliases: [], + fallback, +}) +const hostMeta = { + sourceLocale: 'zh-CN', + defaultLocale: 'zh-CN', + locales: [entry('zh-CN'), entry('en-US'), entry('ja-JP')], +} +function hostRuntime() { + return createLocaleRuntime({ + meta: hostMeta, + resources: Object.fromEntries( + hostMeta.locales.map(({ code }) => [code, { common: { hello: code } }]) + ), + storage: { get() {}, set() {} }, + scope: 'plugin-test', + }) +} +function plugin(host, namespace = 'plugin.demo') { + return createPluginLocaleRuntime({ + host, + namespace, + meta: { + sourceLocale: 'zh-CN', + defaultLocale: 'en-US', + languageFallbacks: { en: 'en-US' }, + locales: [entry('zh-CN'), entry('en-US', ['zh-CN'])], + }, + resources: { + 'zh-CN': { [namespace]: { hello: '你好', sourceOnly: '源语言' } }, + 'en-US': { [namespace]: { hello: 'Hello' } }, + }, + }) +} + +test('source plugins resolve the host language using only their own defaults and fallback chain', async () => { + const host = hostRuntime() + const first = plugin(host) + const second = plugin(host, 'plugin.other') + assert.equal(first.t('hello'), '你好') + await host.setPreference('en-US') + assert.equal(first.t('hello'), 'Hello') + assert.equal(first.t('sourceOnly'), '源语言') + await host.setPreference('ja-JP') + assert.equal(host.locale, 'ja-JP') + assert.equal(host.headers['Accept-Language'], 'ja-JP') + assert.equal(first.locale, 'en-US') + assert.equal(first.t('hello'), 'Hello') + assert.equal(host.engine.hasResourceBundle('en-US', 'plugin.demo'), false) + assert.equal(first.engine.hasResourceBundle('en-US', 'plugin.other'), false) + assert.equal(second.t('hello'), 'Hello') +}) + +test('unregistering and registering a plugin changes only its instance and preserves its catalogs', async () => { + const host = hostRuntime() + const first = plugin(host) + const second = plugin(host, 'plugin.other') + first.removePluginLocales() + await host.setPreference('en-US') + assert.equal(first.locale, 'zh-CN') + assert.equal(first.engine.hasResourceBundle('en-US', 'plugin.demo'), false) + assert.equal(second.t('hello'), 'Hello') + assert.equal(host.t('common:hello'), 'en-US') + first.registerPluginLocales() + first.registerPluginLocales() + assert.equal(first.locale, 'en-US') + assert.equal(first.t('hello'), 'Hello') + first.removePluginLocales() + first.registerPluginLocales() + assert.equal(first.t('sourceOnly'), '源语言') +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/protocol.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/protocol.test.mjs new file mode 100644 index 000000000..49ad1687e --- /dev/null +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/protocol.test.mjs @@ -0,0 +1,226 @@ +import assert from 'node:assert/strict' +import { test } from 'node:test' +import { readFileSync } from 'node:fs' +import { createLocaleRuntime, createLocaleRegistry } from '../../src/i18n/runtime.mjs' + +const meta = JSON.parse(readFileSync(new URL('../../src/i18n/locale-meta.json', import.meta.url))) +const resources = { + 'zh-CN': { common: { sample: '中文' } }, + 'en-US': { common: { sample: 'English' } }, +} +function setup(storage = { get: () => null, set: () => {} }, extra = {}) { + return createLocaleRuntime({ meta, resources, scope: 'contract:api', storage, ...extra }) +} +const key = 'contract:api:locale:v2:user:7' + +test('declared language families preserve exact variants', () => { + const registry = createLocaleRegistry(meta, resources) + assert.equal(registry.resolve('auto', ['en-GB']), 'en-US') + assert.equal(registry.resolve('auto', ['en-AU']), 'en-US') + const expanded = { + ...meta, + defaultLocale: 'en-US', + locales: [...meta.locales, { code: 'en-GB', enabled: true, aliases: [], fallback: ['en-US'] }], + } + const precise = createLocaleRegistry(expanded, { ...resources, 'en-GB': {} }) + assert.equal(precise.resolve('en-GB'), 'en-GB') + assert.equal(precise.resolve('zh-TW'), 'en-US') + assert.throws( + () => createLocaleRegistry({ ...meta, languageFallbacks: { en: 'missing' } }, resources), + /Invalid language fallback/ + ) +}) + +test('source language supplies missing text independently of the negotiation default', async () => { + const expanded = { + ...meta, + defaultLocale: 'en-US', + locales: [...meta.locales, { code: 'ja-JP', enabled: true, aliases: [], fallback: [] }], + } + const runtime = setup(undefined, { + meta: expanded, + resources: { ...resources, 'ja-JP': { common: {} } }, + }) + assert.equal(runtime.registry.resolve('unknown'), 'en-US') + await runtime.setPreference('ja-JP') + assert.equal(runtime.t('common:sample'), '中文') + assert.equal(runtime.resolveText('原始名称', { 'en-US': 'English name' }), '原始名称') +}) + +test('delayed save responses cannot overwrite a newer server revision from another tab', async () => { + const data = new Map() + const events = [] + const storage = { + get: (k) => data.get(k), + set: (k, v) => { + data.set(k, v) + events.push([k, v]) + }, + } + const a = setup(storage), + b = setup(storage) + a.setAccount(7, 'zh-CN', '0') + b.setAccount(7, 'zh-CN', '0') + let release + let server = { locale: 'zh-CN', revision: '0' } + const delayed = a.setPreference('en-US', { + save: async () => { + server = { locale: 'en-US', revision: '1' } + const response = { ...server } + await new Promise((resolve) => { + release = resolve + }) + return response + }, + }) + await Promise.resolve() + await b.setPreference('auto', { save: async () => (server = { locale: 'auto', revision: '2' }) }) + a.acceptStorageEvent(key, data.get(key)) + const writes = events.length + release() + await delayed + assert.deepEqual(server, { locale: 'auto', revision: '2' }) + assert.equal(a.preference, 'auto') + assert.equal(b.preference, 'auto') + assert.equal(events.length, writes) + assert.deepEqual(JSON.parse(data.get(key)), server) +}) + +test('out-of-order storage and profile reads preserve the latest decimal revision', () => { + const data = new Map() + const storage = { get: (k) => data.get(k), set: (k, v) => data.set(k, v) } + const runtime = setup(storage) + runtime.setAccount(7, 'en-US', '9007199254740993') + const old = JSON.stringify({ locale: 'zh-CN', revision: '9007199254740992' }) + data.set(key, old) + runtime.acceptStorageEvent(key, old) + runtime.setAccount(7, 'zh-CN', '9007199254740992') + assert.equal(runtime.preference, 'en-US') + assert.equal(runtime.preferenceRevision, '9007199254740993') + assert.equal(JSON.parse(data.get(key)).revision, '9007199254740993') + const restored = setup(storage) + restored.initialize(true) + assert.equal(restored.preference, 'en-US') + assert.equal(restored.preferenceRevision, '9007199254740993') +}) + +test('timeout recovery uses the authoritative snapshot and rejects malformed snapshots', async () => { + const runtime = setup() + runtime.setAccount(7, 'zh-CN', '1') + await runtime.setPreference('en-US', { + save: async () => { + throw Error('timeout') + }, + readBack: async () => ({ locale: 'en-US', revision: '2' }), + }) + assert.equal(runtime.preferenceRevision, '2') + await assert.rejects( + runtime.setPreference('zh-CN', { save: async () => ({ locale: 'zh-CN' }) }), + /Invalid locale snapshot/ + ) + assert.equal(runtime.preference, 'en-US') +}) + +test('offline account snapshots, guest choices and API instances are isolated', async () => { + const data = new Map() + const storage = { get: (k) => data.get(k), set: (k, v) => data.set(k, v) } + const runtime = setup(storage) + await runtime.setPreference('auto') + runtime.setAccount(7, 'en-US', '1') + const restored = setup(storage) + restored.initialize(true) + assert.equal(restored.preference, 'en-US') + assert.equal(restored.preferenceRevision, '1') + restored.setAccount(8, 'zh-CN', '0') + restored.acceptStorageEvent(key, JSON.stringify({ locale: 'auto', revision: '9' })) + assert.equal(restored.preference, 'zh-CN') + restored.setAccount(null) + assert.equal(restored.preference, 'auto') + const other = setup(storage, { scope: 'other:api' }) + other.initialize(true) + assert.equal(other.accountId, null) + assert.equal(other.preference, 'zh-CN') +}) + +test('refreshing the same account does not cancel a pending save', async () => { + const runtime = setup() + runtime.setAccount(7, 'zh-CN', '0') + let finish + const pending = runtime.setPreference('en-US', { + save: () => + new Promise((resolve) => { + finish = resolve + }), + }) + await Promise.resolve() + runtime.setAccount(7, 'zh-CN', '0') + finish({ locale: 'en-US', revision: '1' }) + await pending + assert.equal(runtime.preference, 'en-US') + assert.equal(runtime.preferenceRevision, '1') +}) + +test('timeout read-back adopts a newer remote preference even when the requested change lost', async () => { + const runtime = setup() + runtime.setAccount(7, 'zh-CN', '1') + await assert.rejects( + runtime.setPreference('en-US', { + save: async () => { + throw Error('timeout') + }, + readBack: async () => ({ locale: 'auto', revision: '3' }), + }), + /timeout/ + ) + assert.equal(runtime.preference, 'auto') + assert.equal(runtime.preferenceRevision, '3') +}) + +test('invalid profile snapshots leave the current account and its revision intact', () => { + const runtime = setup() + runtime.setAccount(7, 'en-US', '4') + assert.throws(() => runtime.setAccount(undefined, 'zh-CN', '4'), /Missing locale account/) + assert.throws(() => runtime.setAccount(8, 'zh-CN', 4), /Invalid locale snapshot/) + assert.throws(() => runtime.setAccount(8, 'zh-CN'), /Invalid locale snapshot/) + assert.equal(runtime.accountId, '7') + assert.equal(runtime.preferenceRevision, '4') + assert.equal(runtime.preference, 'en-US') +}) + +test('dynamic names keep the database source when an application uses English source catalogs', async () => { + const expanded = { + ...meta, + sourceLocale: 'en-US', + locales: [...meta.locales, { code: 'ja-JP', enabled: true, fallback: [] }], + } + const runtime = setup(undefined, { + meta: expanded, + resources: { ...resources, 'ja-JP': { common: {} } }, + }) + const translations = { 'en-US': 'Users' } + await runtime.setPreference('en-US') + assert.equal(runtime.resolveText('用户管理', translations), 'Users') + await runtime.setPreference('ja-JP') + assert.equal(runtime.t('common:sample'), 'English') + assert.equal(runtime.resolveText('用户管理', translations), '用户管理') +}) + +test('a missing key keeps explicit fallback text or uses a safe label and reports only once', (ctx) => { + const warn = ctx.mock.method(console, 'warn', () => {}) + const runtime = setup(undefined, { + appVersion: '2.0.0', + resources: { + ...resources, + 'en-US': { common: { translationUnavailable: 'Text unavailable' } }, + }, + }) + const t = runtime.engine.getFixedT('en-US', 'layout') + const options = { name: 'Private name' } + assert.equal(t('missing', { ...options, defaultValue: 'Hello {{name}}' }), 'Hello Private name') + assert.equal(t('missing', options), 'Text unavailable') + assert.equal(warn.mock.callCount(), 1) + assert.deepEqual(warn.mock.calls[0].arguments, [ + 'Missing translation', + { namespace: 'layout', key: 'missing', locale: 'en-US', version: '2.0.0' }, + ]) +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/runtime.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/runtime.test.mjs index f4548fc52..b6223a13d 100644 --- a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/runtime.test.mjs +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/runtime.test.mjs @@ -63,7 +63,7 @@ test('third language is configured, not a two-language branch', async () => { }) test('save failure leaves active language and preference intact', async () => { const runtime = setup() - runtime.setAccount(1, 'zh-CN') + runtime.setAccount(1, 'zh-CN', '0') await assert.rejects( runtime.setPreference('en-US', { save: async () => { @@ -76,7 +76,7 @@ test('save failure leaves active language and preference intact', async () => { }) test('an old save cannot overwrite a new account', async () => { const runtime = setup() - runtime.setAccount(1, 'zh-CN') + runtime.setAccount(1, 'zh-CN', '0') let done const pending = runtime.setPreference('en-US', { save: () => @@ -85,7 +85,7 @@ test('an old save cannot overwrite a new account', async () => { }), }) await Promise.resolve() - runtime.setAccount(2, 'zh-CN') + runtime.setAccount(2, 'zh-CN', '0') done() await assert.rejects(pending) assert.equal(runtime.accountId, '2') @@ -94,7 +94,7 @@ test('an old save cannot overwrite a new account', async () => { test('guest preference returns after logout; unsupported account preference is retained', async () => { const runtime = setup() await runtime.setPreference('en-US') - runtime.setAccount(1, 'fr-CA') + runtime.setAccount(1, 'fr-CA', '0') assert.equal(runtime.preference, 'fr-CA') assert.equal(runtime.locale, 'zh-CN') runtime.setAccount(null) @@ -113,10 +113,11 @@ test('auto follows changed device locale without changing the preference', async }) test('preference switches are serialized and recover after failed requests', async () => { const runtime = setup() - runtime.setAccount(1) + runtime.setAccount(1, 'zh-CN', '0') const seen = [] const save = async (value) => { seen.push(value) + return { locale: value, revision: String(seen.length) } } await Promise.all([ runtime.setPreference('en-US', { save }), diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/uploads.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/uploads.test.mjs index 1d696f5e0..c357a410b 100644 --- a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/uploads.test.mjs +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/uploads.test.mjs @@ -1,11 +1,13 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' +import { fileURLToPath } from 'node:url' import { test } from 'node:test' const require = createRequire(import.meta.url) const Vue = require('vue') const { i18n, t } = require('./test-runtime.cjs') +const { loadModule } = require('../support/load-module.cjs') function component(name) { const source = readFileSync( @@ -52,3 +54,28 @@ test('editor tooltips and picker text react without recreating editor content', vm.$destroy() await i18n.setPreference('zh-CN') }) + +test('import feedback is a text node and preserves literal markup and newlines', () => { + const vm = new Vue() + const text = 'Row 1: example\nRow 2' + let message + vm.$alert = (node) => { + message = node + } + component('ExcelImportDialog').methods.handleSuccess.call(vm, { msg: text }) + assert.equal(message.children.length, 1) + assert.equal(message.children[0].tag, undefined) + assert.equal(message.children[0].text, text) + vm.$destroy() +}) + +test('download errors retain server detail and have a translated string fallback', () => { + const { getResponseMessage } = loadModule( + fileURLToPath(new URL('../../src/utils/errorCode.js', import.meta.url)) + ) + assert.equal(getResponseMessage({ code: 403, msg: 'Specific message' }), 'Specific message') + assert.equal(typeof getResponseMessage({ code: 403 }), 'string') + const fallback = getResponseMessage({ code: 999, msg: ' ' }) + assert.equal(typeof fallback, 'string') + assert.ok(fallback.trim()) +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/validation.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/validation.test.mjs new file mode 100644 index 000000000..98a12a0b2 --- /dev/null +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/validation.test.mjs @@ -0,0 +1,58 @@ +import assert from 'node:assert/strict' +import { createRequire } from 'node:module' +import { test } from 'node:test' +import LocaleForms from '../../src/i18n/forms.js' +import { resolveRuleMessages } from '../../src/i18n/validation.mjs' + +const require = createRequire(import.meta.url) +const elementRequire = createRequire(require.resolve('element-ui/package.json')) +const ValidatorModule = elementRequire('async-validator') +const Validator = ValidatorModule.default || ValidatorModule + +function errors(rules, model) { + return new Promise((resolve) => { + new Validator(rules).validate(model, (failures) => resolve(failures || [])) + }) +} + +test('Element UI receives translated error strings on every validation', async () => { + let locale = 'zh-CN' + const messages = { 'zh-CN': '请输入密钥编号', 'en-US': 'Enter a key ID' } + const rule = Object.freeze({ required: true, message: () => messages[locale], trigger: 'blur' }) + let mixin + LocaleForms.install({ mixin: (value) => (mixin = value) }) + const field = { $options: { name: 'ElFormItem' }, getRules: () => [rule] } + mixin.created.call(field) + assert.equal((await errors({ kid: field.getRules() }, { kid: '' }))[0].message, messages['zh-CN']) + locale = 'en-US' + assert.equal((await errors({ kid: field.getRules() }, { kid: '' }))[0].message, messages['en-US']) + assert.deepEqual(await errors({ kid: field.getRules() }, { kid: 'primary-2026' }), []) + assert.equal(typeof rule.message, 'function') + assert.equal(field.getRules()[0].trigger, 'blur') +}) + +test('nested and array rules keep validators and values while translating messages', async () => { + const pattern = /^[a-z]+$/ + const validator = (_rule, value, callback) => callback(value === 'kept' ? undefined : 'invalid') + const source = { + type: 'object', + fields: { + name: { pattern, message: () => 'Letters only' }, + tags: { type: 'array', defaultField: { required: true, message: () => 'Enter a tag' } }, + custom: { validator }, + }, + } + const normalized = resolveRuleMessages(source) + assert.equal(normalized.fields.name.pattern, pattern) + assert.equal(normalized.fields.custom.validator, validator) + assert.equal(typeof source.fields.name.message, 'function') + assert.equal(typeof source.fields.tags.defaultField.message, 'function') + const model = { profile: { name: '123', tags: [''], custom: 'kept' } } + const before = structuredClone(model) + const failures = await errors({ profile: normalized }, model) + assert.deepEqual(failures.map((failure) => failure.message).sort(), [ + 'Enter a tag', + 'Letters only', + ]) + assert.deepEqual(model, before) +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/i18n/workspace.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/workspace.test.mjs new file mode 100644 index 000000000..e80dbbbe7 --- /dev/null +++ b/ruoyi-fastapi-frontend/vue2/web/tests/i18n/workspace.test.mjs @@ -0,0 +1,90 @@ +import assert from 'node:assert/strict' +import { test } from 'node:test' +import { mkdtemp, writeFile, readFile, mkdir, rm } from 'node:fs/promises' +import { tmpdir } from 'node:os' +import { join, dirname, sep } from 'node:path' +import { pathToFileURL } from 'node:url' +import { createRequire } from 'node:module' +import { spawnSync } from 'node:child_process' +import { checkLocaleRegistration } from '../../scripts/check-i18n.mjs' + +const require = createRequire(import.meta.url) +const cli = join(dirname(require.resolve('@x18n/cli/package.json')), 'bin.mjs') + +test('host and plugin checks use independent declared language sets', async () => { + const root = await mkdtemp(join(tmpdir(), 'ruoyi-plugin-locales-')) + const rootUrl = pathToFileURL(root + sep) + const write = async (file, text) => { + const path = join(root, file) + await mkdir(dirname(path), { recursive: true }) + await writeFile(path, text) + } + const metadata = (codes) => ({ + sourceLocale: 'zh-CN', + defaultLocale: 'zh-CN', + locales: codes.map((code) => ({ + code, + enabled: true, + aliases: [], + fallback: [], + direction: 'ltr', + })), + }) + try { + for (const file of [ + 'x18n.config.mjs', + 'src/i18n/x18n.config.mjs', + 'plugins/ai/x18n.config.mjs', + ]) { + const original = await readFile(new URL(`../../${file}`, import.meta.url), 'utf8') + const finder = new URL('../../scripts/x18n-project.mjs', import.meta.url).href + await write( + file, + original.replace("'../../scripts/x18n-project.mjs'", JSON.stringify(finder)) + ) + } + await write('src/i18n/locale-meta.json', JSON.stringify(metadata(['zh-CN', 'en-US', 'ja-JP']))) + await write('plugins/ai/locale-meta.json', JSON.stringify(metadata(['zh-CN', 'en-US']))) + for (const code of ['zh-CN', 'en-US', 'ja-JP']) + await write(`src/i18n/locales/${code}/common.json`, JSON.stringify({ greeting: code })) + for (const code of ['zh-CN', 'en-US']) + await write(`plugins/ai/locales/${code}.json`, JSON.stringify({ greeting: code })) + await write('src/example.js', "t('common:greeting')") + await write('plugins/ai/views/example.js', "t('plugin.ai:greeting')") + const projects = await checkLocaleRegistration(rootUrl) + assert.deepEqual( + projects.map((project) => project.locales.length), + [3, 2] + ) + const check = () => { + const result = spawnSync(process.execPath, [cli, '--root', root, 'check', '--json'], { + encoding: 'utf8', + }) + return { status: result.status, report: JSON.parse(result.stdout) } + } + const valid = check() + assert.equal(valid.status, 0, JSON.stringify(valid.report)) + assert.deepEqual( + valid.report.data.projects.map((project) => [project.name, project.coverage.length]), + [ + ['plugin.ai', 2], + ['host', 3], + ] + ) + await write( + 'plugins/ai/locale-meta.json', + JSON.stringify(metadata(['zh-CN', 'en-US', 'ja-JP'])) + ) + await assert.rejects(checkLocaleRegistration(rootUrl), /ja-JP/) + await write('plugins/ai/locales/ja-JP.json', JSON.stringify({ greeting: '' })) + const missing = check() + assert.equal(missing.status, 1) + assert.ok( + missing.report.diagnostics.some( + (item) => item.code === 'empty-translation' && item.locale === 'ja-JP' + ) + ) + } finally { + await rm(root, { recursive: true, force: true }) + } +}) diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginHostIntegration.test.cjs b/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginHostIntegration.test.cjs index 597ce10a1..f7da3e68a 100644 --- a/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginHostIntegration.test.cjs +++ b/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginHostIntegration.test.cjs @@ -260,7 +260,9 @@ module.exports = (async () => { } const load = createLoader({ '@/i18n': { - i18n: { headers: { 'Accept-Language': 'zh-CN', 'X-I18n-Version': '1' } }, + i18n: { + headers: { 'Accept-Language': 'zh-CN' }, + }, t: require('../i18n/test-runtime.cjs').t, }, axios, @@ -278,7 +280,6 @@ module.exports = (async () => { '@/store': { dispatch: async () => {} }, '@/utils/auth': { getToken: () => 'test-main-session' }, '@/utils/time': { getDisplayTimezone: () => 'UTC' }, - '@/utils/errorCode': {}, '@/utils/ruoyi': { tansParams: () => '', blobValidate: () => true }, '@/plugins/cache': {}, 'file-saver': { saveAs() {} }, diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginSse.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginSse.test.mjs index ae752b52e..74529249a 100644 --- a/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginSse.test.mjs +++ b/ruoyi-fastapi-frontend/vue2/web/tests/plugins/pluginSse.test.mjs @@ -91,6 +91,7 @@ const stream = createPluginSseTransport({ shouldEncryptRequest: (_, policy) => policy.active, serializeParams: (params) => new URLSearchParams(params).toString(), getTimezone: () => 'Asia/Shanghai', + getLocale: () => 'en-US', origin: 'https://test', fetchImpl: async (...args) => { fetched.push(args) @@ -110,6 +111,7 @@ assert.deepEqual(fetched[0][1].headers, { Accept: 'text/event-stream', 'X-Plugin-CSRF': 'host-only', 'X-Timezone': 'Asia/Shanghai', + 'Accept-Language': 'en-US', 'Last-Event-ID': '4', }) assert.equal(fetched[0][1].credentials, 'same-origin') diff --git a/ruoyi-fastapi-frontend/vue2/web/tests/security/logout.test.mjs b/ruoyi-fastapi-frontend/vue2/web/tests/security/logout.test.mjs index dac725e02..93a24ae2a 100644 --- a/ruoyi-fastapi-frontend/vue2/web/tests/security/logout.test.mjs +++ b/ruoyi-fastapi-frontend/vue2/web/tests/security/logout.test.mjs @@ -1,3 +1,7 @@ -import { runLogoutTests } from '../../../../../ruoyi-fastapi-test/frontend/logout-behavior.mjs' +import { + runLogoutTests, + runUserInfoSessionTests, +} from '../../../../../ruoyi-fastapi-test/frontend/logout-behavior.mjs' runLogoutTests(new URL('../../', import.meta.url), 'vue2') +runUserInfoSessionTests(new URL('../../', import.meta.url), 'vue2') diff --git a/ruoyi-fastapi-frontend/vue2/web/x18n.config.mjs b/ruoyi-fastapi-frontend/vue2/web/x18n.config.mjs index 7b6af0f1c..1369b76ee 100644 --- a/ruoyi-fastapi-frontend/vue2/web/x18n.config.mjs +++ b/ruoyi-fastapi-frontend/vue2/web/x18n.config.mjs @@ -1,37 +1,15 @@ -// https://x18n.dev/raw/guide/configuration.md -import { readFileSync } from 'node:fs' -import projectResources from './scripts/x18n-project.mjs' +import { existsSync, readdirSync } from 'node:fs' -const meta = JSON.parse( - readFileSync(new URL('./src/i18n/locale-meta.json', import.meta.url), 'utf8') -) +// 每个项目单独声明语言,新增宿主语言不会要求插件补齐该语言。 +const plugins = new URL('./plugins/', import.meta.url) export default { - sourceLocale: meta.sourceLocale, - locales: [ - ...new Set([ - meta.sourceLocale, - ...meta.locales.filter((item) => item.enabled).map((item) => item.code), - ]), + projects: [ + 'src/i18n', + ...readdirSync(plugins, { withFileTypes: true }) + .filter( + (entry) => + entry.isDirectory() && existsSync(new URL(`${entry.name}/x18n.config.mjs`, plugins)) + ) + .map((entry) => `plugins/${entry.name}`), ], - presets: ['i18next'], - plugins: [projectResources], - resources: [ - { pattern: 'src/i18n/locales/{locale}/{namespace}.json' }, - { pattern: 'plugins/ai/locales/{locale}.json', namespace: 'plugin.ai' }, - ], - namespace: { separator: ':', default: 'common' }, - usage: { - include: ['src/**/*.{js,jsx,ts,tsx,vue,mjs}', 'plugins/ai/**/*.{js,vue}'], - exclude: ['src/vendor/**', 'src/uni_modules/**', 'src/i18n/locales/**'], - regex: [ - { extensions: ['js', 'vue'], patterns: [String.raw`\btitleKey\s*:\s*['"]([^'"]+)['"]`] }, - ], - calls: [{ callee: '$t' }, { callee: 'useI18n', factory: true, returns: ['t'] }], - }, - checks: { - 'missing-translation': 'error', - 'empty-translation': 'error', - 'unused-key': 'warning', - 'hard-string': 'warning', - }, } diff --git a/ruoyi-fastapi-frontend/vue3/mobile/package.json b/ruoyi-fastapi-frontend/vue3/mobile/package.json index ee4cb7dd1..1f972fabb 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/package.json +++ b/ruoyi-fastapi-frontend/vue3/mobile/package.json @@ -94,7 +94,7 @@ "@iconify-json/svg-spinners": "1.2.4", "@types/node": "22.20.5", "@vue/runtime-core": "3.4.21", - "@x18n/cli": "0.1.3", + "@x18n/cli": "0.1.14", "autoprefixer": "10.6.1", "postcss": "8.5.30", "prettier": "3.9.10", diff --git a/ruoyi-fastapi-frontend/vue3/mobile/pnpm-lock.yaml b/ruoyi-fastapi-frontend/vue3/mobile/pnpm-lock.yaml index 7d1fc2981..1338ef46c 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/pnpm-lock.yaml +++ b/ruoyi-fastapi-frontend/vue3/mobile/pnpm-lock.yaml @@ -130,8 +130,8 @@ importers: specifier: 3.4.21 version: 3.4.21 '@x18n/cli': - specifier: 0.1.3 - version: 0.1.3(@devframes/agentic@1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6))(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3) + specifier: 0.1.14 + version: 0.1.14(@devframes/agentic@1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6))(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3) autoprefixer: specifier: 10.6.1 version: 10.6.1(postcss@8.5.30) @@ -3178,23 +3178,23 @@ packages: resolution: {integrity: sha512-2BBCMQvSNGSKvxm+W4dDWAtrG5xeTCkBZ4LqLVO8tqm62Vo994YUn9w2/A7G+HeBALG5pARwLb5cHjQPUUEigw==} engines: {node: ^20.19.0 || >=22.12.0} - '@x18n/builtins@0.1.3': - resolution: {integrity: sha512-/T2q1xQ513oZ19VjGLmXVZjxAdzDahDZ4Ssh0IbAVlcOpSSfgZkRgo5uh8JAdQSPxtWBTKHslOYxSptWJq9j7w==} + '@x18n/builtins@0.1.14': + resolution: {integrity: sha512-ezxyuOAK+YsAL4PbVPyZTOpwsZp1Qoo2vIr8MJQivcQyC80GAaxbpQvmRExikhnThH/OyienjaGRceUsDBYQ6g==} - '@x18n/cli@0.1.3': - resolution: {integrity: sha512-aOG1FJ1tJsnnjU3O13CktETY1GLW6FRmsw9KC5Mv35vEhah54O2+JAs0HBrqcmwADZAe7xwm6ZNY4DcaaV+BAQ==} + '@x18n/cli@0.1.14': + resolution: {integrity: sha512-b38DwR0ZUWujNNIsVE/tRQ4tud5wACIyui4dN578T85r8iH5VvfxNjBj7m8LYOwxNwVGOOheenskVItRvVQEQw==} engines: {node: '>=22'} hasBin: true - '@x18n/core@0.1.3': - resolution: {integrity: sha512-u4lYzCPwuEctDenT6ZlvElj3LJvR23PJ+XCgWfqhNfgDSrPmippljekba9Hfcl2jBhaWx0SiE63A/wWVVoY4wQ==} + '@x18n/core@0.1.14': + resolution: {integrity: sha512-gQWKzyX2B9Ppl3AG6Fcls+bshqUJMhfbgtzbFeKlDKNE6IS/w7VSHkm/NLEnLEfxTenwFFQAAPL5NO7i/Ke0Fw==} - '@x18n/node@0.1.3': - resolution: {integrity: sha512-ALZVZ8jMblM552yC/ERZXLcmXxNjha1l4OqYUhkcZXibRhKwNqw5k2PvgdN1hcHVoC9DnS02zhyc7Cqbtm/O3w==} + '@x18n/node@0.1.14': + resolution: {integrity: sha512-Q5W9mjap2fL3CeDmbPrgH11KuKLju3LplAtHvmH6iPttNKgy1JkwOyuKjAr2dpgErRYJOEHhpY4ySZ3j0JNyag==} engines: {node: '>=22'} - '@x18n/ui@0.1.3': - resolution: {integrity: sha512-X7c1MZd9Q5p0hflDYTkvEpZsD9twjvzBfauEDEF8kiz2qcig2uM8jEiieMboEA/yd5ikNc4uS9b2Q7MGcFyaGg==} + '@x18n/ui@0.1.14': + resolution: {integrity: sha512-5JH91Lli5V66oYk26ebaaEUN6vdhAibWSAX30wxFZLdy952jvKkwzOwQMJlO9b7ftHU/lZneYNH/8+0fH2ZCaQ==} engines: {node: '>=22'} abab@2.0.6: @@ -10194,10 +10194,10 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@x18n/builtins@0.1.3(typescript@5.9.3)': + '@x18n/builtins@0.1.14(typescript@5.9.3)': dependencies: '@vue/compiler-sfc': 3.5.44 - '@x18n/core': 0.1.3(typescript@5.9.3) + '@x18n/core': 0.1.14(typescript@5.9.3) json5: 2.2.3 jsonc-parser: 3.3.1 oxc-parser: 0.155.0 @@ -10207,12 +10207,12 @@ snapshots: - '@typescript-eslint/types' - typescript - '@x18n/cli@0.1.3(@devframes/agentic@1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6))(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3)': + '@x18n/cli@0.1.14(@devframes/agentic@1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6))(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3)': dependencies: - '@x18n/builtins': 0.1.3(typescript@5.9.3) - '@x18n/core': 0.1.3(typescript@5.9.3) - '@x18n/node': 0.1.3(typescript@5.9.3) - '@x18n/ui': 0.1.3(cac@7.1.0)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3) + '@x18n/builtins': 0.1.14(typescript@5.9.3) + '@x18n/core': 0.1.14(typescript@5.9.3) + '@x18n/node': 0.1.14(typescript@5.9.3) + '@x18n/ui': 0.1.14(cac@7.1.0)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3) cac: 7.1.0 devframe: 1.2.6(@devframes/agentic@1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6))(cac@7.1.0)(srvx@1.0.8) nostics: 1.3.0 @@ -10225,17 +10225,17 @@ snapshots: - srvx - typescript - '@x18n/core@0.1.3(typescript@5.9.3)': + '@x18n/core@0.1.14(typescript@5.9.3)': dependencies: nostics: 1.3.0 valibot: 1.5.0(typescript@5.9.3) transitivePeerDependencies: - typescript - '@x18n/node@0.1.3(typescript@5.9.3)': + '@x18n/node@0.1.14(typescript@5.9.3)': dependencies: - '@x18n/builtins': 0.1.3(typescript@5.9.3) - '@x18n/core': 0.1.3(typescript@5.9.3) + '@x18n/builtins': 0.1.14(typescript@5.9.3) + '@x18n/core': 0.1.14(typescript@5.9.3) chokidar: 6.0.0 ignore: 7.0.14 jiti: 2.7.0 @@ -10246,12 +10246,12 @@ snapshots: - '@typescript-eslint/types' - typescript - '@x18n/ui@0.1.3(cac@7.1.0)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3)': + '@x18n/ui@0.1.14(cac@7.1.0)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(typescript@5.9.3)': dependencies: '@devframes/agentic': 1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6) '@valibot/to-json-schema': 1.8.0(valibot@1.5.0(typescript@5.9.3)) - '@x18n/builtins': 0.1.3(typescript@5.9.3) - '@x18n/core': 0.1.3(typescript@5.9.3) + '@x18n/builtins': 0.1.14(typescript@5.9.3) + '@x18n/core': 0.1.14(typescript@5.9.3) devframe: 1.2.6(@devframes/agentic@1.2.5(crossws@0.4.17(srvx@1.0.8))(devframe@1.2.6))(cac@7.1.0)(srvx@1.0.8) valibot: 1.5.0(typescript@5.9.3) transitivePeerDependencies: diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/App.vue b/ruoyi-fastapi-frontend/vue3/mobile/src/App.vue index e88d24d09..2e854bc13 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/App.vue +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/App.vue @@ -5,12 +5,13 @@ import { useConfigStore } from '@/store' import { getCurrentInstance } from 'vue' import { onLaunch, onShow } from '@dcloudio/uni-app' -import { refreshDeviceLocale } from '@/i18n' +import { i18n, refreshDeviceLocale } from '@/i18n' import { refreshDeviceTimezone } from '@/utils/time' const { proxy } = getCurrentInstance() onLaunch(() => { + i18n.initialize(Boolean(getToken())) initApp() }) diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/components/LanguageSelect/index.vue b/ruoyi-fastapi-frontend/vue3/mobile/src/components/LanguageSelect/index.vue index 645012673..ab1b46346 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/components/LanguageSelect/index.vue +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/components/LanguageSelect/index.vue @@ -15,7 +15,7 @@ import { saveLocale } from '@/i18n/preference' export default { name: 'LanguageSelect', - data: () => ({ busy: false, error: '', languages: i18n.registry.entries }), + data: () => ({ busy: false, languages: i18n.registry.entries }), computed: { currentLabel() { return ( @@ -43,7 +43,10 @@ export default { try { await saveLocale(value) } catch { - uni.showToast({ title: this.$t('common:languageFailed'), icon: 'none' }) + uni.showToast({ + title: this.$t('common:languageFailed'), + icon: 'none', + }) } finally { this.busy = false } diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/adapter.js b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/adapter.js index 28d622896..4f30b9b1f 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/adapter.js +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/adapter.js @@ -2,7 +2,10 @@ import { setMessageTranslator } from './message.mjs' import { reactive, toRef } from 'vue' import { i18n } from './index' -export const localeState = reactive({ locale: i18n.locale, preference: i18n.preference }) +export const localeState = reactive({ + locale: i18n.locale, + preference: i18n.preference, +}) i18n.engine.on('languageChanged', (locale) => { localeState.locale = locale }) diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/index.js b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/index.js index 39b9cada1..56dfdbc1b 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/index.js +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/index.js @@ -2,6 +2,7 @@ import '@/utils/time' // 原生端须先加载 Intl 兼容实现,再初始化 import '@formatjs/intl-pluralrules/locale-data/zh.js' import '@formatjs/intl-numberformat/locale-data/zh.js' import '@formatjs/intl-datetimeformat/locale-data/zh.js' +import appManifest from '../../package.json' import { createLocaleRuntime } from './runtime.mjs' import { meta, resources } from './registry' import dayjs from 'dayjs' @@ -10,6 +11,7 @@ import 'dayjs/locale/en' import config from '@/config' export const i18n = createLocaleRuntime({ + appVersion: appManifest.version, meta, resources, storage: { diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locale-meta.json b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locale-meta.json index c27f81908..23564cac0 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locale-meta.json +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locale-meta.json @@ -20,5 +20,8 @@ "fallback": ["zh-CN"], "dayjs": "en" } - ] + ], + "languageFallbacks": { + "en": "en-US" + } } diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/common.json b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/common.json index 54cf2991d..b591378d5 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/common.json +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/en-US/common.json @@ -1,4 +1,5 @@ { + "translationUnavailable": "Text unavailable", "language": "Language", "followDevice": "Follow device", "save": "Save", diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/common.json b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/common.json index 177446f56..3dec65109 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/common.json +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/locales/zh-CN/common.json @@ -1,4 +1,5 @@ { + "translationUnavailable": "暂无可用文本", "language": "语言", "followDevice": "跟随设备", "save": "保存", diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/names.mjs b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/names.mjs index 3b2526b51..eda0db901 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/names.mjs +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/names.mjs @@ -6,10 +6,10 @@ export function updateTranslationPatch(patch, original, locale, value) { return next } -/** 兼容旧缓存并保留业务键值,译文只影响显示标签。 */ +/** 保留字典业务键值,译文只影响显示标签。 */ export function localizeDictionary(items, resolveText) { return items.map((item) => ({ ...item, - label: resolveText(item.originalLabel ?? item.label, item.labelI18n), + label: resolveText(item.originalLabel, item.labelI18n), })) } diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/preference.js b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/preference.js index b303c6cdf..058742cf9 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/preference.js +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/preference.js @@ -10,8 +10,11 @@ import { i18n } from './index' */ export function saveLocale(preference) { return i18n.setPreference(preference, { - save: (locale) => - request({ url: '/system/user/profile/locale', method: 'put', data: { locale } }), - readBack: async () => (await getInfo()).user?.locale, + save: async (locale) => + (await request({ url: '/system/user/profile/locale', method: 'put', data: { locale } })).data, + readBack: async () => { + const user = (await getInfo()).user + return { locale: user?.locale, revision: user?.localeRevision } + }, }) } diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/runtime.mjs b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/runtime.mjs index 83a07012c..96159e6e7 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/runtime.mjs +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/i18n/runtime.mjs @@ -1,5 +1,22 @@ import { createInstance } from 'i18next' +// 菜单和字典原字段由后端数据协议固定为简体中文。 +export const DATA_SOURCE_LOCALE = 'zh-CN' + +function normalizeRevision(value) { + return typeof value === 'string' && + /^(0|[1-9]\d{0,18})$/.test(value) && + (value.length < 19 || value <= '9223372036854775807') + ? value + : null +} + +function compareRevision(left, right) { + if (left === right) return 0 + if (right === null) return 1 + return left.length !== right.length ? left.length - right.length : left > right ? 1 : -1 +} + /** * 规范化语言标识,兼容使用下划线的设备语言。 * @@ -47,9 +64,14 @@ export function createLocaleRegistry(meta, resources) { aliases.set(code, entry.code) } } + const languageFallbacks = meta.languageFallbacks || {} + for (const [language, target] of Object.entries(languageFallbacks)) { + if (!/^[a-z]{2,8}$/.test(language) || !byCode.has(target)) + throw new Error(`Invalid language fallback: ${language}`) + } function match(value) { const code = normalizeLocale(value) - return byCode.has(code) ? code : aliases.get(code) + return byCode.has(code) ? code : aliases.get(code) || languageFallbacks[code?.split('-')[0]] } return { entries, @@ -61,7 +83,14 @@ export function createLocaleRegistry(meta, resources) { } return meta.defaultLocale }, - chain(code) { + /** + * 按目标语言、配置的回退语言和指定的原文语言生成查找顺序。 + * + * @param {string} code 目标语言标识 + * @param {string} [sourceLocale] 原文语言,默认取当前应用的词库基准 + * @returns {string[]} 去重后的语言标识列表 + */ + chain(code, sourceLocale = meta.sourceLocale) { const result = [] const append = (value) => { if (result.includes(value)) return @@ -69,7 +98,7 @@ export function createLocaleRegistry(meta, resources) { for (const fallback of byCode.get(value)?.fallback || []) append(fallback) } append(code) - append(meta.sourceLocale) + append(sourceLocale) return result }, get: (code) => byCode.get(code), @@ -80,6 +109,7 @@ export function createLocaleRegistry(meta, resources) { * 创建当前应用独立的国际化实例,隔离账号和访客的语言偏好。 * * @param {Object} options 当前应用的语言、存储和设备适配配置 + * @param {string} [options.appVersion] 记录缺词诊断时使用的应用版本 * @returns {Object} 翻译、语言切换与偏好管理接口 */ export function createLocaleRuntime({ @@ -87,17 +117,39 @@ export function createLocaleRuntime({ resources, storage, scope, + appVersion, deviceLocales = () => [], onChange = () => {}, }) { const registry = createLocaleRegistry(meta, resources) const engine = createInstance() let account = null + let revision = null let generation = 0 let preference = meta.defaultLocale let queue = Promise.resolve() - const storageKey = () => `${scope}:locale:v1:${account === null ? 'guest' : `user:${account}`}` + const accountKey = `${scope}:locale:account` + const guestKey = `${scope}:locale:v1:guest` + const snapshotKey = () => `${scope}:locale:v2:user:${account}` const validPreference = (value) => (value === 'auto' ? value : normalizeLocale(value)) + function parseSnapshot(value) { + const locale = validPreference(value?.locale) + const version = normalizeRevision(value?.revision) + return locale && version !== null ? { locale, revision: version } : null + } + function readSnapshot(raw) { + try { + return parseSnapshot(JSON.parse(raw)) + } catch { + return null + } + } + function requireSnapshot(value) { + const snapshot = parseSnapshot(value) + if (!snapshot) throw new Error('Invalid locale snapshot') + return snapshot + } + const reportedMissingKeys = new Set() engine.init({ resources, lng: meta.defaultLocale, @@ -110,18 +162,46 @@ export function createLocaleRuntime({ interpolation: { escapeValue: false }, returnNull: false, returnEmptyString: false, + appendNamespaceToMissingKey: true, + parseMissingKeyHandler(qualifiedKey, defaultValue, options) { + const locale = options.lng || engine.language + const warningKey = `${locale}:${qualifiedKey}` + if (!reportedMissingKeys.has(warningKey)) { + reportedMissingKeys.add(warningKey) + const [namespace, key] = qualifiedKey.split(':') + // 插值参数可能包含业务数据,诊断只记录词条位置和版本。 + console.warn('Missing translation', { namespace, key, locale, version: appVersion }) + } + return ( + defaultValue ?? + engine.t('common:translationUnavailable', { lng: locale, defaultValue: '—' }) + ) + }, }) - function commit(value, persist = true) { + function applyPreference(value) { preference = value const code = registry.resolve(value, deviceLocales()) - // 各端均同步打包当前语言及回退词库,切换时可直接取词。 engine.changeLanguage(code) - if (persist) storage.set(storageKey(), value) onChange(code, registry.get(code)) engine.emit('preferenceChanged', value) } function restore() { - commit(validPreference(storage.get(storageKey())) || meta.defaultLocale, false) + const snapshot = account === null ? null : readSnapshot(storage.get(snapshotKey())) + revision = snapshot?.revision ?? null + const value = account === null ? validPreference(storage.get(guestKey)) : snapshot?.locale + applyPreference(value || meta.defaultLocale) + } + function acceptSnapshot(snapshot, persist = true) { + // 先读取其他标签页可能已提交的更新,再比较本次回包的 revision。 + const stored = readSnapshot(storage.get(snapshotKey())) + if (stored && compareRevision(stored.revision, revision) > 0) { + revision = stored.revision + applyPreference(stored.locale) + } + if (compareRevision(snapshot.revision, revision) <= 0) return + revision = snapshot.revision + if (persist) storage.set(snapshotKey(), JSON.stringify(snapshot)) + applyPreference(snapshot.locale) } const runtime = { engine, @@ -136,11 +216,15 @@ export function createLocaleRuntime({ get accountId() { return account }, + get preferenceRevision() { + return revision + }, get headers() { - return { 'Accept-Language': engine.language, 'X-I18n-Version': '1' } + return { 'Accept-Language': engine.language } }, initialize(hasSession = false) { - const previous = hasSession ? storage.get(`${scope}:locale:account`) : null + generation++ + const previous = hasSession ? storage.get(accountKey) : null account = previous === null || previous === undefined || previous === '' ? null : String(previous) restore() @@ -149,14 +233,22 @@ export function createLocaleRuntime({ * 切换账号并使旧账号尚未完成的语言切换失效。 * * @param {string|number|null} id 当前账号标识,null 表示访客 - * @param {string} value 服务端返回的语言偏好 + * @param {string} [value] 账号快照中的语言偏好 + * @param {string} [serverRevision] 账号快照的十进制版本号 */ - setAccount(id, value = meta.defaultLocale) { - generation++ - account = id === null || id === undefined ? null : String(id) - storage.set(`${scope}:locale:account`, account || '') - if (account === null) restore() - else commit(validPreference(value) || meta.defaultLocale) + setAccount(id, value, serverRevision) { + if (id === undefined || id === '') throw new Error('Missing locale account') + const next = id === null ? null : String(id) + const snapshot = + next === null ? null : requireSnapshot({ locale: value, revision: serverRevision }) + if (next !== account) { + generation++ + revision = null + } + account = next + storage.set(accountKey, account || '') + if (snapshot) acceptSnapshot(snapshot) + else restore() }, /** * 串行保存语言偏好,确认保存成功后再更新界面。 @@ -169,37 +261,66 @@ export function createLocaleRuntime({ const canonical = validPreference(value) if (!canonical) return Promise.reject(new Error('Invalid locale preference')) const epoch = generation - const expectedAccount = account const run = async () => { if (generation !== epoch) throw new Error('Locale account changed') // 保存账号偏好前,先确认有效语言的资源已经加载。 const code = registry.resolve(canonical, deviceLocales()) if (!engine.hasResourceBundle(code, 'common')) throw new Error('Missing locale resources') - if (expectedAccount !== null) { - if (!save) throw new Error('A preference save callback is required') - try { - await save(canonical) - } catch (error) { - if (!readBack || (await readBack()) !== canonical) throw error - } + if (account === null) { + storage.set(guestKey, canonical) + applyPreference(canonical) + return + } + if (!save) throw new Error('A preference save callback is required') + let saved + let saveError + try { + saved = await save(canonical) + } catch (error) { + if (generation !== epoch || !readBack) throw error + saveError = error + saved = await readBack() } if (generation !== epoch) throw new Error('Locale account changed') - commit(canonical) + const snapshot = requireSnapshot(saved) + acceptSnapshot(snapshot) + if (saveError && snapshot.locale !== canonical) throw saveError } const result = queue.then(run) queue = result.catch(() => {}) return result }, refreshDeviceLocale() { - if (preference === 'auto') commit(preference, false) + if (preference === 'auto') applyPreference(preference) }, acceptStorageEvent(key, value) { - const canonical = validPreference(value) - if (key === storageKey() && canonical) commit(canonical, false) + if (account === null) { + if (key === guestKey) { + const locale = validPreference(value) + if (locale) applyPreference(locale) + } + return + } + if (key !== snapshotKey()) return + const snapshot = readSnapshot(value) + if (!snapshot) return + acceptSnapshot(snapshot, false) + // 跨标签的并发写入可能乱序,离线快照始终保留已知的最新版本。 + const stored = readSnapshot(storage.get(snapshotKey())) + if (!stored || compareRevision(revision, stored.revision) > 0) { + storage.set(snapshotKey(), JSON.stringify({ locale: preference, revision })) + } }, + /** + * 根据当前语言选择菜单或字典译名,回退到数据库原字段。 + * + * @param {string} original 数据库原名 + * @param {Object} [translations] 按语言标识保存的译名 + * @returns {string} 当前界面使用的名称 + */ resolveText(original, translations = {}) { - for (const code of registry.chain(engine.language)) { - if (code === meta.sourceLocale) return original + for (const code of registry.chain(engine.language, DATA_SOURCE_LOCALE)) { + if (code === DATA_SOURCE_LOCALE) return original if (typeof translations?.[code] === 'string' && translations[code]) return translations[code] } diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/main.ts b/ruoyi-fastapi-frontend/vue3/mobile/src/main.ts index fba6ae0a1..f23550266 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/main.ts +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/main.ts @@ -2,7 +2,6 @@ import { refreshNavigation } from '@/i18n/navigation' import LocalePlugin from '@/i18n/adapter' import LanguageSelect from '@/components/LanguageSelect/index.vue' import { i18n } from '@/i18n' -import { getToken } from '@/utils/auth' // @ts-nocheck import { createSSRApp } from 'vue' import App from './App.vue' @@ -18,7 +17,6 @@ export function createApp() { app.mixin({ onShow: refreshNavigation }) i18n.engine.on('languageChanged', refreshNavigation) app.component('LanguageSelect', LanguageSelect) - i18n.initialize(Boolean(getToken())) app.config.globalProperties.useDict = useDict install(app) return { diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/pages/login.vue b/ruoyi-fastapi-frontend/vue3/mobile/src/pages/login.vue index f5d1e48dd..15ca934f2 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/pages/login.vue +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/pages/login.vue @@ -207,6 +207,7 @@ function loginSuccess(result) { .then((res) => { proxy.$tab.reLaunch('/pages/index') }) + .catch(() => {}) } onLoad(() => { diff --git a/ruoyi-fastapi-frontend/vue3/mobile/src/pages/mine/info/index.vue b/ruoyi-fastapi-frontend/vue3/mobile/src/pages/mine/info/index.vue index d47b23324..ecd1093f3 100644 --- a/ruoyi-fastapi-frontend/vue3/mobile/src/pages/mine/info/index.vue +++ b/ruoyi-fastapi-frontend/vue3/mobile/src/pages/mine/info/index.vue @@ -98,7 +98,9 @@ $t('mobile:profile.createdAt') }} - {{ formatBusinessTime(user.createTime) || '-' }} + {{ + formatDisplayTime(user.createTime, $locale.locale) || '-' + }} @@ -107,7 +109,7 @@ diff --git a/ruoyi-fastapi-frontend/vue3/web/package.json b/ruoyi-fastapi-frontend/vue3/web/package.json index b98670f36..45df0aed5 100644 --- a/ruoyi-fastapi-frontend/vue3/web/package.json +++ b/ruoyi-fastapi-frontend/vue3/web/package.json @@ -67,8 +67,8 @@ "devDependencies": { "@vitejs/plugin-vue": "6.0.10", "@vue/compiler-sfc": "3.5.44", - "@x18n/builtins": "0.1.3", - "@x18n/cli": "0.1.3", + "@x18n/builtins": "0.1.14", + "@x18n/cli": "0.1.14", "esbuild": "0.28.2", "less": "4.9.1", "prettier": "3.9.10", diff --git a/ruoyi-fastapi-frontend/vue3/web/plugins/ai/README.md b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/README.md index bd20ebcf4..06106c583 100644 --- a/ruoyi-fastapi-frontend/vue3/web/plugins/ai/README.md +++ b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/README.md @@ -84,3 +84,14 @@ pnpm run build:prod ``` 若只修改文档,不需要执行前端构建。 + +## 国际化 + +本插件通过 `i18n.js` 导出的 `t` / `useI18n` 读取独立 i18next 实例。 +`locale-meta.json` 声明本插件的语言集合、默认语言和回退链,词库位于 `locales/`。 +宿主切换语言时插件重新匹配;宿主新增语言不要求本插件同步新增,网络请求仍使用宿主语言。 + +应用的 `pnpm run i18n:check` 会发现本插件的 `x18n.config.mjs`,按插件声明的语言检查词库。 +也可以在应用目录运行 `pnpm exec x18n --root plugins/ai check` 单独检查插件。 +新增插件语言时同步更新本插件元数据、词库和 `i18n.js` 中的导入。 +会话内卸载时调用 `removePluginLocales()`,重新启用时调用 `registerPluginLocales()`;两者不修改宿主或其他插件资源。 diff --git a/ruoyi-fastapi-frontend/vue3/web/plugins/ai/i18n.js b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/i18n.js new file mode 100644 index 000000000..a1070c29e --- /dev/null +++ b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/i18n.js @@ -0,0 +1,9 @@ +import { createPluginI18n } from '@/i18n/adapter' +import meta from './locale-meta.json' +import zh from './locales/zh-CN.json' +import en from './locales/en-US.json' + +const namespace = 'plugin.ai' +const resources = { 'zh-CN': { [namespace]: zh }, 'en-US': { [namespace]: en } } +export const pluginI18n = createPluginI18n(meta, resources, namespace) +export const { t, useI18n, registerPluginLocales, removePluginLocales } = pluginI18n diff --git a/ruoyi-fastapi-frontend/vue3/web/plugins/ai/locale-meta.json b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/locale-meta.json new file mode 100644 index 000000000..444e85b89 --- /dev/null +++ b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/locale-meta.json @@ -0,0 +1,25 @@ +{ + "sourceLocale": "zh-CN", + "defaultLocale": "zh-CN", + "locales": [ + { + "code": "zh-CN", + "nativeName": "简体中文", + "enabled": true, + "direction": "ltr", + "aliases": ["zh", "zh-Hans"], + "fallback": [] + }, + { + "code": "en-US", + "nativeName": "English", + "enabled": true, + "direction": "ltr", + "aliases": ["en"], + "fallback": ["zh-CN"] + } + ], + "languageFallbacks": { + "en": "en-US" + } +} diff --git a/ruoyi-fastapi-frontend/vue3/web/plugins/ai/views/chat/components/AiMessage.vue b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/views/chat/components/AiMessage.vue index 89adfb27d..12ea9d3b3 100644 --- a/ruoyi-fastapi-frontend/vue3/web/plugins/ai/views/chat/components/AiMessage.vue +++ b/ruoyi-fastapi-frontend/vue3/web/plugins/ai/views/chat/components/AiMessage.vue @@ -9,11 +9,11 @@ @click="toggleReasoning" > - {{ $t('plugin.ai:reasoningProcess') }} + {{ t('plugin.ai:reasoningProcess') }} {{ $t('plugin.ai:thinking') }}{{ t('plugin.ai:thinking') }}
+ + diff --git a/ruoyi-fastapi-frontend/vue3/web/src/components/FileUpload/index.vue b/ruoyi-fastapi-frontend/vue3/web/src/components/FileUpload/index.vue index fecceda26..b4df0c423 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/components/FileUpload/index.vue +++ b/ruoyi-fastapi-frontend/vue3/web/src/components/FileUpload/index.vue @@ -65,7 +65,7 @@ diff --git a/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue b/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue index 6fc8ad416..5a04859b5 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue +++ b/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue @@ -23,6 +23,7 @@ import { computed } from 'vue' import { updateTranslationPatch } from '@/i18n/names.mjs' import { meta } from '@/i18n/registry' +import { DATA_SOURCE_LOCALE } from '@/i18n/runtime.mjs' const props = defineProps({ modelValue: { type: Object, default: () => ({}) }, @@ -30,9 +31,9 @@ const props = defineProps({ }) const emit = defineEmits(['update:modelValue']) const sourceLanguage = - meta.locales.find((entry) => entry.code === meta.sourceLocale)?.nativeName || meta.sourceLocale + meta.locales.find((entry) => entry.code === DATA_SOURCE_LOCALE)?.nativeName || DATA_SOURCE_LOCALE const translationLocales = computed(() => - meta.locales.filter((entry) => entry.enabled && entry.code !== meta.sourceLocale) + meta.locales.filter((entry) => entry.enabled && entry.code !== DATA_SOURCE_LOCALE) ) function valueFor(code) { diff --git a/ruoyi-fastapi-frontend/vue3/web/src/components/PluginFrame/index.vue b/ruoyi-fastapi-frontend/vue3/web/src/components/PluginFrame/index.vue index 3fb12b753..d07d0758d 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/components/PluginFrame/index.vue +++ b/ruoyi-fastapi-frontend/vue3/web/src/components/PluginFrame/index.vue @@ -46,7 +46,7 @@ diff --git a/ruoyi-fastapi-frontend/vue2/web/src/components/LocaleTextFields/index.vue b/ruoyi-fastapi-frontend/vue2/web/src/components/LocaleTextFields/index.vue index e3904b0b3..52f509ae2 100644 --- a/ruoyi-fastapi-frontend/vue2/web/src/components/LocaleTextFields/index.vue +++ b/ruoyi-fastapi-frontend/vue2/web/src/components/LocaleTextFields/index.vue @@ -1,22 +1,40 @@ @@ -24,21 +42,21 @@ import { meta } from '@/i18n/registry' import { DATA_SOURCE_LOCALE } from '@/i18n/runtime.mjs' +const locales = meta.locales.filter((entry) => entry.enabled && entry.code !== DATA_SOURCE_LOCALE) + export default { name: 'LocaleTextFields', props: { value: { type: Object, default: () => ({}) }, patch: { type: Object, default: () => ({}) }, + maxlength: { type: Number, required: true }, + }, + data() { + return { locales, expanded: locales.some((entry) => this.value?.[entry.code]) } }, computed: { - sourceLanguage() { - return ( - meta.locales.find((locale) => locale.code === DATA_SOURCE_LOCALE)?.nativeName || - DATA_SOURCE_LOCALE - ) - }, - locales() { - return meta.locales.filter((locale) => locale.enabled && locale.code !== DATA_SOURCE_LOCALE) + hasTranslation() { + return this.locales.some((entry) => this.fieldValue(entry.code)) }, }, methods: { @@ -48,9 +66,31 @@ export default { : this.value?.[locale] || '' }, update(locale, value) { - // 只发送编辑过的语言;清空显式删除翻译,未编辑的条目交由服务端保留。 - this.$emit('input', { ...this.patch, [locale]: value.trim() ? value : null }) + const next = { ...this.patch } + const translation = value.trim() ? value : '' + if (translation === (this.value?.[locale] || '')) delete next[locale] + else next[locale] = translation || null + this.$emit('input', next) }, }, } + + diff --git a/ruoyi-fastapi-frontend/vue2/web/src/components/SizeSelect/index.vue b/ruoyi-fastapi-frontend/vue2/web/src/components/SizeSelect/index.vue index b3c406f1f..1eda30009 100644 --- a/ruoyi-fastapi-frontend/vue2/web/src/components/SizeSelect/index.vue +++ b/ruoyi-fastapi-frontend/vue2/web/src/components/SizeSelect/index.vue @@ -24,17 +24,15 @@ + + diff --git a/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue b/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue index 5a04859b5..e8f1f3866 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue +++ b/ruoyi-fastapi-frontend/vue3/web/src/components/LocaleNameInput/index.vue @@ -1,26 +1,46 @@ + + diff --git a/ruoyi-fastapi-frontend/vue3/web/src/i18n/index.js b/ruoyi-fastapi-frontend/vue3/web/src/i18n/index.js index 2e75aa0bc..4f8676588 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/i18n/index.js +++ b/ruoyi-fastapi-frontend/vue3/web/src/i18n/index.js @@ -1,5 +1,5 @@ import appManifest from '../../package.json' -import { createLocaleRuntime } from './runtime.mjs' +import { createLocaleRuntime, DATA_SOURCE_LOCALE } from './runtime.mjs' import { meta, resources } from './registry' import dayjs from 'dayjs' import 'dayjs/locale/zh-cn.js' @@ -34,6 +34,8 @@ export const i18n = createLocaleRuntime({ } }, }) +export const sourceLanguage = + i18n.registry.get(DATA_SOURCE_LOCALE)?.nativeName || DATA_SOURCE_LOCALE export const t = i18n.t export const resolveRouteTitle = (route) => i18n.resolveRouteTitle(route) export const refreshDeviceLocale = () => i18n.refreshDeviceLocale() diff --git a/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/system.json b/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/system.json index 4576129ca..1b5f08437 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/system.json +++ b/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/en-US/system.json @@ -1,8 +1,11 @@ { "translations": { "label": "{{language}} translation", - "optional": "Optional; falls back to the original name", - "sourceHint": "The original name is maintained in {{language}}. Other translations are optional." + "optional": "Clear a translation to use the original text.", + "add": "Add translation", + "hide": "Hide translations", + "show": "Show translations", + "search": "Search original ({{language}})" }, "parameterNameIsRequired": "Parameter name is required", "parameterKeyIsRequired": "Parameter key is required", diff --git a/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/system.json b/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/system.json index 0dc6a4f40..68146bd9d 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/system.json +++ b/ruoyi-fastapi-frontend/vue3/web/src/i18n/locales/zh-CN/system.json @@ -1,8 +1,11 @@ { "translations": { "label": "{{language}}译文", - "optional": "可选,留空时使用原名称", - "sourceHint": "原始名称使用{{language}}维护,其他语言译文为可选。" + "optional": "清空译名后将显示原文。", + "add": "添加译名", + "hide": "收起译名", + "show": "查看译名", + "search": "按{{language}}原文搜索" }, "parameterNameIsRequired": "参数名称不能为空", "parameterKeyIsRequired": "参数键名不能为空", diff --git a/ruoyi-fastapi-frontend/vue3/web/src/layout/components/Navbar.vue b/ruoyi-fastapi-frontend/vue3/web/src/layout/components/Navbar.vue index ab493480c..06d9a453a 100644 --- a/ruoyi-fastapi-frontend/vue3/web/src/layout/components/Navbar.vue +++ b/ruoyi-fastapi-frontend/vue3/web/src/layout/components/Navbar.vue @@ -31,7 +31,7 @@
- +