When retrieving results of a view using the function views_get_view_result(), filtering content's language to be the current user's language won't work + translatable fields won't be translated, they will always be displayed in the site's default language.

The current user's language should be added to the context of the function.
If I'm right this works correctly with the function views_embed_view()

Comments

Nicolas Bouteille’s picture

Category: feature » bug

Switching to bug report as I think it is more appropriated.

Nicolas Bouteille’s picture

Any one ? Any advice where I should be looking ?

Nicolas Bouteille’s picture

Title: Make the function views_get_view_result() language aware » Results of views_get_view_result() are not translated by design. Is there a way to get translated raw data ?
Category: bug » support
Priority: Major » Minor

I finally got my answer from an issue posted on Views : http://drupal.org/node/1901214
First I was wrong about the filtering by current user's language not working, it is actually working so the function views_get_view_result() is indeed current user's language aware. However, I learnt that this function is designed to bring back « raw » data and that « raw » data means « not translated » data.
I personally think it would be great to have a way to retrieve « translated raw data » from Views.
For now I shared on the post above the way I did it but I would be interested to know what you guys think about it, what could be done and what couldn't.

Nicolas Bouteille’s picture

Issue summary: View changes

Part of the problem was not real