From 31544b47cdc50c37ab1300ef6cc53d4e7de2b720 Mon Sep 17 00:00:00 2001 From: qkiroc <30946345+qkiroc@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:25:08 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20editor=E5=BC=80=E5=8F=91=E6=80=81?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=20(#7903)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: editor开发态国际化 * chore: editor开发态国际化 * 插件不是用ts写的,没有声明 --------- Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com> --- i18nConfig.ts | 40 ++++++++++++++++++++++++ packages/amis-editor/examples/Editor.tsx | 20 +++++++----- vite.config.ts | 35 +++++++++++++++++++-- 3 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 i18nConfig.ts diff --git a/i18nConfig.ts b/i18nConfig.ts new file mode 100644 index 000000000..b993536e3 --- /dev/null +++ b/i18nConfig.ts @@ -0,0 +1,40 @@ +export default { + entry: { + dir: './packages/amis-editor-core/src' + }, + file: { + test: /.*(ts|tsx|js|jsx)$/ + }, + ignore: { + list: [ + 'packages/**/locale/*', + 'packages/amis/*', + 'packages/amis-ui/*', + 'packages/amis-core/*', + 'packages/amis-formula/*', + 'packages/**/examples/*' + ] + }, + importInfo: { + source: 'i18n-runtime', + imported: 'i18n', + local: '_i18n' + }, + i18nModule: 'i18n-runtime', + languages: [ + { + name: 'en-US', + path: [ + './packages/amis-editor-core/src/locale', + './packages/amis-editor/src/locale' + ] + }, + { + name: 'zh-CN', + path: [ + './packages/amis-editor-core/src/locale', + './packages/amis-editor/src/locale' + ] + } + ] +}; diff --git a/packages/amis-editor/examples/Editor.tsx b/packages/amis-editor/examples/Editor.tsx index 1b1adffca..381423cf8 100644 --- a/packages/amis-editor/examples/Editor.tsx +++ b/packages/amis-editor/examples/Editor.tsx @@ -700,13 +700,19 @@ export default class AMisSchemaEditor extends React.Component {
- {/* this.changeLocale(e.value)} + /> + ) : null + } {i18nEnabled && (