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

Reply
 
Thread Tools
Translate Your Pages Via Google Details »»
Translate Your Pages Via Google
Version: 1.00, by AN-net AN-net is offline
Developer Last Online: Jan 2010 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-21-2004 Last Update: Never Installs: 8
 
No support by the author.

Description:
Instantly translate all vb pages that include a footer from English to german,french,italian,and spanish.

Authors:
Sweet22 and Antonbomb22

Credits:
To google for its translation service

Tested only on Vb3 Rc3 and Rc4. There may have been code changes since betas and gamma to the templates that need to be edited by this hack. If you experience difference in code please post it and ill tell you what to do

**PLZ NOTE THAT WHEN TRANSLATING IT LOGS YOU OUT AND YOU CAN NOT LOG IN ON A TRANSLATED PAGE!** I hope to fix this issue sometime in the future, if anyone has a fix or suggestion on how to fix it is welcome.

Show Your Support

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

Comments
  #12  
Old 02-28-2004, 09:22 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here are other translations not included in the instruct file:
To translate german to english add this code after the last </option> tag in your footer:
Code:
<option value="de|en" selected>German to English</option>
If you want to translate from German to French then add this code after the last </option> tag in your footer:
Code:
<option value="de|fr">German to French</option>
if you want to translate from spanish to english then add this code after your last </option tag in your footer:
Code:
<option value="es|en">Spanish to English</option>
if you want to translate from french to english then add this code after your last </option> tag in your footer:
Code:
<option value="fr|en">French to English</option>
if you want to translate from french to german then add this after your last </option tag in your footer:
Code:
<option value="fr|de">French to German</option>
if you want to translate from italian to english then add this code after your last </option> tag in your footer:
Code:
<option value="it|en">Italian to English</option>
if you want to translate from portuguese to english then add this code after your last </option> tag in your footer:
Code:
<option value="pt|en">Portuguese to English</option></select>
Reply With Quote
  #13  
Old 02-28-2004, 09:24 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by uber
Great mod Sweet!

I've integrated your code into a drop down menu on my showthread template.

While doing this, I noticed that there's a little bug you code. Even on your site, when you translate the the site from the showthread or forumdisplay template, the threadid and forumid variables aren't passed.

if you change this

<input type="hidden"name="u" value="http://www.yoursite.com$translationurl">

to

<input type="hidden"name="u" value="http://www.yoursite.com$translationurl?t=$threadid&f=$for uminfo[forumid]">

when you click the translation link from either pages, it will get the proper variables.

Clicks install
thanks for fixing that, in a lil bit ill make an addon for showthread so if the file is showthread.php it will add that on
Reply With Quote
  #14  
Old 02-28-2004, 09:36 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

credit:
uber

find in footer:
Code:
<input type="hidden"name="u" value="http://www.animationation.net$translationurl">
replace with(change /community/ to what ever folder your forums are under, if forums are in the public_html folder remove /community/ completely!):
Code:
<input type="hidden"name="u" <if condition="$translationurl=='/community/showthread.php'">value="http://www.animationation.net$translationurl?t=$threadid&f=$foruminfo[forumid]"<else />value="http://www.animationation.net$translationurl"</if>>
ta da it will translate all your threads
Reply With Quote
  #15  
Old 02-28-2004, 10:17 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok since there are several files that require variables i will not support problems with translating beyond index.php for now. when i release version 2 of this hack i will most likely have every .php in the forum root folder with condition until then i will not support problems with translation other than index.php.
Reply With Quote
  #16  
Old 03-04-2004, 12:09 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't you just make a phpinclude hack to make new vars for the scriptname and stringvars globals, and then use those in your translationurl ?
Reply With Quote
  #17  
Old 03-04-2004, 10:24 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Like this eg:

Change php_include to match this:
Code:
$translationurl=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];

This will pass all query strings to the translator ...
Reply With Quote
  #18  
Old 04-01-2004, 05:46 PM
Mr. Brian's Avatar
Mr. Brian Mr. Brian is offline
 
Join Date: Jan 2003
Location: Internet
Posts: 300
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet!
Reply With Quote
  #19  
Old 04-03-2004, 01:22 PM
lange2 lange2 is offline
 
Join Date: Jan 2004
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sweet22
**PLZ NOTE THAT WHEN TRANSLATING IT LOGS YOU OUT AND YOU CAN NOT LOG IN ON A TRANSLATED PAGE!** I hope to fix this issue sometime in the future, if anyone has a fix or suggestion on how to fix it is welcome.
How Can I Fix the Problem? Any fix available?
Reply With Quote
  #20  
Old 09-18-2004, 04:10 PM
Bryan Ex's Avatar
Bryan Ex Bryan Ex is offline
 
Join Date: Feb 2004
Location: Canada
Posts: 233
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks very much for your efforts on this as it's very much needed on my board. As far as the log out problem goes, just hitting the "Back" button brings you back to a logged in page so not that big of a deal for me. A bigger problem is that it only works on pages available for guests otherwise they get a nicely translated "No permissions" page...lol Google uses frames for the translation which I suspect is part of the problem but there must be a way to pass either cookie or session info to their main frame window. I'm experimenting with it now but not overly hopeful I'll be able to figure it out. This is a good addition to my site but so close to being an excellent one.
Reply With Quote
  #21  
Old 10-02-2004, 02:16 PM
58sniper 58sniper is offline
 
Join Date: Sep 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Natch
Like this eg:

Change php_include to match this:
Code:
$translationurl=$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];

This will pass all query strings to the translator ...
I'll make this even easier....

PHP Code:
$translationurl $_SERVER['REQUEST_URI']; 
Will get you everything. And, change
HTML Code:
<input type="hidden"name="u" value="http://www.yoursite.com$translationurl">
to
HTML Code:
<input type="hidden" name="u" value="$vboptions[homeurl]$translationurl" />
to make this totally plug and play. Here is the template part that I use, which is 100% valid XHTML:

Code:
<div align="center">
Translate this page:<br />
<form action="http://translate.google.com/translate" method="post">
<input type="hidden" name="u" value="$vboptions[bburl]$translationurl" />
<select name="langpair" onchange="this.form.submit();">
<option value="en|de">English to German</option>
<option value="en|es">English to Spanish</option>
<option value="en|fr">English to French</option>
<option value="en|it">English to Italian</option>
<option value="en|pt">English to Portuguese</option>
</select>
<input type="hidden" name="hl" value="en" />
<input type="hidden" name="ie" value="UTF-8" />
<input type="hidden" name="oe" value="UTF-8" />
<input type="hidden" name="safe" value="active" />
<input type="hidden" name="prev" value="/language_tools" />
<input type="submit" value="Translate" />
</form>
</div>
<br/>
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 02:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06340 seconds
  • Memory Usage 2,326KB
  • 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
  • (12)bbcode_code
  • (2)bbcode_html
  • (1)bbcode_php
  • (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
  • (3)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_onlinestatus
  • (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
  • postbit_imicons
  • 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