Translate Field Label for Views Tables

This snippet is so that Views tables will be able to create translatable labels.

Make a custom module for your with the following function:

<?php
function otnet_views_pre_view(&$view, &$items) {
if (
$view->page_type == 'table') {
  
$table_header = $view->table_header;
   foreach (
$table_header as $curr => $val) {
     if (
$val['data']) {
      
$val['data'] = t($val['data']);
     }
    
$view->table_header[$curr] = $val
?>

 
 

Drupal is a registered trademark of Dries Buytaert.