diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index f1a9eb62a5..d46fa23a85 100644 --- a/importexport/inc/class.importexport_export_csv.inc.php +++ b/importexport/inc/class.importexport_export_csv.inc.php @@ -153,9 +153,23 @@ class importexport_export_csv implements importexport_iface_export_record // 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); + + // Get translations from wizard, if possible + $backtrace = debug_backtrace(); + $plugin = $backtrace[1]['class']; + $wizard_name = $appname . '_wizard_' . str_replace($appname . '_', '', $plugin); + try { + $wizard = new $wizard_name; + $fields = $wizard->get_export_fields(); + foreach($this->mapping as $field => &$label) + { + if($fields[$field]) $label = $fields[$field]; + } + } catch (Exception $e) { + translation::add_app($appname); + foreach($this->mapping as $field => &$label) { + $label = lang($label); + } } } $mapping = ! empty( $this->mapping ) ? $this->mapping : array_keys ( $this->record );