diff options
author | mattpiwik <matthieu.aubry@gmail.com> | 2010-03-17 20:30:45 +0300 |
---|---|---|
committer | mattpiwik <matthieu.aubry@gmail.com> | 2010-03-17 20:30:45 +0300 |
commit | 5606e47b7eac2c343d006fcb240cd87fd92d6501 (patch) | |
tree | cdc280ef9fdf4520a9e147ca37b35614d160be2c /core/SmartyPlugins | |
parent | 6dad219f14061660a53aae4f86faf1ec24c5187c (diff) |
Fixes #1068 added i18n in all existing Goal plugin strings & js strings
updated documentation to explain how to translate JS strings in plugins + how to reload a widget in dashboard (this will be available in http://dev.piwik.org/trac/wiki/Plugins/GlobalFunctions after the release)
git-svn-id: http://dev.piwik.org/svn/trunk@1929 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/SmartyPlugins')
-rw-r--r-- | core/SmartyPlugins/modifier.translate.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/core/SmartyPlugins/modifier.translate.php b/core/SmartyPlugins/modifier.translate.php index 3c3a7346cc..09a2ecdf89 100644 --- a/core/SmartyPlugins/modifier.translate.php +++ b/core/SmartyPlugins/modifier.translate.php @@ -11,13 +11,19 @@ */ /** - * Read the translation string from the given index (read form the selected language in Piwik). - * The translations strings are located either in /lang/xx.php or within the plugin lang directory. + * Translates in the currently selected language the specified translation $stringToken + * Translations strings are located either in /lang/xx.php or within the plugin lang directory. * - * Example: + * Usage: * {'General_Unknown'|translate} will be translated as 'Unknown' (see the entry in /lang/en.php) * - * @return string The translated string + * Usage with multiple substrings to be replaced in the translation string: + * - in lang/en.php you would find: + * 'VisitorInterest_BetweenXYMinutes' => '%1s-%2s min', + * - in the smarty template you would then translate the string, passing the two parameters: + * {'VisitorInterest_BetweenXYMinutes'|translate:$min:$max} + * + * @return string The translated string, with optional substrings parameters replaced */ function smarty_modifier_translate($stringToken) { |