Followup to #1962022: Allow labels to be overriden.
The admin can now override labels with custom ones. (So instead of node/nodes, it can be book/books, etc).
However, these labels are not translatable.
We need to integrate with i18n_string (or possibly i18n_field) to allow them to be translated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Status: Active » Needs review
FileSize
4.75 KB

First stab.
This works, but I'm not exactly happy with it.

MXT’s picture

Hi Bojanz,

I've applied this patch to latest stable release and, although patch applies cleanly, labels are not translated and system returns the following errors:

Trying to refresh inline_entity_forms i18n strings at '/admin/config/regional/translate/i18n_string' I receive the following warning:

Cannot refresh strings for Inline Entity Form.

On field edit settings I receive:

Warning: Missing argument 1 for EntityInlineEntityFormController::labels(), called in /var/www/my-site/sites/all/modules/contrib/inline_entity_form/includes/entity.inline_entity_form.inc on line 171 and defined in EntityInlineEntityFormController->labels() (linea 58 di /var/www/my-site/sites/all/modules/contrib/inline_entity_form/includes/entity.inline_entity_form.inc).
Notice: Undefined variable: instance in EntityInlineEntityFormController->labels() (linea 62..

So I've tryed to upgrade IEF to latest DEV version but patch doesn't apply on this:

$ git apply 2164511-1-translate-labels.patch
error: patch failed: includes/entity.inline_entity_form.inc:55
error: includes/entity.inline_entity_form.inc: patch does not apply
error: patch failed: inline_entity_form.module:399
error: inline_entity_form.module: patch does not apply

Thank you very much for your work

ayalas’s picture

FileSize
5.52 KB

I fixed the missing argument warning in the field settings form. There was a missing $instance argument in the call to label() in entity.inline_entity_form.inc line 171

Attached is a combined patch.

ayalas’s picture

FileSize
8.79 KB

Previous patch failed some tests. I searched the project and there were some other calls to labels() that missed the new argument.
Here's a revised patch.

minorOffense’s picture

Status: Needs review » Needs work

Patch doesn't appear to do anything. No new field options available in the field translation settings page.

Using an inline entity form widget (multiple).

minorOffense’s picture

I should clarify, the patch adds the listing in to the translation system, but the "Translation" tab on the field settings doesn't list the additional fields.

rodrigoaguilera’s picture

I had problems with this patch wit the strings not being detected on a field created by features on install.

I added a hook_field_create_instance calling hook_field_update_instance and some coding standard corrections

Also my entitities are eck and I created this patch.
https://www.drupal.org/node/2395307

rodrigoaguilera’s picture

Status: Needs work » Needs review

@minorOffense
Maybe your problem is related to this.

rodrigoaguilera’s picture

Rebased patch

mikran’s picture

Re-uploading the same patch to trigger testbot. Patch is so old that it was not tested by the new bot and tests are failing locally for me.

Status: Needs review » Needs work

The last submitted patch, 10: 2164511-9-translate-labels.patch, failed testing.

mikran’s picture

Status: Needs work » Needs review
FileSize
671 bytes
13.97 KB

A new patch, rerolled & fixed to make the tests pass.

This patch also includes the change made in #2862391: D7 branch tests are not passing in current HEAD.

Status: Needs review » Needs work

The last submitted patch, 12: 2164511-12.patch, failed testing.

mikran’s picture

Status: Needs work » Needs review
FileSize
469 bytes
14.42 KB

ohh I actually forgot to include the change made in other issue, here it is

Chris Matthews’s picture

The 2 year old patch in #14 applied cleanly to the latest inline_entity_form 7.x-1.x-dev and if still applicable needs review.

Applied patch includes/commerce_product.inline_entity_form.inc cleanly.
Applied patch includes/entity.inline_entity_form.inc cleanly.
Applied patch inline_entity_form.module cleanly.
Applied patch tests/multiple_values_widget.test cleanly.