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 && (