From 08e1ce3c9ee918a8bee31f8fd024b3bfdc11b742 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 14 Oct 2014 16:03:50 +0000 Subject: [PATCH] Keep custom translations as highest precidence. Fixes loading translations for another app loses custom translations --- phpgwapi/inc/class.translation.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index 6b293b3bf3..f572979897 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -339,6 +339,15 @@ class translation self::$loaded_apps[$app] = $l; // dont set something not existing to $loaded_apps, no need to load client-side } } + // Re-merge custom over instance level, they have higher precidence + if($tree_level && !$instance_level && self::$instance_specific_translations) + { + $custom = egw_cache::getInstance(__CLASS__, 'custom:en'); + if($custom) + { + self::$lang_arr = array_merge(self::$lang_arr, $custom); + } + } //error_log(__METHOD__.'('.array2string($apps).", '$lang') took ".(1000*(microtime(true)-$start))." ms, loaded_apps=".array2string(self::$loaded_apps).", loaded ".count($loaded)." phrases -> total=".count(self::$lang_arr));//.": ".function_backtrace()); }