mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:36 +01:00
Keep custom translations as highest precidence.
Fixes loading translations for another app loses custom translations
This commit is contained in:
parent
56ba21e63f
commit
a137491ec0
@ -498,7 +498,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
self::_check_add($options,$path,$result);
|
||||
}
|
||||
if ($is_dir && (!isset($options['maxdepth']) || $options['maxdepth'] > 0) && ($dir = @opendir($path)))
|
||||
if ($is_dir && (!isset($options['maxdepth']) || ($options['maxdepth'] > 0 && $options['depth'] < $options['maxdepth'])) && ($dir = @opendir($path)))
|
||||
{
|
||||
while(($file = readdir($dir)) !== false)
|
||||
{
|
||||
@ -517,7 +517,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
$opts = $options;
|
||||
if ($opts['mindepth']) $opts['mindepth']--;
|
||||
if ($opts['maxdepth']) $opts['maxdepth']++;
|
||||
if ($opts['maxdepth']) $opts['depth']++;;
|
||||
unset($opts['order']);
|
||||
unset($opts['limit']);
|
||||
foreach(self::find($options['url']?$file:self::parse_url($file,PHP_URL_PATH),$opts,true) as $p => $s)
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user