| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Document |
JDocument |
setLang |
setLang() |
Never | Work in Progress |
Sets the global document language declaration. The default is English.
void setLang ( $lang )
| $lang | string | is a string containing the new language of the document. This parameter is optional and if omitted defaults to ‘en-GB‘. |
Set the language of the current document.
Example
global $mainframe; $document =& JFactory::getDocument(); $document->setLang( 'en-US' ); echo "Language: " . $document->getLang();
Might produce:
Result
Language: en-US