xoops forums

Dannomite82

Just popping in
Posted on: 2010/10/22 13:48
Dannomite82
Dannomite82 (Show more)
Just popping in
Posts: 2
Since: 2010/10/22
#21

Re: xlanguage in xoops 2.4

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 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';
}

cerbero

Not too shy to talk
Posted on: 2011/10/19 10:52
cerbero
cerbero (Show more)
Not too shy to talk
Posts: 191
Since: 2003/9/11
#22

Re: xlanguage in xoops 2.4

Quote:

vadimv82 wrote:


Got this error message:
Undefined variable: xoopsConfig in file /modules/xlanguage/api.php line 62

Fixed by adding global $xoopsConfig; to api.php

Works now.


Could you be more explicit? i have same trouble and dont know how can i solve,
thanks in advance