Manual:$wgLang

From MediaWiki.org
Jump to: navigation, search

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil

Details[edit]

The user language object is the language object selected in user preferences. It is one of two global language objects, the other being $wgContLangManual:$wgContLang. See the page Manual:LanguageManual:Language for more information.

$wgLang is initialized towards the end of setup; some hooks are called earlier than that and should avoid using it. When in doubt use $wgUser->isSafeToLoad() to check.

Often used Methods[edit]

This is not an exhaustive list, view class above to see a complete listing.

$wgLang->commaList( $list )
delimit a list of strings according to the conventions of the user's language
$wgLang->getCode()
return the user's language code, for example "en"