Difference between revisions of "JText/script"
From Joomla! Documentation
< API15:JText
(New page: ===Description===
Translate a string into the current language and stores it in the JavaScript language store.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[De...) |
m (removing red link to edit, no existant pages) |
||
Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Syntax=== | ===Syntax=== | ||
Line 52: | Line 52: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
− | <nowiki>[< | + | <nowiki>[<! removed edit link to red link >]</nowiki> |
</span> | </span> | ||
− | + | <! removed transcluded page call, red link never existed > | |
===Examples=== | ===Examples=== | ||
Line 67: | Line 67: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
+ | [[Category:Archived pages API15]] |
Revision as of 13:55, 12 May 2013
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Translate a string into the current language and stores it in the JavaScript language store.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
static script($string=null)
Parameter Name | Default Value | Description |
---|---|---|
$string | null | $string The key. |
Returns[edit]
void
Defined in[edit]
libraries/joomla/methods.php
Importing[edit]
jimport( 'joomla.methods' );
Source Body[edit]
public static function script($string = null)
{
static $strings;
// Instante the array if necessary.
if (!is_array($strings)) {
$strings = array();
}
// Add the string to the array if not null.
if ($string !== null) {
// Normalize the key and translate the string.
$strings[strtoupper($string)] = JFactory::getLanguage()->_($string);
}
return $strings;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
<CodeExamplesForm />