From 06e400a2f0b59e41f333458a5e3acf67b0fd3f1c Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sat, 9 Jan 2010 00:47:39 -0500 Subject: translator.inc: Remove old and deprecated code. Signed-off-by: Loui Chang --- web/lib/translator.inc | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'web') diff --git a/web/lib/translator.inc b/web/lib/translator.inc index 6d963f5..650f796 100644 --- a/web/lib/translator.inc +++ b/web/lib/translator.inc @@ -1,8 +1,7 @@ ","major",""); -# -# deprecated usage: -# print __("%s has %s apples.", array("Bill", "5")); +# print __("This is a %hmajor%h problem!", "", ""); include_once('config.inc'); global $_t; -function include_lang($trans) { - global $LANG; - - if ($LANG != DEFAULT_LANG) { - return include_once("$LANG/$trans"); - } - else - return true; -} - function __() { global $_t; global $LANG; @@ -63,16 +49,13 @@ function __() { $translated = htmlspecialchars($translated, ENT_QUOTES); - # This condition is to reorganise the arguments in case of - # deprecated usage. __("string", array("string","string")) - if (!empty($args[1]) && is_array($args[1])) { - array_unshift($args[1], $tag); - $args = $args[1]; - } - $num_args = sizeof($args); # Subsequent arguments are strings to be formatted + # + # TODO: make this more robust. + # '%%' should translate to a literal '%' + if ( $num_args > 1 ) { for ($i = 1; $i < $num_args; $i++) { $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1); -- cgit v1.2.3-54-g00ecf