$v) { if(is_array($v)) stripslashes_recursively($array[$k]); else $array[$k] = stripslashes($v); } } /** * This is the main translator function. Returns the string defined by $class and $entity according to the currently set locale * * @param string $class Class where the entity was defined. It acts as a namespace. * @param string $entity Entity that identifies the string inside the namespace. * @param string $string The original string itself. In a usual call this is a mandatory parameter, but if you are reusing a string which * has already been "declared" (using another call to this function, with the same class and entity), you can omit it. * @param string $priority Optional parameter to set a translation priority. If a string is widely used, should have a high priority (PR_HIGH), * in this way translators will be able to prioritise this strings. If a string is rarely shown, you should use PR_LOW. * You can use PR_MEDIUM as well. Leaving this field blank will be interpretated as a "normal" priority (less than PR_MEDIUM). * @param string $context If the string can be difficult to translate by any reason, you can help translators with some more info using this param * * @return string The translated string, according to the currently set locale {@link i18n::setLocale()} */ function _($class, $entity, $string = "", $priority = 40, $context = "") { global $lang; $locale = i18n::getLocale(); $class = ereg_replace('.*([/\\]+)', "", $class); if(substr($class, -4) == '.php') $class = substr($class, 0, -4); if(isset($lang[$locale][$class]) == false) i18n::includeByClass($class); $transEntity = $lang[i18n::getLocale()][$class][$entity]; return (is_array($transEntity) ? $transEntity[0] : $transEntity); } ?>