Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/SmartyPlugins/modifier.translate.php')
-rw-r--r--core/SmartyPlugins/modifier.translate.php14
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)
{