diff options
Diffstat (limited to 'core/Translate.php')
-rw-r--r-- | core/Translate.php | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/core/Translate.php b/core/Translate.php index f3ded9695e..05a08a4b92 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -213,22 +213,26 @@ function Piwik_Translate($string, $args = array()) return vsprintf($string, $args); } -/** - * Returns translated string or given message if translation is not found. - * This function does not throw any exception. Use it to translate exceptions. - * - * @param string $message Translation string index - * @param array $args sprintf arguments - * @return string - */ -function Piwik_TranslateException($message, $args = array()) +// this statement is needed for an unknown reason, for the test tests/core/Piwik/jsProxy.test.php to pass +if(!function_exists('Piwik_TranslateException')) { - try - { - return Piwik_Translate($message, $args); - } - catch(Exception $e) + /** + * Returns translated string or given message if translation is not found. + * This function does not throw any exception. Use it to translate exceptions. + * + * @param string $message Translation string index + * @param array $args sprintf arguments + * @return string + */ + function Piwik_TranslateException($message, $args = array()) { - return $message; + try + { + return Piwik_Translate($message, $args); + } + catch(Exception $e) + { + return $message; + } } -} +}
\ No newline at end of file |