Back to vBulletin 3.7 Template Modifications

DJ's Translate a Thread in a Google Pop-Up Window
Mod Version: 3.00, by Digital Jedi

This modification is in the archives.
vB Version: 3.7.x Rating: (7 votes - 4.86 average) Installs: 35
Released: 19 Aug 2008 Last Update: 19 Mar 2009 Downloads: 164
Not Supported Template Edits Additional Files External Content  

This template modifications adds a drop-down menu to all your threads which allows users to translate that thread in a new window using https://www.google.com/language_tools?hl=en.

========================================
NOTE: As this is a merely a template edit, vBulletin version isn't really going to be an issue.
========================================

When I first released this for vB 3.6, there seemed to be some confusion as to how this works. Let me clear up any confusion from the start. This is just a simple template modification that redirects you to a translation service from Google.com. It's some links and some pictures designed to help international users communicate more easily. It does not auto-detect what language your forum is in, nor is it a way to browse and post in your forum in another language. It's simply what is described: A way to translate a thread from one base language to another set language. And it also can only support the languages that Google supports, which are the ones listed. Hopefully I've redesigned this mod to be more clear about how it works.


NOTE: In order for Google to translate your threads, they must be able to crawl your forum pages. So Guests must be able to read your forum in order for this mod to work.


Updates
08-19-08 (Updated to include the new languages from Google's Language Tools.


Upgrades
For those upgrading from the vB 3.6 version, click here.


Screenshot



Supported Languages
العربية (Arabic)
Български (Bulgarian)
中国 (Chinese - Simplified)
中國 (Chinese - Traditional)
Hrvatski (Croatian)
Česky (Czech)
Dansk (Danish)
Nederlands (Dutch)
English (This is merely a direct link to the Google Translator)
Suomi (Finnish)
Français (French)
Ελληνική (Greek)
Deutsch (German)
हिन्दी (Hindi)
Italiano (Italian)
日本語 (Japanese)
한국어 (Korean)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese)
Română (Romanian)
Русский (Russian)
Español (Spanish)
Svenska (Swedish)


http://www.cogonline.net/index.php?t=39536
Look for the "Translate" drop-down menu beside the "Display Modes" drop-down.


Installation
Installation is simple. To add this to your forum requires two edits to your SHOWTHREAD template.

Step 1.
To access your SHOWTHREAD template, go to Admin CP >>> Styles & Templates >>> Style Manager >>> "Expand one of your styles" >>> Showthread Templates >>> SHOWTHREAD and look for:

Code:
 
 <if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("displaymodes"); </script></if>
 </td>
 </if>
Below it add:

Code:
 
        <td class="vbmenu_control" id="languagemenu" nowrap="nowrap">
          <a href="$show[nojs_link]#goto_languagemenu">Translate</a>
        <if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("languagemenu"); </script></if>
    </td>
Step 2. (The following step will add the "English to..." translation links only. For those that want additional language options, see Post 2 of this thread.)
Next find:

Code:
    
<script type="text/javascript">
    <!--
    vB_AJAX_ThreadRate_Init('showthread_threadrate_form');
    var threadid = $threadinfo[threadid];
    //-->
    </script>
</if>
Below it add:

