Commit da4fcc95 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1515156 by plach, fabsor, steinmb, dawehner: Added Expose the field...

Issue #1515156 by plach, fabsor, steinmb, dawehner: Added Expose the field language column for translatable fields.
parent 09183ab6
......@@ -394,6 +394,45 @@ function field_views_field_default_views_data($field) {
'field_name' => $field['field_name'],
);
}
// Expose additional language column for translatable fields.
if (!empty($field['translatable'])) {
$title_language = t('@label (!name:language)', array('@label' => $label, '!name' => $field['field_name']));
$title_short_language = t('@label:language', array('@label' => $label));
$data[$table]['language'] = array(
'group' => $group,
'title' => $title_language,
'title short' => $title_short_language,
'help' => t('Language - Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))),
);
$data[$table]['language']['field'] = array(
'id' => 'language',
);
$data[$table]['language']['argument'] = array(
'field' => 'language',
'table' => $table,
'id' => 'language',
'additional fields' => $additional_fields,
'empty field name' => t('<No value>'),
'field_name' => $field['field_name'],
);
$data[$table]['language']['filter'] = array(
'field' => 'language',
'table' => $table,
'id' => 'language',
'additional fields' => $additional_fields,
'field_name' => $field['field_name'],
'allow empty' => TRUE,
);
$data[$table]['language']['sort'] = array(
'field' => 'language',
'table' => $table,
'id' => 'standard',
'additional fields' => $additional_fields,
'field_name' => $field['field_name'],
);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment