When I add the language specific field to my import, I get the right translations to the right fields, but when I click on the "translate" link, Drupal doesn't know that the node has been translated and offers me a "translate" link.

I noticed this when none of the nodes had a proper link for the translated version. When I add the translation, pathauto reacts and creates a proper link instead of /en/node/12345.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stomerfull’s picture

i tried module but have the same issue translation are not saved , no error appeared

thanks for your help

olofbokedal’s picture

Status: Active » Needs review
FileSize
792 bytes

I've made e small changed in the mapper, where the translations are added.

The changes will make sure that the source language is added as a translation as well, however, with the source attribute being empty, which seems to be the way that Entity Translation likes it. It will also make sure that a translation with an undefined language won't be added, and that translations won't be added if the source language is undefined.

PascalAnimateur’s picture

Re-rolled the patch against latest 1.x-dev.

PascalAnimateur’s picture

FileSize
701 bytes

This works well in my case, although not setting the built-in 'title' target mapping produces an empty value in node->title_original ('title' column from the node table). The same is true for the 'language' mapping, it it's not set the node->language value is also empty.

Saving the node manually once imported fixes these issues, language and title_original are properly populated from the entity_translation settings for this content type (/admin/config/regional/entity_translation).

So although the behavior is intuitive (language target has priority over entity_translation settings), the value of node->language should be set from the entity_translation settings when 'language' target is absent. As for node->title_original, this should be fixed as a special case when importing title_field (i.e. when title module is used), again based on the determined source language. Perhaps this could be tackled in another issue...

Mohammed J. Razem’s picture

Status: Needs review » Patch (to be ported)
FileSize
701 bytes

Thanks PascalAnimateur.

Patch rerolled against latest dev (after closing #1648532: Undefined index: FeedsImporter in FeedsPlugin::child() when none of the fields are translatable).

Mohammed J. Razem’s picture

Status: Patch (to be ported) » Fixed

PascalAnimateur’s picture

Status: Fixed » Needs work

It looks like there's a problem with the repository due to the presence of the 'master' branch, i.e. the zip file is generated from this branch instead of 7.x-1.x where the commit was made and doesn't contain the patched code.
Deleting the master branch should fix the problem...