vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Mini Mods - Quick "Translate This Page" Link (https://vborg.vbsupport.ru/showthread.php?t=166360)

RWerksman 12-28-2007 10:00 PM

Quick "Translate This Page" Link
 
This modification adds a drop down box in the lower right corner of each page directly under the Forum Jump Box that is currently there. When a user selects an option from this box, they'll be forwarded on to a Google translation of the page at hand.

Please note that when viewing the translated version of this page, the user will not be logged in.

In the forumjump template, look for:

Code:

<br /><br />
and

Code:

</div>
Place the following code between the two entires:

Code:


<strong>Translate This Page<br />
<form action="http://translate.google.com/translate" method="post">
 <input type="hidden" name="u" value="http://YOURSITE.COM/$scriptpath" />
 <select name="langpair" onchange="this.form.submit();">
  <option value="en|de">English to German</option>
  <option value="en|nl">English to Dutch</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>
  <option value="en|ko">English to Korean</option>
  <option value="en|ja">English to Japanese</option>
  <option value="en|ar">English to Arabic</option>
  <option value="de|en">German to English</option>
  <option value="de|nl">German to Dutch</option>
  <option value="de|es">German to Spanish</option>
  <option value="de|fr">German to French</option>
  <option value="de|it">German to Italian</option>
  <option value="de|pt">German to Portuguese</option>
  <option value="de|ko">German to Korean</option>
  <option value="de|ja">German to Japanese</option>
  <option value="de|ar">German to Arabic</option>
  <option value="nl|en">Dutch to English</option>
  <option value="nl|de">Dutch to German</option>
  <option value="nl|es">Dutch to Spanish</option>
  <option value="nl|fr">Dutch to French</option>
  <option value="nl|it">Dutch to Italian</option>
  <option value="nl|pt">Dutch to Portuguese</option>
  <option value="nl|ko">Dutch to Korean</option>
  <option value="nl|ja">Dutch to Japanese</option>
  <option value="nl|ar">Dutch to Arabic</option>
  <option value="es|en">Spanish to English</option>
  <option value="es|de">Spanish to German</option>
  <option value="es|nl">Spanish to Dutch</option>
  <option value="es|fr">Spanish to French</option>
  <option value="es|it">Spanish to Italian</option>
  <option value="es|pt">Spanish to Portuguese</option>
  <option value="es|ko">Spanish to Korean</option>
  <option value="es|ja">Spanish to Japanese</option>
  <option value="es|ar">Spanish to Arabic</option>
  <option value="fr|en">French to English</option>
  <option value="fr|de">French to German</option>
  <option value="fr|nl">French to Dutch</option>
  <option value="fr|es">French to Spanish</option>
  <option value="fr|it">French to Italian</option>
  <option value="fr|pt">French to Portuguese</option>
  <option value="fr|ko">French to Korean</option>
  <option value="fr|ja">French to Japanese</option>
  <option value="fr|ar">French to Arabic</option>
  <option value="it|en">Italian to English</option>
  <option value="it|de">Italian to German</option>
  <option value="it|nl">Italian to Dutch</option>
  <option value="it|es">Italian to Spanish</option>
  <option value="it|fr">Italian to French</option>
  <option value="it|pt">Italian to Portuguese</option>
  <option value="it|ko">Italian to Korean</option>
  <option value="it|ja">Italian to Japanese</option>
  <option value="it|ar">Italian to Arabic</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" />
 </select>$gobutton
</form>

Make sure that you change the YOURSITE.COM to the correct domain name.

Save.

Enjoy.


Credit goes to oldfan (for his or her post here) that I tweaked to make work better. :D


For a demo of what this looks like go here: http://f800riders.org/forum/forumdisplay.php?f=67

RWerksman 12-29-2007 03:45 AM

Reserved

iogames 12-29-2007 04:48 AM

This is great! why nobody is installing??? :confused:

RWerksman 12-29-2007 05:12 AM

Quote:

Originally Posted by iogames (Post 1411221)
This is great! why nobody is installing??? :confused:

Probably because it was just posted today :D

iogames 12-29-2007 06:08 AM

Whenever I translate the site, it automatically logs me out of the site and says that the admin must add the URL to the whitelist. Can you fix this issue?

RWerksman 12-29-2007 10:15 PM

Admin CP -> vBulletin Options -> General Settings

Add translate.google.com to the Post Referrer Whitelist.

Save.

rcwild 12-29-2007 11:18 PM

Cool.

Our site gets visitors from around the world, so the translation will add convenience. Would be even nicer if it was more obvious to users. Would be awesome if it was near the top of the page and included country flags to indicate languages, with image linked to the correct translation.

iogames 12-30-2007 04:23 PM

Quote:

Originally Posted by rcwild (Post 1411641)
Cool.

Our site gets visitors from around the world, so the translation will add convenience. Would be even nicer if it was more obvious to users. Would be awesome if it was near the top of the page and included country flags to indicate languages, with image linked to the correct translation.

Mine just stopped working! :confused: I just upgraded vBSEO...
Yes the flags could be a nice addition!

Quote:

<div align="left">
<strong>Translate Forum<br />
<form action="http://translate.google.com/translate" method="post">
<input type="hidden" name="u" value="http://iogames.com/$scriptpath" />
<select name="langpair" onchange="this.form.submit();">
<option value="en|es">English -> Spanish</option>
<option value="en|ja">English -> Japanese</option>
<option value="en|de">English -> German</option>
<option value="en|fr">English -> French</option>
<option value="en|it">English -> Italian</option>
<option value="en|nl">English -> Dutch</option>
<option value="en|pt">English -> Portuguese</option>
<option value="en|ko">English -> Korean</option>
<option value="en|ar">English -> Arabic</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" />
</select>$gobutton
</form>

RWerksman 12-30-2007 06:39 PM

Quote:

Originally Posted by iogames (Post 1412026)
Mine just stopped working! :confused: I just upgraded vBSEO...
Yes the flags could be a nice addition!

I have no plans to include flags as they represent countries, not languages.

I currently don't have vBSEO installed, is there somewhere that I can see this not working on your site?

iogames 01-04-2008 06:46 PM

Well after a few hours I've improved mine alot!

http://chat.iogames.com/ ;)

even I put flags :D


All times are GMT. The time now is 03:07 AM.

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.01084 seconds
  • Memory Usage 1,757KB
  • 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
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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