jquery-ajaxchimp icon indicating copy to clipboard operation
jquery-ajaxchimp copied to clipboard

Update jquery.ajaxchimp.js to add support for error messages containing custom information

Open afmklk opened this issue 10 years ago • 5 comments

I have rewritten the "translate and display message part" so that responses don't have to be an EXACT copy of Mailchimp's error message. Some error messages contain custom information (username, email, list name etc.) and would not be translated without this fix.

afmklk avatar Jan 14 '15 16:01 afmklk

Good Point @dobiatowski

On a related note: It seems like Mailchimp's API response now includes translated error messages itself so this function may not be necessary any longer. Tested with German, can someone confirm this for other languages?

afmklk avatar Jan 19 '15 11:01 afmklk

I confirm - messages are translated but only successful ones. Error messages I get still in English.

@rik84 can you paste your request URL ? Maybe I am missing something.

adamlukaszczyk avatar Jan 19 '15 11:01 adamlukaszczyk

@alias-mac Non error messages are translated by MailChimp. You can set specific language for every list in MailChimp admin. Only errors messages which starts from "0 - " are generic.

This is what MailChimp should fix on their side - but this is a wish only :D

Translations mapping based on content of messages is not very reliable so in my case I do email validation on my side and only check if response has "0 - " error.

adamlukaszczyk avatar Feb 09 '15 09:02 adamlukaszczyk

I have a fix for this using regex matches in the dev-2.0 branch, but it comes with some other changes too, so you would might have to change your code a bit. Let me know if you try it out.

scdoshi avatar Nov 26 '15 23:11 scdoshi

@aufmkolk Your changes work like a charm! Now the translation works great, but you need to add "6: 'The username portion of the email address is empty'," this to the response list and translation in case when the user types only a single @ as email-address!

ITFactoryAUT avatar Mar 24 '17 16:03 ITFactoryAUT