I use a lot of Views tables and I haven't managed to translate their labels.
Is it possible already and I simply haven't managed to get it set up properly or could it be added in the future?
I use a lot of Views tables and I haven't managed to translate their labels.
Is it possible already and I simply haven't managed to get it set up properly or could it be added in the future?
Comments
Comment #1
dalekseenko commentedYeah, I have the same exact issue. View fields can be set up using only one language.
Comment #2
benCorpo commentedIn order to be able to translate labels, I have changed the following lines of codes to use the core "Locale" functionnality.
File views.module
In function: views_get_title()
Change all "returns" to include the t()
In function: theme_views_view_list()
Changed line (#1420):
$item .= "
";
For:
$item .= "
";
In function: theme_views_view_table()
Added lines (around #1449)
foreach ($view->table_header as $idx => $col) {
$view->table_header[$idx] = t($col['data']);
}
Of course, once it is done, all you need is to go and translate the string using the regular "Translate" interface.
Hope this is usefull to some people.
Comment #3
lupus78 commentedThanks, this is very usefull!
Comment #4
Rob L commentedI'm trying to use the above technique to translate an option on one of my view fields.
My field name is 'Node: view link' and the option is 'read more'.
Should this option be picked up and translated by the changes from above, or do I need to apply the t() function somewhere else?
Thanks in advance.
Comment #5
rolodmonkey commentedThis issue is two years old and for a version of Drupal that is no longer supported.