fix: fixed translation issue
This commit is contained in:
@@ -57,7 +57,7 @@ const CommentEditor = ({
|
||||
const shouldRequireCaptcha = !id && captchaSettings.enabled;
|
||||
|
||||
const captchaValidation = {
|
||||
recaptchaToken: Yup.string().required('Please complete the CAPTCHA verification'),
|
||||
recaptchaToken: Yup.string().required(intl.formatMessage(messages.captchaVerificationLabel)),
|
||||
};
|
||||
|
||||
const canDisplayEditReason = (edit
|
||||
@@ -112,7 +112,7 @@ const CommentEditor = ({
|
||||
const saveUpdatedComment = useCallback(async (values, { resetForm, setFieldError }) => {
|
||||
// Validate CAPTCHA for new comments from non-staff users
|
||||
if (shouldRequireCaptcha && !values.recaptchaToken) {
|
||||
setFieldError('recaptchaToken', 'Please complete the CAPTCHA verification');
|
||||
setFieldError('recaptchaToken', intl.formatMessage(messages.captchaVerificationLabel));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ const CommentEditor = ({
|
||||
})}
|
||||
>
|
||||
<Form.Label className="h6">
|
||||
Verify you are human
|
||||
{intl.formatMessage(messages.verifyHumanLabel)}
|
||||
</Form.Label>
|
||||
<div className="d-flex justify-content-start">
|
||||
<ReCAPTCHA
|
||||
|
||||
@@ -221,6 +221,16 @@ const messages = defineMessages({
|
||||
}`,
|
||||
description: 'sort message showing current sorting',
|
||||
},
|
||||
verifyHumanLabel: {
|
||||
id: 'discussions.verify.human.label',
|
||||
defaultMessage: 'Verify you are human',
|
||||
description: 'Verify you are human description.',
|
||||
},
|
||||
captchaVerificationLabel: {
|
||||
id: 'discussions.captcha.verification.label',
|
||||
defaultMessage: 'Please complete the CAPTCHA verification',
|
||||
description: 'Please complete the CAPTCHA to continue.',
|
||||
},
|
||||
});
|
||||
|
||||
export default messages;
|
||||
|
||||
@@ -98,7 +98,7 @@ const PostEditor = ({
|
||||
|
||||
const shouldRequireCaptcha = !postId && captchaSettings.enabled;
|
||||
const captchaValidation = {
|
||||
recaptchaToken: Yup.string().required('Please complete the CAPTCHA verification'),
|
||||
recaptchaToken: Yup.string().required(intl.formatMessage(messages.captchaVerificationLabel)),
|
||||
};
|
||||
|
||||
const enableNotifyAllLearnersTour = useCallback((enabled) => {
|
||||
@@ -182,7 +182,7 @@ const PostEditor = ({
|
||||
const submitForm = useCallback(async (values, { resetForm, setFieldError }) => {
|
||||
// Validate CAPTCHA for new posts from non-staff users
|
||||
if (shouldRequireCaptcha && !values.recaptchaToken) {
|
||||
setFieldError('recaptchaToken', 'Please complete the CAPTCHA verification');
|
||||
setFieldError('recaptchaToken', intl.formatMessage(messages.captchaVerificationLabel));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -540,7 +540,7 @@ const PostEditor = ({
|
||||
})}
|
||||
>
|
||||
<Form.Label className="h6">
|
||||
Verify you are human
|
||||
{intl.formatMessage(messages.verifyHumanLabel)}
|
||||
</Form.Label>
|
||||
<div className="d-flex justify-content-start">
|
||||
<ReCAPTCHA
|
||||
|
||||
@@ -175,6 +175,16 @@ const messages = defineMessages({
|
||||
defaultMessage: 'Archived',
|
||||
description: 'Heading for displaying topics that are archived.',
|
||||
},
|
||||
captchaVerificationLabel: {
|
||||
id: 'discussions.captcha.verification.label',
|
||||
defaultMessage: 'Please complete the CAPTCHA verification',
|
||||
description: 'Please complete the CAPTCHA to continue.',
|
||||
},
|
||||
verifyHumanLabel: {
|
||||
id: 'discussions.verify.human.label',
|
||||
defaultMessage: 'Verify you are human',
|
||||
description: 'Verify you are human description.',
|
||||
},
|
||||
});
|
||||
|
||||
export default messages;
|
||||
|
||||
Reference in New Issue
Block a user