Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Issue #https://www.drupal.org/node/610506 fixes translation. BUT Email Address now always has the name Email Address. So if the default language of a site is not english, translation for that mergefield to the default language is (as far as I can see) impossible.
Comments
Comment #2
B-Prod CreditAttribution: B-Prod commentedAny news about this?
Comment #3
B-Prod CreditAttribution: B-Prod commentedI tried to get the EMAIL merge field data from the Mailchimp API, but I didn't get any result. It seems that the Mailchimp API never send this field.
So the way used to translate the fields (@see issue Translation) will never work with the email address field, that is not considered by Mailchimp as a normal MERGE tag.
So we need an other way to translate this field...
Maybe the "Email address" string could be translated when defining the MERGE var?
Comment #4
daften CreditAttribution: daften at Picabit commentedThe problem now is that Email address is hardcoded, so if the default language is Dutch, that string just can't be translated to dutch. I have honestly no idea how to fix this properly. I worked around it by creating a patch for my project that changes this hardcoded string to Emailadres (the dutch variant), but that's a dirty hack.
Comment #5
B-Prod CreditAttribution: B-Prod commentedActually translating the name when defining the MERGE var works, but has some other issue.
The workflow is the following :
This works, but... :
What would be better:
add some options in the signup form to override the value of each MERGE var label, so we could use i18n strings as it is expected to be used. I am not really convinced by the current method of translating the MERGE fields inside Mailchimp backoffice.
Comment #6
fotograafinge CreditAttribution: fotograafinge commentedI agree. Also have he same problem (for 7.4 and 8.x)
@daften: how did you patch it ? I could not manage to solve it.
Comment #7
Greg BoggsComment #8
idebr CreditAttribution: idebr at One Shoe commentedHello everyone,
You should now be able to translate Mailchimp merge fields using the new mailchimp_i18n submodule added in #2724711: Implement i18n_object_info so i18n_strings can be imported automatically. Please let me know if you need any more help with your translations.
Comment #9
esolitosWhat about D8? The module
mailchimp_i18n
is not available and it seems that this is still an issue on D8?Comment #10
AnybodyPlease see https://www.drupal.org/node/2822227#comment-11836593 for further discussion also.
Comment #11
daften CreditAttribution: daften at Picabit commented@idebr. It's been a while since I worked this project and my changes have been overwritten by somebody doing an unchecked drush up. But if I remember correctly, I patched it to add a t function. Not correct, but it did fix it for me.
Comment #12
Peter MajmeskuHere is the patch, which solves this issue for me. Edit for 1 line of code.
Comment #13
daften CreditAttribution: daften at Picabit commentedMarking as needs review, since you can't mark your own patch as reviewed :D
Comment #14
devad CreditAttribution: devad as a volunteer commentedThe patch #12 doesn't apply cleanly any more to latest 8.x-1.3 and 8.x-1.x-dev. It needs rewrite.
But, after I have edited one line manually (as patch is supposed to do) - it works.
However, it needs some instruction how it works.
1. Create first Mailchimp Signup Form.
2. Visit /admin/config/regional/translate, search for "Email Address" string and translate it.
3. Edit already created Mailchimp Signup Form (and create other signup forms if you need more than one).
An attempt to search for "Email Address" string before step one will fail because step 1 is necessary for translation string creation.
Form translation to multiple languages works nicely as well.
Marking this to "needs work" just because the patch needs to be updated.
Comment #15
snsblvd CreditAttribution: snsblvd as a volunteer commentedI just saw that this issue https://www.drupal.org/project/mailchimp/issues/2903123 (Mergefields can not be translated: Email Address, First Name, Last Name) made it to the latest release (https://www.drupal.org/project/mailchimp/releases/8.x-1.4). So I guess this issue is solved too, right?
Comment #16
gcbComment #17
brendanthinkshout CreditAttribution: brendanthinkshout at ThinkShout for Mailchimp commentedsnsblvd is correct--the patches above are obviated, and "Email Address" is now run through t().