Code:
<!-- LANGUAGE TRANSLATOR MENU-->
<div class="vbmenu_popup" id="languagemenu_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr><td class="thead">English to...</td></tr>
<!-- Arabic -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=ar&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/ae.gif" alt="Arabic" width="15" height="10" border="0" /> <span title="Arabic">العربية</span></a></td></tr>
<!-- Bulgarian -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=bg&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/bg.gif" alt="Bulgarian" width="15" height="10" border="0" /> <span title="Bulgarian">Български</span></a></td></tr>
<!-- Chinese (Simplified) -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=zh-CN&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/cn.gif" alt="Chinese (Simplified)" width="15" height="10" border="0" /> <span title="Chinese (Simplified)">中国</span></a></td></tr>
<!-- Chinese (Traditional) -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=zh-TW&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/tw.gif" alt="Chinese (Traditional)" width="15" height="10" border="0" /> <span title="Chinese (Traditional)">中國</span></a></td></tr>
<!-- Croatian -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=hr&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/hr.gif" alt="Croatian" width="15" height="10" border="0" /> <span title="Croatian">Hrvatski</span></a></td></tr>
<!-- Czech -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=cs&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/cz.gif" alt="Czech" width="15" height="10" border="0" /> <span title="Czech">Česky</span></a></td></tr>
<!-- Danish -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=da&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/dk.gif" alt="Danish" width="15" height="10" border="0" /> <span title="Danish">Dansk</span></a></td></tr>
<!-- Dutch -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=nl&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/nl.gif" alt="Dutch" width="15" height="10" border="0" /> <span title="Dutch">Nederlands</span></a></td></tr>
<!-- English -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://www.google.com/language_tools','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/us.gif" alt="Open Google Translator" width="15" height="10" border="0" /> <span title="Open Google Translator">English</span></a></td></tr>
<!-- Finnish -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=fi&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/fi.gif" alt="Finnish" width="15" height="10" border="0" /> <span title="Finnish">Suomi</span></a></td></tr>
<!-- French -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=fr&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/fr.gif" alt="French" width="15" height="10" border="0" /> <span title="French">Français</span></a></td></tr>
<!-- German -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=de&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/de.gif" alt="German" width="15" height="10" border="0" /> <span title="German">Deutsch</span></a></td></tr>
<!-- Greek -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=el&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/gr.gif" alt="Greek" width="15" height="10" border="0" /> <span title="Greek">Ελληνική</span></a></td></tr>
<!-- Hindi -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=hi&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/in.gif" alt="Hindi" width="15" height="10" border="0" /> <span title="Hindi">हिन्दी</span></a></td></tr>
<!-- Italian -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=it&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/it.gif" alt="Italian" width="15" height="10" border="0" /> <span title="Italian">Italiano</span></a></td></tr>
<!-- Japanese -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=ja&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/jp.gif" alt="Japanese" width="15" height="10" border="0" /> <span title="Japanese">日本語</span></a></td></tr>
<!-- Korean -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=ko&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/kr.gif" alt="Korean" width="15" height="10" border="0" /> <span title="Korean">한국어</span></a></td></tr>
<!-- Norwegian -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=no&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/no.gif" alt="Norwegian" width="15" height="10" border="0" /> <span title="Norwegian">Norsk</span></a></td></tr>
<!-- Polish -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=pl&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/pl.gif" alt="Polish" width="15" height="10" border="0" /> <span title="Polish">Polski</span></a></td></tr>
<!-- Portuguese -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=pt&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/pt.gif" alt="Portuguese" width="15" height="10" border="0" /> <span title="Portuguese">Português</span></a></td></tr>
<!-- Romanian -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=ro&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/ro.gif" alt="Romanian" width="15" height="10" border="0" /> <span title="Romanian">Română</span></a></td></tr>
<!-- Russian -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=ru&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/ru.gif" alt="Russian" width="15" height="10" border="0" /> <span title="Russian">Русский</span></a></td></tr>
<!-- Spanish -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinez1=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=es&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/es.gif" alt="Spanish" width="15" height="10" border="0" /> <span title="Spanish">Español</span></a></td></tr> 
<!-- Swedish -->
<tr><td class="vbmenu_option"><a href="#" onClick="Martinezl=window.open('http://translate.google.com/translate?u=$vboptions[bburl]/showthread.php?t=$thread[threadid]&amp;sl=en&amp;tl=sv&amp;hl=en&amp;ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<img src="$stylevar[imgdir_button]/se.gif" alt="Swedish" width="15" height="10" border="0" /> <span title="Swedish">Svenska</span></a></td></tr>
</table></div>
<!-- / LANGUAGE TRANSLATOR MENU -->
Step 3.
Next thing to do is upload the flag images (in attached zip file) to the buttons folder in your images directory. Make sure you upload them to the right one. For some forums, this might simply be images/buttons/. But if your using a custom skin, this might be in the folder holding your style (skin) images, such as [stylename]/buttons/. It will need to be in that directory for each skin you make the template changes to.

Download

This modification is archived, downloads are still allowed.

File Type: %1$s Language Flags.zip (16.0 KB, 87 downloads)

Screenshots

Click image for larger version
Name:	screenie1.png
Views:	133
Size:	40.4 KB
ID:	85741   Click image for larger version
Name:	screenie2.jpg
Views:	210
Size:	91.7 KB
ID:	85742  

Similar Mods

Show Thread Enhancements Translate a Thread in a Google Pop-Up Window vBulletin 3.6 Template Modifications
Miscellaneous Hacks Google Translate For your site vBulletin 3.6 Template Modifications
Translate Your Pages Via Google vBulletin 3.0 Template Modifications

vblts.ru supports vBulletin®, 2022-2024