feat: translate name of operator #918 (#1437)

### What problem does this PR solve?

feat: translate name of operator #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-07-09 13:22:37 +08:00
committed by GitHub
parent 56e3fa2d6a
commit 198a8b6592
7 changed files with 27 additions and 30 deletions

View File

@@ -1,8 +1,6 @@
import { Handle, Position } from 'reactflow';
// import { v4 as uuid } from 'uuid';
import { useTranslate } from '@/hooks/commonHooks';
import lowerFirst from 'lodash/lowerFirst';
import styles from './index.less';
const DEFAULT_HANDLE_STYLE = {
@@ -20,7 +18,6 @@ interface IProps {
}
const CategorizeHandle = ({ top, right, text, idx }: IProps) => {
const { t } = useTranslate('flow');
return (
<Handle
type="source"
@@ -36,9 +33,7 @@ const CategorizeHandle = ({ top, right, text, idx }: IProps) => {
color: 'black',
}}
>
<span className={styles.categorizeAnchorPointText}>
{lowerFirst(t(text))}
</span>
<span className={styles.categorizeAnchorPointText}>{text}</span>
</Handle>
);
};

View File

@@ -88,7 +88,7 @@ const DynamicCategorize = ({ nodeId }: IProps) => {
))}
<Button type="dashed" onClick={handleAdd} block>
+ Add Item
+ {t('addItem')}
</Button>
</div>
);

View File

@@ -38,7 +38,7 @@ const MessageForm = ({ onValuesChange, form }: IOperatorForm) => {
{fields.map((field, index) => (
<Form.Item
{...(index === 0 ? formItemLayout : formItemLayoutWithOutLabel)}
label={index === 0 ? t('message') : ''}
label={index === 0 ? t('msg') : ''}
required={false}
key={field.key}
>