Module: nagvis Branch: master Commit: 7ce5182fc2e603667d2e5d7f70cf7bedbee83d8d URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=7ce5182fc2e603667d2e5d7f70cf7bedbee83d8d
Author: Lars Michelsen <[email protected]> Date: Tue May 4 22:54:39 2010 +0200 Fixed language cache; Is only used when the translations string does not use any macro --- share/server/core/classes/GlobalLanguage.php | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/share/server/core/classes/GlobalLanguage.php b/share/server/core/classes/GlobalLanguage.php index 16ad115..98bc419 100644 --- a/share/server/core/classes/GlobalLanguage.php +++ b/share/server/core/classes/GlobalLanguage.php @@ -244,21 +244,22 @@ class GlobalLanguage { * @return String Localized String * @author Lars Michelsen <[email protected]> */ - public function getText($id, $replace = NULL) { + public function getText($id, $replace = null) { // Use cache if available - if(isset($this->cache[$id])) + // FIXME: At the moment the cache can only be used without macros + if($replace === null && isset($this->cache[$id])) return $this->cache[$id]; $ret = $this->getTextOfId($id); - if($replace !== NULL) { + if($replace !== null) { $ret = $this->getReplacedString($ret, $replace); } // When the translated string is equal to the requested id and some macros // should be replaced it is possible that there is a problem with the // gettext/translation mechanism. Then append the imploded - if($id === $ret && $replace !== NULL) { + if($id === $ret && $replace !== null) { if(!is_array($replace)) { $ret .= 'Opts: '.$replace; } else { @@ -269,7 +270,7 @@ class GlobalLanguage { } // Store in cache for this page processing - if(!isset($this->cache[$id])) + if($replace === null && !isset($this->cache[$id])) $this->cache[$id] = $ret; return $ret; ------------------------------------------------------------------------------ _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
