Content type with (of course) node title and two cck taxonomy fields with two different vocabularies (i.e. Category, Type).
3 languages, English is default language. i18nviews is installed.

If I create a tabular view and add title + two fields (both as taxonomy:all terms, limit therms on different vocab), the column labels are correct in English, but in the other languages the second taxonomy column has the same label als the first.

It seems that both labels get the translation key viewname:default:field:term_node:tid:label

The second field actually has id tid_1, but the views module uses (the same) field type instead of the id to compose the translation key, so instead of ...:tid_1:label, the second label one also uses ...:tid:label

(See also http://drupal.org/node/1106622 on i18nviews, and somewhat related http://drupal.org/node/1008358)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bart.hanssens’s picture

Status: Active » Needs review
FileSize
1.68 KB

This patch (against 6.x-dev) seems to work.

Now generates

viewname:default:field:term_node:tid:label
viewname:default:field:term_node:tid_1:label

szantog’s picture

This patch doesn't worked for me, but imho i could catch it based on your work. Actually all of my translation works well.

dawehner’s picture

Status: Needs review » Needs work
+++ views//includes/handlers.inc	2011-03-29 11:28:09.227060000 +0200
@@ -289,7 +289,9 @@ class views_handler extends views_object
+	  // NOTE: use (unique) id instead of field
+      // $options['field']

Please take care to use drupal code style. It shouldn't include tabs

+++ views//includes/handlers.inc	2011-03-29 11:28:09.227060000 +0200
@@ -313,7 +315,11 @@ class views_handler extends views_object
+    // not sure if this is required

I think this is not required

+++ views//plugins/views_plugin_display.inc	2011-03-29 10:48:18.940055200 +0200
@@ -2582,10 +2581,12 @@ class views_plugin_display extends views
+	  ¶

Some random whitespace

+++ views//plugins/views_plugin_display.inc	2011-03-29 10:48:18.940055200 +0200
@@ -2582,10 +2581,12 @@ class views_plugin_display extends views
+	  // Note: use (unique) $info['id'] instead of $info['field']

I think it doesn't have to be noted

dawehner’s picture

Here is another patch

dawehner’s picture

Status: Needs work » Needs review

Update status.

dawehner’s picture

Status: Needs review » Fixed

After review from webflow, commited to 6.x-3.x and 7.x-3.x

Status: Fixed » Closed (fixed)

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

coert’s picture

Version: 6.x-3.x-dev » 7.x-3.0-rc3

I have a problem with my field_data_field_-tables now, and I believe it's due to this fix. It seems column-names weren't merged properly with the views update to RC3. I now get an error:
'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'field_data_field_authors.uid\' in \'on clause\''

In my field_data_field_authors-table I have the column 'field_data_field_authors.field_authors_uid', I believe should have been merged in the update to 'field_data_field_authors.uid'... due to the bugfix described here... (I think, though not entirely sure)

Would it suffice to rename the column in my DB from 'field_data_field_authors.field_authors_uid' to 'field_data_field_authors.uid' to fix this now?