View Full Version : Mini Mods - Translate a single Post in a Popup w/bablefish
Scalemotorcars
07-27-2007, 10:00 PM
Heres a small modification to this thread. Credit should go to PcFreak
https://vborg.vbsupport.ru/showthread.php?t=110095&highlight=babelfish.com
Make sure you read the direction on the above post. Its a simple template change to the postbits, or postbits_legacy.
The only real changes are to the image size and I added several languages as well as direct link to bablefish so readers can translate posts back to english or whatever language your forum uses.
Make sure to change out the"your.domain_here" with your absolute path of your forum
<!--start translator-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com','','directories=no,locati on=no,resizable=yes,scrollbars=yes,toolbar=no,stat us=no,menubar=no,width=700,height=500')">
<img src="$stylevar[imgdir_button]/tr.gif" alt="Please translate all posts to English" width="15" height="10" border="0" /></a>
<!--english-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_it','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/it.gif" alt=" Translate from English to Italian" width="15" height="10" border="0" /></a>
<!--french-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_fr','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/fr.gif" alt=" Translate from English to French" width="15" height="10" border="0" /></a>
<!--german-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_de','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/de.gif" alt=" Translate from English to German" width="15" height="10" border="0" /></a>
<!--spanish-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_es','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/es.gif" alt=" Translate from English to Spanish" width="15" height="10" border="0" /></a>
<!--dutch-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://your.domain_here/showpost.php?p=$post[postid]&lp=en_nl','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/nl.gif" alt=" Translate from English to Dutch" width="15" height="10" border="0" /></a>
<!--end translator-->
Hope this works for you its my first Mod Post. :)
Check the screenshots below for the images and a screenshot. :up:
PoetJA-1975
07-29-2007, 05:55 AM
Wow - nice mod - thanx for sharing it ;)
Jacquii.
tminus
07-31-2007, 06:23 AM
I was just wondering about this 10 minutes ago! I haven't tried it yet but thank you!
This gets mod of the month for user friendliness.
OMG! This is amazing, so amazing that I decided to enhance this a bit and make it so the entire site is translated.
Ready? Go!
In the navbar template, look for this code:
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>
Below it, add the following code:
<!--start translator-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com','','directories=no,locati on=no,resizable=yes,scrollbars=yes,toolbar=no,stat us=no,menubar=no,width=700,height=500')">
<img src="$stylevar[imgdir_button]/tr.gif" alt="Please translate all to English" width="15" height="10" border="0" /></a>
<!--english-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/showpost.php?p=$post[postid]&lp=en_it','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/it.gif" alt=" Translate from English to Italian" width="15" height="10" border="0" /></a>
<!--french-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_fr','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/fr.gif" alt=" Translate from English to French" width="15" height="10" border="0" /></a>
<!--german-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_de','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/de.gif" alt=" Translate from English to German" width="15" height="10" border="0" /></a>
<!--spanish-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_es','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/es.gif" alt=" Translate from English to Spanish" width="15" height="10" border="0" /></a>
<!--dutch-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_nl','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/nl.gif" alt=" Translate from English to Dutch" width="15" height="10" border="0" /></a>
<!--end translator-->
Save it and you are done.
It should work fine...if you doesn't, please update here as I have not tested this thoroughly.
Thanks, enjoy.
Awesome, thanks. I will be trying this too. ;)
Scalemotorcars
08-01-2007, 09:28 PM
Cool. If anyone gets the full site translation working could you please post you're results. :up:
tminus
08-03-2007, 04:19 AM
I've done it and it translates the site, but not some of the post.
It looks to be about 75% of the site is translated, with some posts being translated along the way.
Either way, it is helpful because I emailed Google about this to find out how it affects Google Adsense and their reply was along the lines of "it is a good idea because we can index your site in another language which in turn can have an affect on Google Adsense."
.........Either way, the entire site translation works.
So that means that they can enable site translation and it is automatic, or do they still have to enable it per page? I thought it just translates the page, not the 'entire site'. I was working on something else but I will have to try these out.
Edit: Tried it and it works. Thanks. I see now that it opens a new window and if you stay in it the site gets translated during navigation. Awesome.
Also, having both the post and site translation would be a solution to compensate for untranslated posts in the page/site translation.
I have 14 languages available for translation, but the Greek characteers are not displaying correctly, but I think this is because I'm in the U.S. and the dominant language is English. Whereas, I'm sure the Greek characters would appear correctly if a country's dominant language is Greek or something similar to Greek.
Who knows, my theory could be wrong.
Don't you have to have Greek characters enabled to see it properly?
http://www.perseus.tufts.edu/Help/fonthelp.html
http://www.translatum.gr/fonts/
Other ideas would be creating a Language or Translate navbar drop down menu with icons and/or text. Some people might also prefer it in the header or footer. AJAX inline post translation would be nice too, as well as translating the page without a pop-up window. And of course a full product with settings features in admincp! Dream big I say. ;)
Edit2: Cool, thanks guys. I got it working on my navbar, postbit, header and footer. I was trying to figure out a way to have it open in the same window/tab, but no luck so far. Any ideas?
RichieBoy67
08-03-2007, 02:39 PM
This gets mod of the month for user friendliness.
OMG! This is amazing, so amazing that I decided to enhance this a bit and make it so the entire site is translated.
Ready? Go!
In the navbar template, look for this code:
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>
Below it, add the following code:
<!--start translator-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com','','directories=no,locati on=no,resizable=yes,scrollbars=yes,toolbar=no,stat us=no,menubar=no,width=700,height=500')">
<img src="$stylevar[imgdir_button]/tr.gif" alt="Please translate all to English" width="15" height="10" border="0" /></a>
<!--english-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/showpost.php?p=$post[postid]&lp=en_it','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/it.gif" alt=" Translate from English to Italian" width="15" height="10" border="0" /></a>
<!--french-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_fr','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/fr.gif" alt=" Translate from English to French" width="15" height="10" border="0" /></a>
<!--german-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_de','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/de.gif" alt=" Translate from English to German" width="15" height="10" border="0" /></a>
<!--spanish-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_es','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/es.gif" alt=" Translate from English to Spanish" width="15" height="10" border="0" /></a>
<!--dutch-->
<a href="#" onclick="Fenster1=window.open('http://babelfish.altavista.com/babelfish/urltrurl?url=http://www.yoursite.com/&lp=en_nl','','directories=no,location=no,resizable =yes,scrollbars=yes,toolbar=no,status=no,menubar=n o,width=600,height=400')">
<img src="$stylevar[imgdir_button]/nl.gif" alt=" Translate from English to Dutch" width="15" height="10" border="0" /></a>
<!--end translator-->
Save it and you are done.
It should work fine...if you doesn't, please update here as I have not tested this thoroughly.
Thanks, enjoy.
Thanks for that!!:D
tminus
08-04-2007, 08:31 AM
I found this nice free (lic:CC 2.5 (http://creativecommons.org/licenses/by/2.5/)) flag pack (.zip 291kb) at famfamfam. It has Win & Mac, gif and png flag icons like the ones SMC posted but for every country::
http://www.famfamfam.com/lab/icons/flags/
http://img300.imageshack.us/img300/8224/flagspreviewlargesy6.png
*If you are a Win user and you are wondering what the .ds_store files are, they are harmless Mac files for storing a folder's custom attributes (.ds_store@wikipedia (http://en.wikipedia.org/wiki/.DS_Store).) Feel free to delete all .ds_store files and the Mac folder if you want.
Karabaja
08-04-2007, 02:05 PM
I've placed flags next to post date-time on my board. But it would be nice if this could be in some kind of drop-down included in postbit instead of flags appearing in every post.
tminus
08-05-2007, 04:22 AM
I've placed flags next to post date-time on my board. But it would be nice if this could be in some kind of drop-down included in postbit instead of flags appearing in every post.
I just took the product file for this other translation mod (https://vborg.vbsupport.ru/showthread.php?t=154024) and put Market Profits code over it more or less. Now I have this in a drop menu menu on my forum in the navbar. This makes it way easier for so many reasons. The main one is that it is easier to have it compact in the navbar versus every post. Another is that you don't have to edit the navbar again if you revert the template during vB upgrades (unless there are conflicts.)
http://img476.imageshack.us/img476/8796/smalltranslationwc7.jpg
Scalemotorcars
08-07-2007, 02:40 AM
NICE!!! Good to see everyone making use of this. :D
tminus
08-07-2007, 04:48 AM
NICE!!! Good to see everyone making use of this. :D
Yeah thanks! ;)
MARKETPROFITS you mentioned that you have 14 languages. Can you post your code for other languages or a link to a listing somewhere?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.