When installing Entity Translation to use field translation instead of node translation, and I set "Multilingual Support" to "Enabled, with field translation", the variable "language_content_type_MYCONTENTYPE" as the value of 4. I18n does not recognize this mode as a translation mode when I select the tab "Multilingual settings".

The reason is that the method that detects if translation is enabled or not only checks for value to be 1 or 2... Is there a specific reason for that ?

I found that if I modify the method i18n_node_type_enabled I18n correctly recognizes translations with "Enabled, with field translation". The patch follows.

Comments

emorency’s picture

jose reyero’s picture

Status: Active » Closed (works as designed)

Right, we don't mess with ET nodes anymore which fixes some other issues.

lmeurs’s picture

@Jose Reyero: may I ask you to elaborate on comment #2? The problem still seems to exist and the patch from #1 looks viable, but may effect other functions wrongly.

See _i18n_node_form_node_form_alter(): to allow higher values than 2 for language_content_type_NODE_TYPE (Entity Translation uses ie. 4), maybe the first IF statement could be altered from:

if (i18n_node_type_enabled($node)) {

to:

if (variable_get('language_content_type_' . $node->type, 0)) {

Also see:

  1. #1669494: Selecting language in new node and saving, keeps node language neutral
  2. #1852102-22: Clarify that Multilingual Content (i18n_node) and ET are not compatible (comments #22 and #23 are on this subject)
rv0’s picture

Status: Closed (works as designed) » Active

Switching to active as this is still an issue (see #1852102: Clarify that Multilingual Content (i18n_node) and ET are not compatible) just as reported in #3.
Comment #23 here proposes a simple solution for it https://www.drupal.org/node/1852102#comment-9612303

rv0’s picture

Bump.. (see above comment)

Cyclodex’s picture

Yes, this function should not report no translation support, if there are other modules like entity adding other kind of support.
Why is it limited to 1, and 2 ? why not everything else than 0 ?

For the moment we have to correct things, like in #1852102: Clarify that Multilingual Content (i18n_node) and ET are not compatible

joseph.olstad’s picture

I recently upgraded my content types to ET (entity translation) and I did not observe this issue. ?

hmm

joseph.olstad’s picture

here's the version of entity_translation I use:

projects[entity_translation][version] = 1.0-beta5
projects[entity_translation][subdir] = contrib
projects[entity_translation][patch][2557429] = https://www.drupal.org/files/issues/static_cache_for-2557429-17.patch
projects[entity_translation][patch][2734295] = https://www.drupal.org/files/issues/entity_translation-2734295-4.patch
srclarkx’s picture

Status: Active » Needs review
StatusFileSize
new999 bytes

Here is a patch from the code that Cyclodex provided.

Status: Needs review » Needs work

The last submitted patch, 9: i18n_1662884-9_incompatibility_with_entity_translation.patch, failed testing.

srclarkx’s picture

Version: 7.x-1.x-dev » 7.x-1.12
StatusFileSize
new999 bytes

Whoops, wrong Version. Patch is for 7.x-1.12

joseph.olstad’s picture

Status: Needs work » Needs review
StatusFileSize
new979 bytes

I had to make these changes to the patch:

remove this line

  a/i18n/i18n_node/i18n_node.module b/i18n/i18n_node/i18n_node.module

replace with this line

  a/i18n_node/i18n_node.module b/i18n_node/i18n_node.module
joseph.olstad’s picture

Version: 7.x-1.12 » 7.x-1.x-dev
joseph.olstad’s picture

passes simple tests

needs review by humans

Thanks to @srclarkx for the original patch

srclarkx’s picture

Actually thanks to Cyclodex. I needed to get a patch together for our language people to do some testing. I'll use the clean patch when we actually deploy. Thanks! I'll let you know how it works after it makes it through the process and onto our server.

milopca’s picture

Review by a human and works for me!
Thanks

  • Cyclodex authored da1bb34 on 7.x-1.x
    Issue #1662884 by srclarkx, joseph.olstad, emorency, Cyclodex, milopca:...
joseph.olstad’s picture

Status: Needs review » Fixed
Cyclodex’s picture

Thanks srclarkx for creating a patch of my mentioned changes!
And really nice community behaviour to mention me, thanks a lot, hope my changes are correct and helps :) !

joseph.olstad’s picture

excellent work everyone. this will hopefully make it into 7.x-1.15 which has been stalled pending the community feedback of the 7.x-1.x dev branch. Probably release 7.x-1.15 early 2017

Status: Fixed » Closed (fixed)

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