mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:18:57 +01:00
Translate field names
This commit is contained in:
parent
6511f42e43
commit
582a06caf2
@ -129,6 +129,15 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
|
|
||||||
// begin with fieldnames ?
|
// begin with fieldnames ?
|
||||||
if ($this->num_of_records == 0 && $this->csv_options['begin_with_fieldnames'] ) {
|
if ($this->num_of_records == 0 && $this->csv_options['begin_with_fieldnames'] ) {
|
||||||
|
if($this->csv_options['begin_with_fieldnames'] == 'label') {
|
||||||
|
// Load translations for app
|
||||||
|
list($appname, $part2) = explode('_', get_class($_record));
|
||||||
|
if(!$GLOBALS['egw_info']['apps'][$appname]) $appname .= $part2; // Handle apps with _ in the name
|
||||||
|
translation::add_app($appname);
|
||||||
|
foreach($this->mapping as $field => &$label) {
|
||||||
|
$label = lang($label);
|
||||||
|
}
|
||||||
|
}
|
||||||
$mapping = ! empty( $this->mapping ) ? $this->mapping : array_keys ( $this->record );
|
$mapping = ! empty( $this->mapping ) ? $this->mapping : array_keys ( $this->record );
|
||||||
$mapping = $this->translation->convert( $mapping, $this->translation->charset(), $this->csv_charset );
|
$mapping = $this->translation->convert( $mapping, $this->translation->charset(), $this->csv_charset );
|
||||||
fputcsv( $this->handle ,$mapping ,$this->csv_options['delimiter'], $this->csv_options['enclosure'] );
|
fputcsv( $this->handle ,$mapping ,$this->csv_options['delimiter'], $this->csv_options['enclosure'] );
|
||||||
|
@ -59,6 +59,9 @@ class importexport_wizard_basic_export_csv
|
|||||||
'wizard_step30' => lang('Choose fields to export'),
|
'wizard_step30' => lang('Choose fields to export'),
|
||||||
'wizard_step40' => lang('Choose seperator and charset'),
|
'wizard_step40' => lang('Choose seperator and charset'),
|
||||||
);
|
);
|
||||||
|
list($appname, $part2) = explode('_', get_class($this));
|
||||||
|
if(!$GLOBALS['egw_info']['apps'][$appname]) $appname .= $part2; // Handle apps with _ in the name
|
||||||
|
translation::add_app($appname);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,7 +102,7 @@ class importexport_wizard_basic_export_csv
|
|||||||
foreach($this->export_fields as $field => $name) {
|
foreach($this->export_fields as $field => $name) {
|
||||||
$content['fields'][] = array(
|
$content['fields'][] = array(
|
||||||
'field' => $field,
|
'field' => $field,
|
||||||
'name' => $name,
|
'name' => lang($name),
|
||||||
);
|
);
|
||||||
if($content['mapping'][$field]) {
|
if($content['mapping'][$field]) {
|
||||||
$content['fields']['export'][$row] = $field;
|
$content['fields']['export'][$row] = $field;
|
||||||
|
Loading…
Reference in New Issue
Block a user