diff --git a/importexport/inc/class.importexport_definitions_ui.inc.php b/importexport/inc/class.importexport_definitions_ui.inc.php index a8ab4117c4..f8e4c46ae9 100644 --- a/importexport/inc/class.importexport_definitions_ui.inc.php +++ b/importexport/inc/class.importexport_definitions_ui.inc.php @@ -479,6 +479,9 @@ class importexport_definitions_ui { $wizard_plugin = $content['plugin']; } + // App translations + if($content['application']) translation::add_app($content['application']); + $this->plugin = is_object($GLOBALS['egw']->$wizard_plugin) ? $GLOBALS['egw']->$wizard_plugin : new $wizard_plugin; // Global object needs to be the same, or references to plugin don't work diff --git a/importexport/inc/class.importexport_export_csv.inc.php b/importexport/inc/class.importexport_export_csv.inc.php index 374bcab746..0be2fbcaf6 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) + { + $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 ); diff --git a/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php b/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php index 7c450f2d37..38dd1c1b2f 100644 --- a/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php +++ b/importexport/inc/class.importexport_wizard_basic_export_csv.inc.php @@ -200,4 +200,12 @@ class importexport_wizard_basic_export_csv } } + + /** + * Expose export fields for use elsewhere + */ + public function get_export_fields() + { + return $this->export_fields; + } }