0

How do I get the default language in the site frontend of Joomla 2.5?

canolucas
  • 1,482
  • 1
  • 15
  • 32
Mohammed Nagoor
  • 884
  • 2
  • 12
  • 25

3 Answers3

9

After hours of reading through web and sources, I found this would be the correct answer:

JComponentHelper::getParams('com_languages')->get('site')
tishma
  • 1,855
  • 1
  • 21
  • 43
1

Try this

$lang =& JFactory::getLanguage();
echo 'Current language is: ' . $lang->getName();

http://docs.joomla.org/JFactory/getLanguage

For more details Click here

Community
  • 1
  • 1
Jobin
  • 8,238
  • 1
  • 33
  • 52
1

To get the users language on Joomla 3 you can do

JFactory::getUser()->getParam('language', JFactory::getLanguage()->getTag());
Laoneo
  • 1,546
  • 1
  • 18
  • 25