Page 1 of 1
How to get the language name like "english" or "dutch"/
Posted: Sun Sep 09, 2007 7:26 pm
by pvh123
In my current module, there is a scriptline to establish and include a language file.
It looks like this:
include("components/com_xemusicfx/language/".$mosConfig_lang.".php");
I thought by replacing it like this
include("components/com_xemusicfx/language/".JDocument::getLanguage().".php");
would get me the correct filename, like: english.php or dutch.php.
No such luck.
Anybody help me?
Re: How to get the language name like "english" or "dutch"/
Posted: Tue Sep 11, 2007 8:27 am
by pvh123
@mod
Can you move my post to the Translation forum because I think this is the worng place.
Many thanks
Re: How to get the language name like "english" or "dutch"/
Posted: Tue Sep 11, 2007 8:48 am
by pe7er
[Moved to Joomla! Coding 101]
Re: How to get the language name like "english" or "dutch"/
Posted: Tue Sep 11, 2007 10:56 am
by Pentacle
Hmm in the xml files there is a tag called
I don't know if there is a new way of doing this. But maybe, you can get it like this:
Code: Select all
$lang = & JFactory::getLanguage();
include("components/com_xemusicfx/language/".$lang->getBackwardLang();.".php");
P.S: I would prefer single quotes for the above line to reduce parsing time. 
Re: How to get the language name like "english" or "dutch"/
Posted: Tue Sep 11, 2007 4:02 pm
by pvh123
Thanks very much, that the trick.
I have done a lot of searching and just today started to look in the Framework and wanted to start of with: $lang = Jlanguage::getname();
But I was near , not near enough.
Re: How to get the language name like "english" or "dutch"/
Posted: Wed Sep 12, 2007 3:41 am
by matthewhayashida
MOD NOTE: Moving to Joombie Q/A