fix: fixed translation issue

This commit is contained in:
sundasnoreen12
2025-07-16 21:11:58 +05:00
parent f67ead3c0b
commit 90486b7454
4 changed files with 26 additions and 6 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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

View File

@@ -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;