fix: formItem label translate error (#5300)

Co-authored-by: dqc <qianchuan.deng@gmail.com>
This commit is contained in:
qianchuan 2022-09-05 10:35:27 +08:00 committed by GitHub
parent ed7d420e51
commit 99cf50d80a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -966,9 +966,7 @@ export class FormItemWrap extends React.Component<FormItemProps> {
{label {label
? render( ? render(
'label', 'label',
typeof label === 'string' typeof label === 'string' ? filter(label, data) : label
? filter(__(label), data)
: label
) )
: null} : null}
{required && (label || labelRemark) ? ( {required && (label || labelRemark) ? (
@ -1096,9 +1094,7 @@ export class FormItemWrap extends React.Component<FormItemProps> {
{label {label
? render( ? render(
'label', 'label',
typeof label === 'string' typeof label === 'string' ? filter(label, data) : label
? filter(__(label), data)
: label
) )
: null} : null}
{required && (label || labelRemark) ? ( {required && (label || labelRemark) ? (
@ -1220,9 +1216,7 @@ export class FormItemWrap extends React.Component<FormItemProps> {
{label {label
? render( ? render(
'label', 'label',
typeof label === 'string' typeof label === 'string' ? filter(label, data) : label
? filter(__(label), data)
: label
) )
: label} : label}
{required && (label || labelRemark) ? ( {required && (label || labelRemark) ? (
@ -1347,7 +1341,7 @@ export class FormItemWrap extends React.Component<FormItemProps> {
<span> <span>
{render( {render(
'label', 'label',
typeof label === 'string' ? filter(__(label), data) : label typeof label === 'string' ? filter(label, data) : label
)} )}
{required && (label || labelRemark) ? ( {required && (label || labelRemark) ? (
<span className={cx(`Form-star`)}>*</span> <span className={cx(`Form-star`)}>*</span>