mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
mlanthaler: Bugfix: Invalid code caused an parse error.
(merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41834 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fc26c64f63
commit
3444cf28e8
@ -97,13 +97,19 @@ function stripslashes_recursively(&$array) {
|
||||
*
|
||||
* @return string The translated string, according to the currently set locale {@link i18n::setLocale()}
|
||||
*/
|
||||
function _($class, $entity, $string="", $priority=40, $context="") {
|
||||
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])) i18n::includeByClass($class);
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user