diff options
Diffstat (limited to 'langs.inc.php')
-rw-r--r-- | langs.inc.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/langs.inc.php b/langs.inc.php index f81e000ba..1d592e3d7 100644 --- a/langs.inc.php +++ b/langs.inc.php @@ -159,8 +159,22 @@ function _t($s = null, $opt = null) { return ($s == '' ? '---' : (array_key_exists($s, $_t) ? $_t[$s] : $s)); } -function _e($s = null) { - echo _t($s); +/** + * Shorthand to echo localized strings. + * +*/ +function _e($s = null, $args = null) { + if (is_array($args)) + echo vsprintf(_t($s), $args); + else + echo _t($s); +} + +function _h($s, $args = null, $tag = 'p') { + if (is_array($args)) + $s = vsprintf(_t($s), $args); + + echo sprintf('<%s>%s</%s>', $tag, $s, $tag); } /** |