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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with
18 additions and
18 deletions
components/form/__tests__/__snapshots__/demo-extend.test.ts.snap
components/form/__tests__/__snapshots__/demo.test.tsx.snap
components/form/demo/layout-can-wrap.tsx
components/tag/demo/draggable.tsx
components/tree/demo/drag-debug.tsx
components/tree/demo/draggable.tsx
@ -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
@ -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
@ -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 >
@ -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 ;
@ -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 {
@ -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