From 4f76748536f664fe16625ab5d4be7b743dade708 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 10 Oct 2012 15:58:58 +0000 Subject: [PATCH] Try translation of lookup values if straight lookup fails --- .../inc/class.importexport_import_csv.inc.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/importexport/inc/class.importexport_import_csv.inc.php b/importexport/inc/class.importexport_import_csv.inc.php index 0fed7b03e8..85589aadf5 100755 --- a/importexport/inc/class.importexport_import_csv.inc.php +++ b/importexport/inc/class.importexport_import_csv.inc.php @@ -266,6 +266,10 @@ class importexport_import_csv implements importexport_iface_import_record { //, // Automatic conversions if($appname) { + + // Load translations + translation::add_app($appname); + if(!self::$cf_parse_cache[$appname]) { $c_fields = importexport_export_csv::convert_parse_custom_fields($appname, $selects, $links, $methods); self::$cf_parse_cache[$appname] = array($c_fields, $selects, $links, $methods); @@ -285,7 +289,15 @@ class importexport_import_csv implements importexport_iface_import_record { //, foreach((array)$fields['select'] as $name) { if($record[$name] != null && is_array($selects) && $selects[$name]) { $key = array_search(strtolower($record[$name]), array_map('strtolower',$selects[$name])); - if($key !== false) $record[$name] = $key; + if($key !== false) + { + $record[$name] = $key; + } + else + { + $key = array_search(strtolower($record[$name]), array_map('strtolower',array_map('lang',$selects[$name]))); + if($key !== false) $record[$name] = $key; + } } } foreach((array)$fields['links'] as $name) {