JText::plural
Like JText::sprintf but tries to pluralise the string.
Note that this method can take a mixed number of arguments as for the sprintf function. The last argument can take an array of options: array('jsSafe'=>boolean, 'interpretBackSlashes'=>boolean, 'script'=>boolean) where: jsSafe is a boolean to generate a javascript safe strings. interpretBackSlashes is a boolean to interpret backslashes \\->\, \n->new line, \t->tabulation. script is a boolean to indicate that the string will be push in the javascript language store. Examples: <script>alert(Joomla.JText._('<?php echo JText::plural("COM_PLUGINS_N_ITEMS_UNPUBLISHED", 1, array("script"=>true));?>'));</script> will generate an alert message containing '1 plugin successfully disabled' <?php echo JText::plural("COM_PLUGINS_N_ITEMS_UNPUBLISHED", 1);?> it will generate a '1 plugin successfully disabled' string
Signature
public function plural(string
$string,
integer
$n )
Parameters
-
$string
- The format string.
-
$n
- The number of items
Returns
- string
- The translated strings or the key if 'script' is true in the array of options