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 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:
$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';

if(isset($xlanguage_langs[$myLang])) {
$lang $xlanguage_langs[$myLang];
$patterns[] = '/([([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])('.$mid_pattern.')([/([^]]*|)?'.preg_quote($lang).'(|[^]]*)?])/isU';
$replaces[] = '$4';

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

  • cerbero

  • Not too shy to talk

  • Posts: 191

  • Since: 2003/9/11


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


Who's Online

161 user(s) are online (32 user(s) are browsing Support Forums)

Members: 0

Guests: 161



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

Latest GitHub Commits