Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-14-2000 Last Update: Never Installs: 0
 
No support by the author.

Oh it's a hack but it works. Suport multiple languages with one template set. Put links on your page that when clicked chance all the vB text like username, pwd, etc to spanish, german etc. Uses dictionary libraries that get importated by the PHP scripts. Goign live tonite on my site. Reply here if you are curious.

J

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 09-08-2000, 08:31 AM
Guest
 
Posts: n/a
Default

Well...

The standard language hack is probably already explained in the messages above, so unless you have a question about it, I won't elaborate on that...

The forumjump template is different because it's evaluation code can be found in a function. PHP functions don't know the content of variables declared outside the function (in this case the variables that are loaded from the language files...)

Solution... You must include the variables that you use in the forumjump template as global in the beginning of that function.

In my particular case this means adding following rule to the declaration of variables in the makeforum() function of global.php
global $bobexforumjump,$bobexgobutton,$bobexselectone;

When it comes to remembering the language without cookies, this is a little harder. I first implemented this by adding a language field to the user-table so that when cookies were disabled, It could read the default language for that user. However, without cookies, vBulletin doesn't keep you logged-in all the time, and you loose your language variable again.

This leaves only passing the language variable everywhere through the URL. However, I haven't implemented that yet, and probably won't since it means changing links in virtually every template.

If you have any more questions, just ask!

Greetings

stcham
Reply With Quote
  #13  
Old 09-08-2000, 08:54 AM
Guest
 
Posts: n/a
Default

Did I miss something? I don't see the hack.

I see talk about it. Are there any language files I need plus instructions on how to use this?
Reply With Quote
  #14  
Old 09-08-2000, 09:33 AM
Guest
 
Posts: n/a
Default

I don't see the problem actually?

On top of your page you set a couple of links that will set a cookievariable language based on the link that is pressed. (for instance... you set the language cookie to 'Fra' if the link 'French' is clicked)

In global.php you set something like:

if (!(isset($language)))
$language = "Eng";

if ($language == "Eng") include ("English.php");
if ($language == "Ned") include ("Dutch.php");
if ($language == "Fra") include ("French.php");

Then you make the language files you want... For instance (a very short version of) english.php might look like:

<?php
$bobexthread = "Thread";
$bobexbulletinpower = "powered by vBulletin";
$bobexalltimes = "All times are ";
$bobexselectlanguage = "Select a language";
$bobexcontactusmesssage = "Contact Us";
$bobexgobutton = "Go";
$bobexfdpostnewthread = "Post New Thread";
$bobexforumrules = "Forum Rules";
$bobexadminoptions = "Admin Options";
$bobexregistered = "Registered";
$bobexpoststitle = "Posts";
?>

In short: include a variable for every piece of textual information that is present in the templates. The reason bobex is in front of all the variables is that you definitely want to make sure you have unique variable names that aren't used somewhere else in the code (and bobex is the name of the company I'm adjusting vbulletin for)

You make a language file for every language defining the same variables but assigning different values to it (obviously)

Then in your templates, you change the string "Forum Rules" by "$bobexforumrules" and you're done.

Well.. Mostly that is, because, as I already mentioned, some templates give troubles (forumjump for instance)

All clear now?

stcham
Reply With Quote
  #15  
Old 09-08-2000, 10:08 AM
Guest
 
Posts: n/a
Default

ok....I was hoping someone had already done the language files. I do not know any other language besides English. Maybe a little Spanish.

Can I have your language files?
Reply With Quote
  #16  
Old 09-08-2000, 10:32 AM
Guest
 
Posts: n/a
Default

Well...

My language files aren't done yet. It's a hell of a lot of work

Also, my language files are not exact translations of the original site, since some things were changed (for instance: the faq contains different answers for our site than for the standard vbulletin)

If you are still interested, I don't see why not (when they're ready)

Remember that you'll have to adjust all your templates to work with my variables...

Let me know.

stcham
Reply With Quote
  #17  
Old 09-10-2000, 10:30 AM
Guest
 
Posts: n/a
Default

When I try to change the language to Italian on Big Soccer, I keep getting the following error:

Warning: Cannot add header information - headers already sent by (output started at italian.php:88) in global.php on line 753

The hack looks cool - I like to bug John, so lets request that he add this to a future version. He would only have to do the translation once and it would be good to go. Maybe this would even fit in with the "Skins" idea that had been floating around...
Reply With Quote
  #18  
Old 09-13-2000, 04:15 AM
Guest
 
Posts: n/a
Default

Quote:
Originally posted by VirtueTech
Can I have your language files?
Ok. My language files (english/dutch) are finished. So is french (but that one needs serious correcting so it's not really ready )

If you still want them, I'll post them, however the templates need a LOT of work. On top of that, most PHP files need to be edited. The hack seems extremely easy, and indeed, it's not that hard, but you need to add globals on many different places in order for your variables to be recognised.

Also, some templates are just inserted without being evaluated through PHP. For instance, most error_templates contain only text. Since they don't contain variables, it's not necessary to evaluate them. However, if you use multilangsupport, you introduce variables, and therefore you DO need to evaluate them...

To be more exact, you need to replace

echo standarderror($bbtitle,gettemplate("whatever",0));

in

eval("echo standarderror(\$bbtitle,\"".gettemplate("whatever" )."\",\"\");");

in a lot of different places. I hope I'm making myself a little clear?

If that's not a problem for you, the languagefiles are yours.

Greetings,
stcham
Reply With Quote
  #19  
Old 09-13-2000, 08:56 AM
Guest
 
Posts: n/a
Default

Quote:
If you still want them, I'll post them, however the templates need a LOT of work.
Can I have a copy ?
Reply With Quote
  #20  
Old 09-13-2000, 08:58 AM
Guest
 
Posts: n/a
Default

Me too please
Reply With Quote
  #21  
Old 09-13-2000, 03:16 PM
Guest
 
Posts: n/a
Default

hmmm...what browser? i'll take a look...


Quote:
Originally posted by UserName
When I try to change the language to Italian on Big Soccer, I keep getting the following error:

Warning: Cannot add header information - headers already sent by (output started at italian.php:88) in global.php on line 753

The hack looks cool - I like to bug John, so lets request that he add this to a future version. He would only have to do the translation once and it would be good to go. Maybe this would even fit in with the "Skins" idea that had been floating around...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04968 seconds
  • Memory Usage 2,279KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete