vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Show Thread Enhancements - DJ's Translate a Thread in a Google Pop-Up Window (https://vborg.vbsupport.ru/showthread.php?t=188558)

Digital Jedi 08-20-2008 12:03 AM

To all the users of my 2.00 modification, please refer to these instructions in order to upgrade. Upgrading is even easier then before.

UPGRADE INSTRUCTIONS

To access your SHOWTHREAD template, go to your Admin CP >>> Styles & Templates >>> Style Manager >>> [Expand Your Style] >>> Show Thread Templates >>> SHOWTHREAD.

STEP 1.
Simply search for this block of code in your SHOWTHREAD template:

Code:

<td class="vbmenu_control" id="languagemenu" nowrap="nowrap">
          <a href="$show[nojs_link]#goto_languagemenu">Language</a>
        <if condition="$show['popups']"><script type="text/javascript"> vbmenu_register("languagemenu"); </script></if>
    </td>

Change the one instance of the word Language to Translate.


STEP 2.
Look for everything starting with this line
Code:

<!-- Language Translator Menu -->
And ending with this line:
Code:

<!--/ Language Translator Menu -->
And replace all of it with this:
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 -->

And your done.


I will be adding additional language options like I had in the previous modification to Post 2. But because Google now translates the full spectrum of their available languages to the full spectrum of their available languages, the previous manner I had just isn't practical and wont fit into one post. So I will be adding [Language] to... options one by one as time permits. If you have a request, I'll move it to the front of the list. But until then I'm jut going thought them one language at a time. Thanks, and I hope you enjoy this update.

apiasto 08-22-2008 05:52 PM

how about english to urdu?

Digital Jedi 08-22-2008 11:12 PM

Quote:

Originally Posted by apiasto (Post 1604647)
how about english to urdu?

Google doesn't have an option to translate to Urdu.

dxflw 08-23-2008 06:11 PM

Great mod man!Congratulations!

Digital Jedi 08-24-2008 02:55 AM

EDIT: I'm brain dead, I already posted Chinese to...
https://vborg.vbsupport.ru/showthread.php?p=1602664

dirtyfeast 08-24-2008 12:36 PM

It does not work for me. My forum has been crawling with google bots for the last 3 months. It is open to public to read, and I have followed the instructions to get this to work. All is good. I click on Translate, and than select Spanish as an example. The new window opens up, goes to black, a little flicker, and than my firefox shuts down. Here is my site. http://www.unitedsocomleague.com/forum

Any help would be greatly appreciated.

Digital Jedi 08-24-2008 04:58 PM

Quote:

Originally Posted by dirtyfeast (Post 1605744)
It does not work for me. My forum has been crawling with google bots for the last 3 months. It is open to public to read, and I have followed the instructions to get this to work. All is good. I click on Translate, and than select Spanish as an example. The new window opens up, goes to black, a little flicker, and than my firefox shuts down. Here is my site. http://www.unitedsocomleague.com/forum

Any help would be greatly appreciated.

I get a "Sorry, You Must Have Javascript Enabled To View This Site" message in whatever language I click on. I know the translator disables all Javascript when converting a page, so I'm guesing it's that your site can't be viewed with Javscript disabled.

diim_nowa 08-24-2008 05:58 PM

Digital Jedi,

And from Russian it is possible?

dirtyfeast 08-24-2008 06:45 PM

Quote:

Originally Posted by Digital Jedi (Post 1605927)
I get a "Sorry, You Must Have Javascript Enabled To View This Site" message in whatever language I click on. I know the translator disables all Javascript when converting a page, so I'm guesing it's that your site can't be viewed with Javscript disabled.

I do not have Javascript disabled for my site.

Digital Jedi 08-24-2008 06:58 PM

Quote:

Originally Posted by diim_nowa (Post 1605972)
Digital Jedi,

And from Russian it is possible?

Sure, I'll post one here in a few.

Quote:

Originally Posted by dirtyfeast (Post 1606007)
I do not have Javascript disabled for my site.

I didn't say you did. (Javascript is something an individual enables/disables on his computer while browsing the web.) I said Google disables Javascript on conversion and that your site can't be viewed with Javascript disabled.

What you can do is track down the javascript that your site requires for viewing it, and fix it to where users who don't have Javascript enabled can still view it. That's kind of a good idea anyway, because there are still people out there who either don't browse with Javascript enabled, or who simply don't have the functionality.


All times are GMT. The time now is 02:19 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.01203 seconds
  • Memory Usage 1,827KB
  • 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
  • (4)bbcode_code_printable
  • (5)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