21
My problem thus far is in getting the module to recognize the language variable in the URL that the block generates. It always defaults to the system language. (I did a few echo tests to confirm this)
Running in debug mode and haven't noticed anything out of the ordinary. As for the version of PHP, pretty sure it's 4.
Any thoughts on this?
On a related note, how exactly is the language variable (say
http://www.mysite.com/modules/mycontentmod/index.php?lang=french) passed to the module?
EDIT: I should note that I'm using the newest version of Xoops and the 3.11 version of the module.
EDIT 2: It appears as though the variable $xoopsconfig["language"] is being used to determine which language is used, and that the variable is stuck on the default system language regardless of the value of index.php?lang=yourlanghere.
EDIT 3: Problem solved.
In the functions.php file's xlanguage_ml function, I added:
include_once(XOOPS_ROOT_PATH.'/modules/xlanguage/include/vars.php');
$myLang = $xlanguage["lang"];
and replaced
if(isset($xlanguage_langs[$xoopsConfig['language']])) {
$lang = $xlanguage_langs[$xoopsConfig['language']];
$patterns[] = '/([([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])('.$mid_pattern.')([/([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])/isU';
$replaces[] = '$4';
}
with
if(isset($xlanguage_langs[$myLang])) {
$lang = $xlanguage_langs[$myLang];
$patterns[] = '/([([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])('.$mid_pattern.')([/([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])/isU';
$replaces[] = '$4';
}