From 4e7a96c5a831882463802cdd4f84fe1464969cb0 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Wed, 23 Mar 2022 12:29:43 +0100 Subject: refactor: use formatjs swc plugin I'm not able to configure SWC plugins in Next.js so to make it works, all translation must have an id. --- src/components/ContactForm/ContactForm.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/components/ContactForm/ContactForm.tsx') diff --git a/src/components/ContactForm/ContactForm.tsx b/src/components/ContactForm/ContactForm.tsx index 48772a0..5af6982 100644 --- a/src/components/ContactForm/ContactForm.tsx +++ b/src/components/ContactForm/ContactForm.tsx @@ -34,6 +34,7 @@ const ContactForm = () => { defaultMessage: 'Warning: mail not sent. Some required fields are empty.', description: 'ContactForm: missing fields message.', + id: 'WpycgB', }) ); return; @@ -57,6 +58,7 @@ const ContactForm = () => { defaultMessage: 'Thanks. Your message was successfully sent. I will answer it as soon as possible.', description: 'ContactForm: success message', + id: 'gQKeF+', }) ); resetForm(); @@ -64,6 +66,7 @@ const ContactForm = () => { const errorPrefix = intl.formatMessage({ defaultMessage: 'An error occurred:', description: 'ContactForm: error message', + id: 'pTxT7N', }); const error = `${errorPrefix} ${mail.message}`; setStatus('error'); @@ -94,21 +97,25 @@ const ContactForm = () => { const nameLabelBody = intl.formatMessage({ defaultMessage: 'Name', description: 'ContactForm: name field label', + id: '6ibqFS', }); const emailLabelBody = intl.formatMessage({ defaultMessage: 'Email', description: 'ContactForm: email field label', + id: 'Vuryko', }); const subjectLabelBody = intl.formatMessage({ defaultMessage: 'Subject', description: 'ContactForm: subject field label', + id: 'uMURuJ', }); const messageLabelBody = intl.formatMessage({ defaultMessage: 'Message', description: 'ContactForm: message field label', + id: '0zBQpa', }); return ( @@ -160,6 +167,7 @@ const ContactForm = () => { {intl.formatMessage({ defaultMessage: 'Send', description: 'ContactForm: send button text', + id: 'X7n7N2', })} -- cgit v1.2.3