Translation of field labels

This commit is contained in:
Nathan Gray 2011-01-11 22:09:25 +00:00
parent 5e9d01e176
commit 8615b3c9fa
2 changed files with 6 additions and 1 deletions

View File

@ -129,6 +129,11 @@ class importexport_export_csv implements importexport_iface_export_record
// begin with fieldnames ?
if ($this->num_of_records == 0 && $this->csv_options['begin_with_fieldnames'] ) {
if($this->csv_options['begin_with_fieldnames'] == 'label') {
foreach($this->mapping as $field => &$label) {
$label = lang($label);
}
}
$mapping = ! empty( $this->mapping ) ? $this->mapping : array_keys ( $this->record );
$mapping = $this->translation->convert( $mapping, $this->translation->charset(), $this->csv_charset );
fputcsv( $this->handle ,$mapping ,$this->csv_options['delimiter'], $this->csv_options['enclosure'] );

View File

@ -99,7 +99,7 @@ class importexport_wizard_basic_export_csv
foreach($this->export_fields as $field => $name) {
$content['fields'][] = array(
'field' => $field,
'name' => $name,
'name' => lang($name),
);
if($content['mapping'][$field]) {
$content['fields']['export'][$row] = $field;