Browse Source

demo: translate chinese to english (#43234)

* Updated language in layout-can-wrap.tsx

* Updated language in draggable.tsx

* Updated language in drag-debug.tsx

* Updated language in tree/demo/draggable.tsx

* Updated jest snapshots for form

---------

Co-authored-by: Zhou Fang <zhfaxb@syntronic.com>
pull/43289/head
Zhou Fang 1 year ago
committed by GitHub
parent
commit
78714e01c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
  2. 8
      components/form/__tests__/__snapshots__/demo.test.tsx.snap
  3. 4
      components/form/demo/layout-can-wrap.tsx
  4. 4
      components/tag/demo/draggable.tsx
  5. 6
      components/tree/demo/drag-debug.tsx
  6. 6
      components/tree/demo/draggable.tsx

8
components/form/__tests__/__snapshots__/demo-extend.test.ts.snap

@ -7591,9 +7591,9 @@ exports[`renders components/form/demo/layout-can-wrap.tsx extend context correct
<label
class="ant-form-item-required ant-form-item-no-colon"
for="wrap_username"
title="正常标签文案"
title="Normal label"
>
正常标签文案
Normal label
</label>
</div>
<div
@ -7631,9 +7631,9 @@ exports[`renders components/form/demo/layout-can-wrap.tsx extend context correct
<label
class="ant-form-item-required ant-form-item-no-colon"
for="wrap_password"
title="超长标签文案超长标签文案"
title="A super long label text"
>
超长标签文案超长标签文案
A super long label text
</label>
</div>
<div

8
components/form/__tests__/__snapshots__/demo.test.tsx.snap

@ -4844,9 +4844,9 @@ exports[`renders components/form/demo/layout-can-wrap.tsx correctly 1`] = `
<label
class="ant-form-item-required ant-form-item-no-colon"
for="wrap_username"
title="正常标签文案"
title="Normal label"
>
正常标签文案
Normal label
</label>
</div>
<div
@ -4884,9 +4884,9 @@ exports[`renders components/form/demo/layout-can-wrap.tsx correctly 1`] = `
<label
class="ant-form-item-required ant-form-item-no-colon"
for="wrap_password"
title="超长标签文案超长标签文案"
title="A super long label text"
>
超长标签文案超长标签文案
A super long label text
</label>
</div>
<div

4
components/form/demo/layout-can-wrap.tsx

@ -11,11 +11,11 @@ const App: React.FC = () => (
colon={false}
style={{ maxWidth: 600 }}
>
<Form.Item label="正常标签文案" name="username" rules={[{ required: true }]}>
<Form.Item label="Normal label" name="username" rules={[{ required: true }]}>
<Input />
</Form.Item>
<Form.Item label="超长标签文案超长标签文案" name="password" rules={[{ required: true }]}>
<Form.Item label="A super long label text" name="password" rules={[{ required: true }]}>
<Input />
</Form.Item>

4
components/tag/demo/draggable.tsx

@ -25,14 +25,14 @@ const DraggableTag: FC<DraggableTagProps> = (props) => {
const commonStyle = {
cursor: 'move',
transition: 'unset', // 防止拖拽完毕之后元素抖动
transition: 'unset', // Prevent element from shaking after drag
};
const style = transform
? {
...commonStyle,
transform: `translate3d(${transform.x}px, ${transform.y}px, 0)`,
transition: isDragging ? 'unset' : transition, // 处理拖拽中的元素不跟手的问题
transition: isDragging ? 'unset' : transition, // Improve performance/visual effect when dragging
}
: commonStyle;

6
components/tree/demo/drag-debug.tsx

@ -40,7 +40,7 @@ const App: React.FC = () => {
const onDragEnter: TreeProps['onDragEnter'] = (info) => {
console.log(info);
// expandedKeys 需要受控时设置
// expandedKeys, set it when controlled is needed
setExpandedKeys(info.expandedKeys);
};
@ -79,7 +79,7 @@ const App: React.FC = () => {
// Drop on the content
loop(data, dropKey, (item) => {
item.children = item.children || [];
// where to insert 示例添加到尾部,可以是随意位置
// where to insert. New item was inserted to the end of the array in this example, but can be anywhere
item.children.push(dragObj);
});
} else if (
@ -89,7 +89,7 @@ const App: React.FC = () => {
) {
loop(data, dropKey, (item) => {
item.children = item.children || [];
// where to insert 示例添加到头部,可以是随意位置
// where to insert. New item was inserted to the start of the array in this example, but can be anywhere
item.children.unshift(dragObj);
});
} else {

6
components/tree/demo/draggable.tsx

@ -36,7 +36,7 @@ const App: React.FC = () => {
const onDragEnter: TreeProps['onDragEnter'] = (info) => {
console.log(info);
// expandedKeys 需要受控时设置
// expandedKeys, set it when controlled is needed
// setExpandedKeys(info.expandedKeys)
};
@ -74,7 +74,7 @@ const App: React.FC = () => {
// Drop on the content
loop(data, dropKey, (item) => {
item.children = item.children || [];
// where to insert 示例添加到头部,可以是随意位置
// where to insert. New item was inserted to the start of the array in this example, but can be anywhere
item.children.unshift(dragObj);
});
} else if (
@ -84,7 +84,7 @@ const App: React.FC = () => {
) {
loop(data, dropKey, (item) => {
item.children = item.children || [];
// where to insert 示例添加到头部,可以是随意位置
// where to insert. New item was inserted to the start of the array in this example, but can be anywhere
item.children.unshift(dragObj);
// in previous version, we use item.children.push(dragObj) to insert the
// item to the tail of the children

Loading…
Cancel
Save