Skip to content

Commit 5a023f5

Browse files
committed
feat: translation
1 parent ebfe11f commit 5a023f5

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.prettierignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ package.json
88
.umi-test
99
packages/**/lib/**
1010
packages/**/esm/**
11-
packages/**/node_modules/**
11+
packages/**/node_modules/**
12+
packages/core/client/src/locale/*

packages/core/client/src/locale/zh_CN.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -476,5 +476,6 @@ export default {
476476
'Multiple records': '多条数据',
477477
'Please select collection first': '请先选择数据表',
478478
'Only update records matching conditions': '只更新满足条件的数据',
479-
'Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.': '未被赋值的字段将被设置为默认值,没有默认值的设置为空值。'
479+
'Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.': '未被赋值的字段将被设置为默认值,没有默认值的设置为空值。',
480+
'Dragging': '拖拽中',
480481
}

packages/core/client/src/schema-component/antd/action/Action.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React, { useState } from 'react';
66
import { useActionContext } from '../..';
77
import { Icon } from '../../../icon';
88
import { SortableItem } from '../../common';
9-
import { useDesigner } from '../../hooks';
9+
import { useCompile, useDesigner } from '../../hooks';
1010
import { useProps } from '../../hooks/useProps';
1111
import ActionContainer from './Action.Container';
1212
import { ActionDesigner } from './Action.Designer';
@@ -84,6 +84,7 @@ export const Action: ComposedAction = observer((props: any) => {
8484
const field = useField<any>();
8585
const { run } = useAction();
8686
const fieldSchema = useFieldSchema();
87+
const compile = useCompile();
8788
const designerProps = fieldSchema['x-designer-props'];
8889
const openMode = fieldSchema?.['x-component-props']?.['openMode'];
8990
const renderButton = () => (
@@ -111,7 +112,7 @@ export const Action: ComposedAction = observer((props: any) => {
111112
component={component || Button}
112113
className={classnames(className, actionDesignerCss)}
113114
>
114-
{field.title}
115+
{compile(fieldSchema.title)}
115116
<Designer {...designerProps} />
116117
</SortableItem>
117118
);

packages/core/client/src/schema-component/common/dnd-context/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const useDragEnd = (props?: any) => {
5757
};
5858

5959
export const DndContext = observer((props: Props) => {
60+
const { t } = useTranslation();
6061
return (
6162
<DndKitContext collisionDetection={rectIntersection} {...props} onDragEnd={useDragEnd(props)}>
6263
<DragOverlay
@@ -65,7 +66,7 @@ export const DndContext = observer((props: Props) => {
6566
easing: 'cubic-bezier(0.18, 0.67, 0.6, 1.22)',
6667
}}
6768
>
68-
<span style={{ whiteSpace: 'nowrap' }}>拖拽中</span>
69+
<span style={{ whiteSpace: 'nowrap' }}>{t('Dragging')}</span>
6970
</DragOverlay>
7071
{props.children}
7172
</DndKitContext>

0 commit comments

Comments
 (0)