| @@ 378-386 (lines=9) @@ | ||
| 375 | * @param string $vars =null multiple values to replace the placeholders |
|
| 376 | * @return string translated message with placeholders replaced |
|
| 377 | */ |
|
| 378 | function lang($key,$vars=null) |
|
| 379 | { |
|
| 380 | if(!is_array($vars)) |
|
| 381 | { |
|
| 382 | $vars = func_get_args(); |
|
| 383 | array_shift($vars); // remove $key |
|
| 384 | } |
|
| 385 | return Api\Translation::translate($key,$vars); |
|
| 386 | } |
|
| 387 | } |
|
| 388 | ||
| 389 | require_once __DIR__.'/security.php'; |
|
| @@ 59-67 (lines=9) @@ | ||
| 56 | * function to handle multilanguage support |
|
| 57 | * |
|
| 58 | */ |
|
| 59 | function lang($key,$vars=null) |
|
| 60 | { |
|
| 61 | if(!is_array($vars)) |
|
| 62 | { |
|
| 63 | $vars = func_get_args(); |
|
| 64 | array_shift($vars); // remove $key |
|
| 65 | } |
|
| 66 | return $GLOBALS['egw_setup']->translation->translate("$key", $vars); |
|
| 67 | } |
|
| 68 | ||
| 69 | if(file_exists(EGW_SERVER_ROOT.'/api/setup/setup.inc.php')) |
|
| 70 | { |
|
| @@ 510-518 (lines=9) @@ | ||
| 507 | * @param string The key for the phrase |
|
| 508 | * @see Translation::translate() |
|
| 509 | */ |
|
| 510 | static function lang($key,$args=null) |
|
| 511 | { |
|
| 512 | if (!is_array($args)) |
|
| 513 | { |
|
| 514 | $args = func_get_args(); |
|
| 515 | array_shift($args); |
|
| 516 | } |
|
| 517 | return Translation::translate($key,$args); |
|
| 518 | } |
|
| 519 | ||
| 520 | /** |
|
| 521 | * registered shutdown callbacks and optional arguments |
|