Page 1 of 1

detect current language of joomla using gtranslate

Posted: Mon May 17, 2010 4:52 am
by karwal1
Hello

I am using gtranslate for joomla site and i have to convert site in arabic .So for this m using gtranslate and when arabic is selected i want to use RTL css file.I tried $lang = &JFactory::getLanguage(); to detect current language but this is showing default language of joomla.If anybody can tell me solution to detect arabic language so that i can use rtl style sheet on that language that will be very helpfull,I m trying from 3 days but no solution found.Please please help me.

Thanks

Re: detect current language of joomla using gtranslate

Posted: Thu Nov 11, 2010 10:01 pm
by neryba
Try this!

$language = JRequest::getVar( 'lang', '', 'request', 'string');
if($language == '')
$language = ($_REQUEST[jfcookie][lang] == '')? 'pt':$_COOKIE[jfcookie][lang];

Re: detect current language of joomla using gtranslate

Posted: Fri Nov 12, 2010 4:16 am
by karwal1
Thanks for reply...but its too late..i got this solution before and completed two of templates...anyways thanks...

Re: detect current language of joomla using gtranslate

Posted: Thu Aug 11, 2016 6:17 am
by peaceandlove
Can any body help me where to put that code?

Re: detect current language of joomla using gtranslate

Posted: Thu Aug 11, 2016 6:27 am
by Per Yngve Berg
This is the Joomla 1.5 Forum. The code does not apply to newer versions.

Please post in the proper forum.