JText::_
Translates a string into the current language.
Examples: <script>alert(Joomla.JText._('<?php echo JText::_("JDEFAULT", array("script"=>true));?>'));</script> will generate an alert message containing 'Default' <?php echo JText::_("JDEFAULT");?> it will generate a 'Default' string
Signature
public function _(string
$string,
[mixed
$jsSafe = false,
[boolean
$interpretBackSlashes = true,
[boolean
$script = false]]] )
Parameters
-
$string
- The string to translate.
-
$jsSafe
- Boolean: Make the result javascript safe.
-
$interpretBackSlashes
- To interpret backslashes (\\=\, \n=carriage return, \t=tabulation)
-
$script
- To indicate that the string will be push in the javascript language store
Returns
- string
- The translated string or the key is $script is true