diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2009-03-25 10:31:55 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2009-03-25 10:31:55 +0300 |
commit | 9e8bff44a6b66c75cbdfba54c0ded9c7a4557399 (patch) | |
tree | 16bdbb84be61b06825e9a09d03d860eb5d387392 /core | |
parent | a6fcc10eb3c5b45db674d82202e498e18a832c97 (diff) |
- fixes "%s conversions" bug in Goals plugin.
git-svn-id: http://dev.piwik.org/svn/trunk@1023 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core')
-rw-r--r-- | core/Translate.php | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/core/Translate.php b/core/Translate.php index be3f06531f..48b53029c6 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -141,25 +141,21 @@ class Piwik_Translate } } -function Piwik_Translate($index, $args = array()) +function Piwik_Translate($string, $args = array()) { if(!is_array($args)) { $args = array($args); } - if(isset($GLOBALS['Piwik_translations'][$index])) + if(isset($GLOBALS['Piwik_translations'][$string])) { - $string = $GLOBALS['Piwik_translations'][$index]; - if(count($args) == 0) - { - return $string; - } - else - { - return vsprintf($string, $args); - } + $string = $GLOBALS['Piwik_translations'][$string]; + } + if(count($args) == 0) + { + return $string; } - throw new Exception("Translation string '$index' not available."); + return vsprintf($string, $args); } |