Joomla problem: where does "$ mainframe-> getCfg ('lang') come from?
In Joomla:
$mainframe->getCfg('lang');
will return "english" (I think this is the default), can anyone tell me where to define it?
Can I change it?
This is what you configure in the language manager.
jlleblanc, thanks for your help. I think I find the problem: problem with language files, just change backwardLang
in metadata
, Here are the codes:
<metadata>
<name>Simplified Chinese</name>
<tag>zh-CN</tag>
<rtl>0</rtl>
<locale>zh_CN.utf8, zh, zho, zhi, zh_CN, zho_CN, zhi_CN, simplified_chinese</locale>
<winCodePage>cp936</winCodePage>
<backwardLang>simplified_chinese</backwardLang>
</metadata>
In Joomla! 1.5, go to Extensions> Language Manager. This list will show all the languages ββinstalled on your system, including the default ones (which you can install).
However, users can also select the language they want to use. Code $ mainframe-> getCfg ('lang'); will return the language selected by the user rather than the default.
Also, you should avoid using the $ mainframe object and instead retrieve the current language using JFactory:
$lang =& JFactory::getLanguage();
echo $lang->getName();