I successfully managed to create field translations. Now i want to create Views for them.
I don't succeed yet. What should be done?
- Create a content type; create 3 fields; set only the Body as a translatable field.
- Create a node; translate to some languages.

I only get a view with the node in the original language.

Comments

johnv’s picture

I seems like 'I18N-Field translation' must be enabled to activate Views...
#1006176: Add support for field based translation says Views is ready. (currenty working with views 7.x-3.x-dev (2011-Mar-30))
#1041340: 'Field Language' in 'Query options' missing "All languages" option haven't seen these options yet..

plach’s picture

Title: Views support for Entity Translations? » Views support for field translations?
Project: Entity Translation » Views (for Drupal 7)
Version: 7.x-1.x-dev » 7.x-3.x-dev

Maybe bojanz can answer on this.

bojanz’s picture

Status: Active » Fixed

If you've enabled the Entity Translation module, you should be able to see "Field Language" in the Query settings.
There are plans to move the setting to Display settings (#1089876: Move field_language to display settings.) so be prepared if it moves in one of the next -dev versions (or betas).

There are a few more corner cases I want to cover in the near future, but I consider the field translation support to be pretty solid.
Reopen this issue if you need more advice.

johnv’s picture

Status: Fixed » Active

OK, I'll watch out for the move of the checkbox.
Meanwhile, the query still doesn't show different field translations..
In modules, I have set:
On=Internationalization
On=Entity translation
Off=Field translation
Off=Multilingual content
Off=Multilingual select

In table node, I have one record with nid=123/vid=123/language=en/tnid=0
In table field_data_body, I have 3 records with entity_id/language = 123/en + 123/ca + 123/da
In Views/Query settings/Field Language: checkbox = off, so I don't add language to query.
The view is for base table Content, not Content Revisions. (Content languages does not exist)

First attempt: I show Body-field, language. The view only shows 1 language version. I think this is fine (but not what I want), because the base table is 'node', and the system will do a node_load of 1 language. (unless the new options alters that.) The query is:

 SELECT node.nid AS nid, node.language AS node_language, 'node' AS field_data_body_node_entity_type
FROM {node} node 

Second attempt: I add Relationship 'Content translation: Translations' (Translation option = All), and use this for both fields. No success, and I don't think this is the right approach, because field tnid is used in query, but not in Entity Translation (?)

 SELECT ... FROM {node} node
LEFT JOIN {node} node_node ON node.nid = node_node.tnid
WHERE (( ... (node.nid = '123') )) 
bojanz’s picture

You've totally confused yourself :)

Entity Translation has nothing to do with Content Translation. Using one module, and adding another's relationships to the view won't help you.
tnid is absolutely not used.

What you need to do is uncheck the "When needed, add the field language condition to the query." checkbox in the Query settings, then make sure that a join to the field table is being made (by adding a sort or a filter on the field).
Since this is a second time I've had to write these instructions, there might be a need for an option that forces the join (something like "Show all languages" or whatever...)

johnv’s picture

Yep, the words are pretty confusing: The module is called Entity Translation, but in fact it does per-field-translation, which is not the same as Field Translation .. :-(
Anyway, I indeed read your comment about the join, and forgot about it. So I added a sort on body-field, and now have 3 records in my view, but they all show the same translation. The status of the 'all languages' checkbox doesn't matter.
IMO the query collects the correct data: node[en] + node-body[en] + node-body[en/nl/ca].
But I cannot show the translated body-field. To exclude the possibility that the body-field still has some exceptions, I added a separate translatable textfield - no result. Adding this second field to the sort triplicates (!) my result set: 3x3 languages!

My first thought was to ask you is you can automatically add the join/table via e.g. ensure_my_table(), which is used a lot in Views-relations, but now i think I need a Relationship to my node, that holds the correct language.

I hope you have another simple tip and I am overcomplicating..

bojanz’s picture

I think that you've run into a bug now.
Showing all translations was not in the original list of scenarios (proof that in Views you think of a hundred things, and the users think of a hundred more :P).
I'll have to create a patch, but won't be able to do that before tomorrow.

In the meantime, try with relations and see how far it gets you.

johnv’s picture

Bojanz, I'll keep on trying. I am curious how you guys planned to use entity translations in Views. Is there already some video/intro out there? Perhaps that aligns my mindset with yours!

calculus’s picture

Subscribing

drasgardian’s picture

subscribing

vood002’s picture

Subscribing....thusfar unable to get views to play well with Entity Translation.

Edit: User error, I haven't found anything I need to do and can't accomplish yet.

plach’s picture

kars-t’s picture

Status: Active » Fixed

Dear fellow Drupal enthusiasts,

this issue is now lasting for a very long time in the issue queue and was unfortunately never solved. As Drupal is a open source project everyone is helping on voluntary basis. So that this is was not solved is nothing personal and means no harm. But perhaps no one had time to deal with this issue, maybe it is too complex or did not describe the problem comprehensibly.

But this issue is not the only one. There are thousands of issues on Drupal.org that have never been worked on or could not be processed. This means that we are building a wave that is unmanageable and just a problem for the Drupal project as a whole. Please help us keep the issue queue smaller and more manageable.

Please read again, "Making an issue report" and see if you can improve the issue. Test the problem with the current Core and modules. Maybe the problem doesn't exist anymore, is a duplicate or has even been solved within this issue but never closed.

Help can also be found for it on IRC and in the user groups.

In order to remove this issue, I have set this issue to "fixed".

If there is new information, please re-open the issue.

--
This issue was edited with the help of Issue Helper

Status: Fixed » Closed (fixed)

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

codeyourdream’s picture

Status: Closed (fixed) » Active

The issue is still actual.

In view settings in the "Fields" section you can create labels for fields. These labels are not getting translated (even though the "Field translation" module is enabled and translates the labels well on content node pages).

codeyourdream’s picture

Status: Active » Fixed

Managed to resolve that. Moving back to fixed.

Status: Fixed » Closed (fixed)

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

schifazl’s picture

I was experiencing this problem too, but I've resoved it with #37 here:https://drupal.org/comment/7360440#comment-7360440

It was a mistake of mine: instead of filtering by "entity translation: language" i was filtering by the "Content: language" field