vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Translate Your Pages Via Google (https://vborg.vbsupport.ru/showthread.php?t=88508)

AN-net 02-28-2004 09:22 PM

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>

AN-net 02-28-2004 09:24 PM

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;)

AN-net 02-28-2004 09:36 PM

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;)

AN-net 02-28-2004 10:17 PM

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.

Natch 03-04-2004 12:09 AM

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 ?

Natch 03-04-2004 10:24 AM

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 ...

Mr. Brian 04-01-2004 04:46 PM

Sweet!

lange2 04-03-2004 12:22 PM

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?

Bryan Ex 09-18-2004 03:10 PM

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.

58sniper 10-02-2004 01:16 PM

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/>



All times are GMT. The time now is 02:45 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.03418 seconds
  • Memory Usage 1,756KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (12)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete