Last active
September 24, 2015 13:31
-
-
Save fschell/29e5ce36edd2fc4e400c to your computer and use it in GitHub Desktop.
Joomla get Language
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get language | |
$lang = JFactory::getLanguage()->getLocale()[4]; | |
if ($lang === 'en') { | |
... | |
} | |
//----------------------------------------------------------------------------------- | |
// inject it into javascript global namespace (e.g. in joomla template index.php) | |
<script> | |
window.myLang = '<?php echo JFactory::getLanguage()->getLocale()[4]; ?>'; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment