Table of Contents

setLang

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Document Class JDocument Method setLang Reference setLang() Never Work in Progress

Sets the global document language declaration. The default is English.

Syntax

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‘.

Examples

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