Problem/Motivation

The i18n_strings provided by the Mailchimp signup module are added on runtime through i18n_string. This is a problem for sites deployed through continuous integration, since the translation files are only imported for strings that are implemented through hook_i18n_object_info().

Proposed resolution

Leverage the Entity API's EntityDefaultI18nStringController to do the minimum amount of work necessary. Since the mergefields are supplied by the Mailchimp API, these fields have to be added through a custom i18n_string_object_wrapper.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

There is a new tab 'Translate' available on the Mailchimp sign edit form that provides a translation form for the Mailchimp signup form settings.

API changes

None.

Data model changes

The hook_i18n_object_info() implementation means the Mailchimp Signup module gets its own textgroup 'mailchimp_signup'. This means the i18n string translations will have to be updated by the site admin. For this reason I would like to suggest this change is only available in the 7.x-4.x branch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review

Attached patch implements hook_i18n_object_info() by using the Entity API's EntityDefaultI18nStringController.

ruscoe’s picture

Status: Needs review » Postponed (maintainer needs more info)

@idebr I think you may have forgotten to attach your patch :)

idebr’s picture

idebr’s picture

Status: Postponed (maintainer needs more info) » Needs review
eelkeblok’s picture

The patch no longer applies to the latest versions, here is a reroll. It's a simple reroll, the patch included a fix for another issue that has been included in version 4.4 and a block of code that the patch removes was changed slightly, thereby causing a conflict. The patch has been running in production for some time now and looks fine, codewise, so I'll set it to RTBC.

eelkeblok’s picture

ruscoe’s picture

Thanks for updating this patch. It applies cleanly, but I'm not seeing the "Translate" tab mentioned in the ticket.

ruscoe’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)
idebr’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
99.24 KB

@ruscoe Thanks for having a look! There are a few requirements before the 'Translate' tab is available. Can you check if these are met:
- Enabled modules: locale, i18n_string, mailchimp_i18n
- Enabled languages: At least two languages must be enabled
- Your user has the permission 'Translate strings'

When these requirements are met, the 'Edit signup form' should look like this:

ruscoe’s picture

Assigned: Unassigned » ruscoe

  • ruscoe committed b17d56c on 7.x-4.x authored by idebr
    Issue #2724711 by idebr, eelkeblok: Implement i18n_object_info so...
ruscoe’s picture

Assigned: ruscoe » Unassigned
Status: Needs review » Fixed

Thanks, @idebr! The patch works great and has been merged in.

Thanks for the help with translations; not something I've had much experience with.

idebr’s picture

Cheers! I´ll have a look at some recent issues in the issue queue tomorrow to see if this patch covers the translation issues.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.