21
Dannomite82
Re: xlanguage in xoops 2.4
  • 2010/10/22 13:48

  • Dannomite82

  • Just popping in

  • Posts: 2

  • Since: 2010/10/22


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

22
cerbero
Re: xlanguage in xoops 2.4
  • 2011/10/19 10:52

  • cerbero

  • Not too shy to talk

  • Posts: 191

  • Since: 2003/9/11


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

Login

Who's Online

182 user(s) are online (37 user(s) are browsing Support Forums)


Members: 0


Guests: 182


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits