2
votes

I have a multilingual Drupal 7 site with i18n and Entity translation enabled. Node fields translation works perfectly, but there is something wrong with comments. I enabled translation of comment body field. The problem is that comments are only displayed on native language version of the node . When I switch to foreign language, the node fields are translated, but comments are not shown at all (even those, which language matches the foreign language). I checked 'comment' table and it seems to be okay, the language field is populated.

Why are comments hidden on translated versions of nodes? Anyone has a clue?

Thanks for help!

1
check the view of "Recent comments", enable it, and in filter section, add a language filter with current user language. i didn't try, not sure it works.hkguile
It probably will, but it means I need to modify all templates to hide original comments, rewrite output of the Recent comments, so it matches the original markup and design. This sounds a bit complicated. Is there any way to make the original comments list work?Alexey
It is a usual skill to overridden the default view by using view module. You can duplicate the "gary" view "Recent comments" to a new view. You may have to add a language filter to show up the translated contents. Just a few clicks.hkguile
If above method not work. The worst case you have to find out which sql statement is select out the comments. You have to debug the sql statement and add a condition (see the sql api of drupal 7) with current language. search Global $language how to get the current language code. The node table in database has a language column to identify the language of a node . By default "und" is the lan code for your site's default language.hkguile
Did you managed to solve this problem? I have the same issue now. I started to trace where the comments disappearing in the comments module's data chain, but it seems that the comment_get_thread() which queries the comments to the nodes did not give back the comment ids. In this function there is a tagged query: if you remove the 'node_access' tag from the queries in this function, the problem disappers, so i think there is a bad query alteration somewhere in the internationalization module but i didnt had time to find it yet.Peter Hurtony

1 Answers

3
votes

This worked for me:

admin/config/regional/i18n/select

And uncheck the "Content to filter by language" options.