From a9abe0e6ca2b786b026b0390e1535e402c663a80 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 10 Oct 2008 17:36:13 +0000 Subject: [PATCH] ENHANCEMENT Using $locale in _t() instead of repeatedly calling i18n::get_locale() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64078 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Core.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/Core.php b/core/Core.php index 064437e7f..35361e530 100755 --- a/core/Core.php +++ b/core/Core.php @@ -281,7 +281,7 @@ function stripslashes_recursively(&$array) { } /** - * This is the main translator function. Returns the string defined by $class and $entity according to the currently set locale + * This is the main translator function. Returns the string defined by $class and $entity according to the currently set locale. * * @param string $entity Entity that identifies the string. It must be in the form "Namespace.Entity" where Namespace will be usually * the class name where this string is used and Entity identifies the string inside the namespace. @@ -301,7 +301,7 @@ function _t($entity, $string = "", $priority = 40, $context = "") { $realEntity = array_pop($entityParts); $class = implode('.',$entityParts); if(!isset($lang[$locale][$class])) i18n::include_by_class($class); - $transEntity = isset($lang[i18n::get_locale()][$class][$realEntity]) ? $lang[i18n::get_locale()][$class][$realEntity] : $string; + $transEntity = isset($lang[$locale][$class][$realEntity]) ? $lang[$locale][$class][$realEntity] : $string; return (is_array($transEntity) ? $transEntity[0] : $transEntity); }