[TYPO3-english] Get language code

Bernhard Schenkenfelder bernhard at schenkenfelder.co.at
Thu Jan 15 07:51:20 CET 2015


As far as I know, there are two ways to retrieve the current (front-end) language:

$GLOBALS['TSFE']->config['config']['language']
$GLOBALS['TSFE']->sys_language_uid

If the latter is 2, then the config value is, say, 'dk'. However, if the language UID is 0, then the first variable returns '' (empty string).

Is there a mapping between sys_language_uid and the language code, or in other words, where/how can I find the default language (code)?


More information about the TYPO3-english mailing list