","major",""); # # deprecated usage: # print __("%s has %s apples.", array("Bill", "5")); include_once("common_po.inc"); function __() { global $_t; global $LANG; # create the translation, if it doesn't exist, highlight it # $args = func_get_args(); # First argument is always string to be translated $tag = $args[0]; $translated = $_t[$LANG][$tag]; if (empty($translated)) { # if it's a supported language, but there isn't a translation, # alert the visitor to the missing translation. # $translated = "_${tag}_"; } # 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 if ( $num_args > 1 ) { for ($i = 1; $i < $num_args; $i++) { $translated = preg_replace("/\%[sh]/", $args[$i], $translated, 1); } } return $translated; } # vim: ts=2 sw=2 noet ft=php ?>