fix some errors in new phpUnit tests: define lang() only if not already done

This commit is contained in:
Ralf Becker 2020-03-04 21:15:07 +01:00
parent f7989fc2c8
commit ab289eb5c1

View File

@ -56,14 +56,17 @@ require_once(EGW_INCLUDE_ROOT . '/api/src/loader/common.php');
* function to handle multilanguage support
*
*/
function lang($key,$vars=null)
if (!function_exists('lang'))
{
if(!is_array($vars))
function lang($key, $vars = null)
{
if (!is_array($vars))
{
$vars = func_get_args();
array_shift($vars); // remove $key
}
return $GLOBALS['egw_setup']->translation->translate("$key", $vars);
}
}
if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php'))