javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Configuration Wizard: MailChimp error messages are not translated

Open afercia opened this issue 6 years ago • 2 comments

Splitting this out from https://github.com/Yoast/yoast-components/issues/843

The Mailchimp email input field uses some validation via the Mailchimp API: the error messages returned are not translated:

screenshot 2019-03-06 at 14 35 16

Suggested on https://github.com/Yoast/yoast-components/issues/843:

We should see whether we can (automatically and hidden) specify a form language based on the user language in the MailChimp form, as I think MailChimp does have translated error messages available.

afercia avatar Mar 27 '19 09:03 afercia

Mailchimp docs: https://mailchimp.com/help/translate-signup-forms-and-emails/

Implementing it might be as simple as setting the language header on the request to mailchimp. It might be more complex 😄

IreneStr avatar Mar 27 '19 10:03 IreneStr

Not sure. Those docs seem related to the embedded form. Instead, we're using our own input field. Also, as of #5511 / #5512 we're using jsonp for the response and as far as I know, it's not possible to add headers to a jsonp request.

Even changing method, I'm not sure the Mailchimp response actually reacts to an Accept-Language header, couldn't find anything related in their documentation.

Lastly, I'm not sure sendRequest from ajaxHelper.js correctly sets the ajax request headers.

Seems more complicated than expected, thinking it would need some expert eyes.

afercia avatar Mar 27 '19 15:03 afercia