Welcome, Guest. Please Login or Register.
May 01, 2025, 03:13:37 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Trying to make a multi-lingual mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Trying to make a multi-lingual mod  (Read 459 times)
luisr
Full Member
***
Posts: 120


Left blank to save space.

Trying to make a multi-lingual mod
« on: April 14, 2002, 06:24:46 PM »
Reply with quote

Back in the old days of YaBB 1 Gold SP1 (a mere week ago) my board was capable of using a different language pack based on the location of the user within the web site.

You see, my site is bilingual (Spanish/English) and I want to make it so as much as possible, including the message board.  With YaBB 1 Gold I made a simple modification in YaBB.cgi that looked like this:

&LoadCookie;     # Load the user's cookie (or set to guest)

if(defined $yyCookies{'YaBBLanguage'})
 {
  $language = $yyCookies{'YaBBLanguage'}.".lng";
 }

require "$language";

This was inserted right before &LoadUserSettings close to the beginning of the script.  Also in Load.pl I commented out this line: require "$boarddir/$language";

How this worked?  Well, the web site has a framed environment and the board runs within a frame.  Whenever the user clicks on the link to go to the board, a pre-loader page is loaded first to handle some internal navigational issues, sets a non-persistent cookie called "YaBBLanguage" with the language stored in it and then calls the board.  When the board loads, it looks for this cookie.  If found then it will use the specified language pack.  If not, then it will load whichever language is default from the board configuration.  Works pretty cool.

The web site has the same content in both languages and at the home page there are links to select the language.  From there the user goes to whatever page he/she wants to see in the selected language, including the message board.

The above code is in Perl.  I am not very familiar with PHP but looking at the same places in index.php and Load.php I guessed that it worked the same way and inserted the same modification but it didn't work.  It still loads the same language as before.  The modified code is like this:

if(isset($HTTP_COOKIE_VARS['YaBBLanguage'])
 {
  $language = $HTTP_COOKIE_VARS'].lng";
 }

include_once "$boarddir/$language";

This was inserted between the load user settings and banning sections of index.php.  I also commented out the same line as before in Load.php.

Another variation I tried was this:

if(isset($yabbLang))
 {
  $language = "$yabbLang.lng";
 }

include_once ("$boarddir/$language");

And added this line to the LoadCookie function in Load.php:

$yabbLang = $HTTP_COOKIE_VARS['YaBBLanguage'];

Didn't work either.

Suggestions?

My board is in http://www.juanadiaz.org/foro/
Logged
luisr
Full Member
***
Posts: 120


Left blank to save space.

Re:Trying to make a multi-lingual mod
« Reply #1 on: April 16, 2002, 08:39:13 PM »
Reply with quote

Anyone???
Logged
John R
PHP Challenged
Global Moderator
Sr. Member
*****
Posts: 387


Click, Click, Click, Bang!

ICQ - 3166233codehammer@thevortex.com
Re:Trying to make a multi-lingual mod
« Reply #2 on: April 17, 2002, 01:07:35 AM »
Reply with quote

SE 1.3 is already multi-lingual.  Members of your board can select the language they wish to use in their user profile and you can select the default language for the board in your admin center.

cheers........
Logged

Be careful what you wish for, it might come true!

Note: I do not acknowledge support requests via PM, MSN or ICQ, please use the support boards.
luisr
Full Member
***
Posts: 120


Left blank to save space.

Re:Trying to make a multi-lingual mod
« Reply #3 on: April 17, 2002, 01:09:49 AM »
Reply with quote

I know that.  It's the default language for guests what I want to change based on which language they chose on the web site.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Trying to make a multi-lingual mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.028 seconds with 16 queries.