From 15504c2813a896cdc1b53cc85d7ec4d3a093c0e5 Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 12 Aug 2023 10:18:47 +0800 Subject: [PATCH] fix: improve translation --- packages/core/client/src/locale/en_US.ts | 3 +++ packages/core/client/src/locale/zh_CN.ts | 5 ++++- .../antd/action/Action.Designer.tsx | 18 +++++++++--------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/packages/core/client/src/locale/en_US.ts b/packages/core/client/src/locale/en_US.ts index bc430a7ba..424ae1167 100644 --- a/packages/core/client/src/locale/en_US.ts +++ b/packages/core/client/src/locale/en_US.ts @@ -182,6 +182,9 @@ export default { "Action type": "Action type", "Actions": "Actions", "Insert": "Insert", + "Insert if not exists": "Insert if not exists", + "Insert if not exists, or update": "Insert if not exists, or update", + "Determine whether a record exists by the following fields": "Determine whether a record exists by the following fields", "Update": "Update", "View": "View", "View record": "View record", diff --git a/packages/core/client/src/locale/zh_CN.ts b/packages/core/client/src/locale/zh_CN.ts index bae22a427..399dce014 100644 --- a/packages/core/client/src/locale/zh_CN.ts +++ b/packages/core/client/src/locale/zh_CN.ts @@ -731,6 +731,8 @@ export default { 'Constant': '常量', 'Select a variable': '选择变量', "Insert": "插入", + "Insert if not exists": "不存在时插入", + "Insert if not exists, or update": "不存在时插入,否则更新", 'System variables': '系统变量', 'Date variables': '日期变量', 'Double click to choose entire object': '双击选择整个对象', @@ -802,5 +804,6 @@ export default { "Tag color field":"标签颜色字段", "Sync successfully":"同步成功", "Sync from form fields":"同步表单字段", - "Select all":"全选" + "Select all":"全选", + "Determine whether a record exists by the following fields": "通过以下字段判断记录是否存在" } diff --git a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx index 8f9e9ccd7..d4b70d0c0 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.Designer.tsx @@ -1,20 +1,20 @@ import { ArrayTable } from '@formily/antd-v5'; +import { onFieldValueChange } from '@formily/core'; import { connect, ISchema, mapProps, useField, useFieldSchema, useForm, useFormEffects } from '@formily/react'; import { isValid, uid } from '@formily/shared'; import { Alert, Tree as AntdTree } from 'antd'; import { cloneDeep } from 'lodash'; -import React, { useEffect, useState, useMemo, useCallback } from 'react'; +import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { RemoteSelect, useCompile, useDesignable } from '../..'; import { useCollection, useCollectionManager } from '../../../collection-manager'; +import { useRecord } from '../../../record-provider'; import { OpenModeSchemaItems } from '../../../schema-items'; import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings'; import { useCollectionState } from '../../../schema-settings/DataTemplates/hooks/useCollectionState'; +import { useSyncFromForm } from '../../../schema-settings/DataTemplates/utils'; import { useLinkageAction } from './hooks'; import { requestSettingsSchema } from './utils'; -import { useRecord } from '../../../record-provider'; -import { useSyncFromForm } from '../../../schema-settings/DataTemplates/utils'; -import { onFieldValueChange } from '@formily/core'; const Tree = connect( AntdTree, @@ -143,17 +143,17 @@ function SaveMode() { saveMode: { 'x-decorator': 'FormItem', 'x-component': 'Radio.Group', - title: t('Save mode'), + // title: t('Save mode'), default: field.componentProps.saveMode || 'create', enum: [ - { value: 'create', label: '{{t("Create")}}' }, - { value: 'firstOrCreate', label: '{{t("First or create")}}' }, - { value: 'updateOrCreate', label: '{{t("Update or create")}}' }, + { value: 'create', label: '{{t("Insert")}}' }, + { value: 'firstOrCreate', label: '{{t("Insert if not exists")}}' }, + { value: 'updateOrCreate', label: '{{t("Insert if not exists, or update")}}' }, ], }, filterKeys: { type: 'array', - title: '{{ t("Find by the following fields") }}', + title: '{{ t("Determine whether a record exists by the following fields") }}', required: true, default: field.componentProps.filterKeys, 'x-decorator': 'FormItem',