diff options
author | robocoder <anthon.pang@gmail.com> | 2012-03-24 16:05:43 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2012-03-24 16:05:43 +0400 |
commit | fa624633448872e4eb78eea20341989b665eef28 (patch) | |
tree | d324a11ae375b965e44b7f678c6973a3ee5a82da /core/Translate.php | |
parent | 02988881ccd8d99073f243f825fba64ca9890af6 (diff) |
refs #1713 - tracker config did not previously throw exceptions (BC); revert [6107] and part of [6103]
git-svn-id: http://dev.piwik.org/svn/trunk@6111 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Translate.php')
-rw-r--r-- | core/Translate.php | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/core/Translate.php b/core/Translate.php index 05a08a4b92..f3ded9695e 100644 --- a/core/Translate.php +++ b/core/Translate.php @@ -213,26 +213,22 @@ function Piwik_Translate($string, $args = array()) return vsprintf($string, $args); } -// this statement is needed for an unknown reason, for the test tests/core/Piwik/jsProxy.test.php to pass -if(!function_exists('Piwik_TranslateException')) +/** + * 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()) { - /** - * 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()) + try { - try - { - return Piwik_Translate($message, $args); - } - catch(Exception $e) - { - return $message; - } + return Piwik_Translate($message, $args); + } + catch(Exception $e) + { + return $message; } -}
\ No newline at end of file +} |