API15

JLanguage/setLanguage

From Joomla! Documentation

< API15:JLanguage
Revision as of 13:34, 12 May 2013 by JoomlaWikiBot (talk | contribs) (removing red link to edit, no existant pages)

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]

Set the language attributes to the given language

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax[edit]

setLanguage($lang)
Parameter Name Default Value Description
$lang $lang Language code

Returns[edit]

string Previous value

Defined in[edit]

libraries/joomla/language/language.php

Importing[edit]

jimport( 'joomla.language.language' );

Source Body[edit]

function setLanguage($lang)
{
        $previous                       = $this->_lang;
        $this->_lang            = $lang;
        $this->_metadata        = $this->getMetadata($this->_lang);

        //set locale based on the language tag
        //TODO : add function to display locale setting in configuration
        $locale = setlocale(LC_TIME, $this->getLocale());
        return $previous;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples[edit]

<CodeExamplesForm />