aboutsummaryrefslogtreecommitdiffstats
path: root/langs.inc.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-05-22 19:47:12 +0000
committerRomain d'Alverny <rda@mageia.org>2012-05-22 19:47:12 +0000
commitf28822ff2081c469ae0131274150be9d5ac0bd93 (patch)
treefece2826898dc8155dfc4d5bd70803b6de657b21 /langs.inc.php
parentc817af0153e1d4997887fa4b338aa82de10e469d (diff)
downloadwww-f28822ff2081c469ae0131274150be9d5ac0bd93.tar
www-f28822ff2081c469ae0131274150be9d5ac0bd93.tar.gz
www-f28822ff2081c469ae0131274150be9d5ac0bd93.tar.bz2
www-f28822ff2081c469ae0131274150be9d5ac0bd93.tar.xz
www-f28822ff2081c469ae0131274150be9d5ac0bd93.zip
new _h() helper, more helping _e()
Diffstat (limited to 'langs.inc.php')
-rw-r--r--langs.inc.php18
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);
}
/**