aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--langs.inc.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/langs.inc.php b/langs.inc.php
index d4bbabb87..bc6ecc07b 100644
--- a/langs.inc.php
+++ b/langs.inc.php
@@ -148,22 +148,33 @@ S;
* @param boolean $ret return value?
*
* @return null|string
- *
- * FIXME Yes, it's terribly wrong/evil to rely on an unknown global $_t.
- * Solution? rethink the whole i18n thing in an integrated one.
*/
function _t($s = null, $opt = null, $post = ' ') {
return _d($s, $opt) . $post;
}
+/**
+ * @param string $s
+ * @param array $opt
+ *
+ * @return string
+ *
+ * FIXME Yes, it's terribly wrong/evil to rely on an unknown global $_t.
+ * Solution? rethink the whole i18n thing in an integrated one.
+*/
function _d($s = null, $opt = null) {
+ if ($s == '')
+ return null;
+
if (!is_null($opt))
$_t = $opt;
else {
global $_t;
}
- return trim(str_replace('{ok}', '', ($s == '' ? '---' : (array_key_exists($s, $_t) ? $_t[$s] : $s))));
+ $ret = array_key_exists($s, $_t) ? $_t[$s] : $s;
+
+ return trim(str_replace('{ok}', '', $ret));
}
/**