mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-29 20:59:23 +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
@ -101,9 +101,15 @@ 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);
|
||||
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