views:

201

answers:

1

I have some code that sets the lang var to the site default language.

$lg = &JFactory::getLanguage();
$lg = explode('-',$lg->_default);
$dlg = $lg[0];
if(!JRequest::getWord('lang', false ))
    JRequest::setVar('lang', $dlg );

however before setting it to $dlg I would like to find out if the language is stored in the user information or session.

Can someone tell me how to check the session for language information?

A: 
$lg = &JFactory::getLanguage();
$lg = explode('-',$lg->_lang);
$dlg = $lg[0];
if(!JRequest::getWord('lang', false ))
    JRequest::setVar('lang', $dlg );

i had to just change it from _default to _lang

Moak