PDA

View Full Version : End-User Options - AJAX Google Translator


Coroner
09-04-2008, 10:00 PM
What this MOD do ?
It will translate a marked Text - that's all.

How does it works ?
Simply mark a text and a little Textbox appears. Choose Language to translate from an to. Click "Go".

Tested on the following Browsers:
IE
Mozilla 3
Opera
SafariHow to install with TMS ?
Simply import the Product - finish !

How to install without TMS ?
Import the Product.

Now, two Templates has to be changed:
headinclude
search for
<script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script>
add below
<script type="text/javascript" src="clientscript/google_translate.js"></script>
<script type="text/javascript">
<!--
var GOOGLE_ERROR = "$vbphrase[googletranslator_error]";
var GOOGLE_TEXT = "$vbphrase[googletranslator_text_first]";
// -->
</script>
footer
search for
$ad_location[ad_footer_start
add below
<script type="text/javascript">
<!--
var translate_from = "en";
var translate_to = "de";
// -->
</script>
<div id="translation" style="visibility: hidden; border: 1px; position: absolute; left: 0px; top: 0px" class="tborder">
<div class="tcat">
<a style="display: block; text-align: right; padding: 6px; font-size: 9px;" href="#" onclick="this.parentNode.parentNode.style.visibility='hidde n'">$vbphrase[googletranslator_close_window]</a>
</div>
<div style="padding: 6px;"></div>
</div>
<div id="translate" style="visibility: hidden; border: 1px; position: absolute; left: 0px; top: 0px" class="tborder">
<div class="thead">
<img src="images/ico_searching.gif" alt="" style="vertical-align: middle; display: none;" />
<span class="normalfont">$vbphrase[googletranslator_translate_from]:
<select name="trans_from" onchange="translate_from=this.options[this.selectedIndex].value">
<option value="ar">$vbphrase[googletranslator_arabic]</option>
<option value="bg">$vbphrase[googletranslator_bulgarian]</option>
<option value="zh-CN">$vbphrase[googletranslator_chinese]</option>
<option value="hr">$vbphrase[googletranslator_croatian]</option>
<option value="cs">$vbphrase[googletranslator_czech]</option>
<option value="da">$vbphrase[googletranslator_danish]</option>
<option value="nl">$vbphrase[googletranslator_dutch]</option>
<option value="en" selected="selected">$vbphrase[googletranslator_english]</option>
<option value="fi">$vbphrase[googletranslator_finnish]</option>
<option value="fr">$vbphrase[googletranslator_french]</option>
<option value="de">$vbphrase[googletranslator_german]</option>
<option value="el">$vbphrase[googletranslator_greek]</option>
<option value="hi">$vbphrase[googletranslator_hindi]</option>
<option value="it">$vbphrase[googletranslator_italian]</option>
<option value="ja">$vbphrase[googletranslator_japanese]</option>
<option value="ko">$vbphrase[googletranslator_korean]</option>
<option value="no">$vbphrase[googletranslator_norwegian]</option>
<option value="pl">$vbphrase[googletranslator_polish]</option>
<option value="pt">$vbphrase[googletranslator_portuguese]</option>
<option value="ro">$vbphrase[googletranslator_romanian]</option>
<option value="ru">$vbphrase[googletranslator_russian]</option>
<option value="es">$vbphrase[googletranslator_spanish]</option>
<option value="sv">$vbphrase[googletranslator_swedish]</option>
</select>
$vbphrase[googletranslator_translate_to]
<select name="trans_to" onchange="translate_to=this.options[this.selectedIndex].value">
<option value="ar">$vbphrase[googletranslator_arabic]</option>
<option value="bg">$vbphrase[googletranslator_bulgarian]</option>
<option value="zh-CN">$vbphrase[googletranslator_chinese]</option>
<option value="hr">$vbphrase[googletranslator_croatian]</option>
<option value="cs">$vbphrase[googletranslator_czech]</option>
<option value="da">$vbphrase[googletranslator_danish]</option>
<option value="nl">$vbphrase[googletranslator_dutch]</option>
<option value="en">$vbphrase[googletranslator_english]</option>
<option value="fi">$vbphrase[googletranslator_finnish]</option>
<option value="fr">$vbphrase[googletranslator_french]</option>
<option value="de" selected="selected">$vbphrase[googletranslator_german]</option>
<option value="el">$vbphrase[googletranslator_greek]</option>
<option value="hi">$vbphrase[googletranslator_hindi]</option>
<option value="it">$vbphrase[googletranslator_italian]</option>
<option value="ja">$vbphrase[googletranslator_japanese]</option>
<option value="ko">$vbphrase[googletranslator_korean]</option>
<option value="no">$vbphrase[googletranslator_norwegian]</option>
<option value="pl">$vbphrase[googletranslator_polish]</option>
<option value="pt">$vbphrase[googletranslator_portuguese]</option>
<option value="ro">$vbphrase[googletranslator_romanian]</option>
<option value="ru">$vbphrase[googletranslator_russian]</option>
<option value="es">$vbphrase[googletranslator_spanish]</option>
<option value="sv">$vbphrase[googletranslator_swedish]</option>
</select>
</span> <input type="button" class="button" name="btngo" value="$vbphrase[googletranslator_go]" onclick="translateSelection(translate_from, translate_to, 1);" />
</div>
</div>
Supported Languages by Google:
Arabic
Bulgarian
Chinese
Croatian
Czech
Danish
Dutch
English
Finnish
French
German
Greek
Hindi
Italian
Japanese
Korean
Norwegian
Polish
Portuguese
Romanian
Russian
Spanish
SwedishKnown Bugs ?
I didn't found some Bugs. Sometimes the translated Text doesn't appears, but if I marked a shorter Text, it works.

Used Queries ?
None

P.S. deutschen Support gibt es auch bei your-vb

alqloob alsahya
09-05-2008, 05:50 PM
thanj"s nice joop

yahoooh
09-05-2008, 07:32 PM
how to make it in controle panel for users
?

yahoooh
09-05-2008, 07:33 PM
dos this translate words or the page?

home9000
09-05-2008, 08:28 PM
Is it working in 3.6

What is TMS ?

Coroner
09-06-2008, 03:08 AM
dos this translate words or the page?

It will translate marked text.

Coroner
09-06-2008, 03:09 AM
Is it working in 3.6

What is TMS ?

Not tested, but I think so.
TMS = Template Modification System
You can changing Tempaltes by the Product. The original templates will not changed - a plug in will do it

Coroner
09-06-2008, 03:10 AM
how to make it in controle panel for users
?

Why do you want it in ControlPanel ? Ther's no reason for it.

EvilJohn
09-06-2008, 03:39 AM
Wow! Awesome! TMS support, 23 languages, no queries. Me thinks you are a coding God. :D

clicks installed

yahoooh
09-06-2008, 06:56 AM
Why do you want it in ControlPanel ? Ther's no reason for it.

i was thinking it is like translate service from google as box and then i out any text and then click translate to any language

so it will be as link in user cp and the user click the link and then the another page show as like transalte page but only for users not for registered
this is as tool for them

but your script is in different way

FiMeTi
09-06-2008, 08:09 AM
Great JOB man!
Dont need it tho, but still want to say it is workin fine on 3.7.3, too. :)

cheers

ArnyVee
09-06-2008, 12:11 PM
I'm definitely going to look into adding this mod. I'm just waiting to remove a mod or two so that I don't go over my self-imposed mod limit :D

:: tagged ::

mA|tRiX
09-15-2008, 05:25 AM
Ive imported the product but it doesnt work. :(

Coroner
09-15-2008, 05:31 AM
What have you done ?
TemplateEdits or TMS ?
Uploaded the file(s) ?

akulion
09-15-2008, 05:52 AM
hi,
i installed this, however the text does not get translated.

When I highlight the text the translation box appears, but after selecting the language and pressing "go" it just shows a tab saying "close window"...any idea why?

One thing that comes to mind is that I did not do anything with the included language files...do i have to do something with those too? if yes then please guide me thanks

aku

SuperTaz
09-16-2008, 06:56 AM
Edit: N/M. I see it now. Thanks. Installed.

Barakat
09-19-2008, 01:44 AM
its a nice hack ,,, but if it works without the right or left click it will be better

like if you can make it with an option to work by another way ,,

thanks

TheWhite
10-06-2008, 05:18 PM
isn't this hack supported anymore?

hasepapa
10-26-2008, 09:18 AM
for me it just shows the window! No text. Even if I choose only one word.

Georg
11-01-2008, 10:16 PM
Works perfectly for me, thank you. (manual install , 3.7)

7lanet
11-02-2008, 05:26 AM
:*_*:
http://www.7lanet.com/up/out.php/i10125_error.gif (http://www.7lanet.com/up)

Ghanem
11-05-2008, 10:14 PM
Thank you for the nice mod..
When I highlight the text the translation box appears, but after selecting the language and pressing "go" it just shows a tab saying "close window"...any idea why?Because the font color inside the box is the same as the background color :p
Can some one help telling us how to change the font color inside the box :)

kether1
11-09-2008, 01:52 PM
Thank you for the nice mod..
Because the font color inside the box is the same as the background color :p
Can some one help telling us how to change the font color inside the box :)

I am having a similar problem: My popup box background color is the same as my forum page and because of this, the text cannot be easily seen. I wish I could change the background color. I cannot install this mod until I get some help with changing the font color and background color.

Another thing that would be helpful is that if the popup could be made to locate itself to the center of the page instead of whereever the highlighted text might appear. This request is because if one highlights some text near the far right edge of the screen, the popup is half off the page and can not be dragged into view or seen - rendering it useless.

This mod has potential, but until it is developed a bit more it is hard to use. Thanks for working on this. I hope you or someone with programing knowledge can fix the bugs.

Thanks,
kether

kether1
11-16-2008, 11:23 PM
It has been awhile - anyone ? (Bump)

rob01
11-17-2008, 12:26 AM
how this work?

kether1
12-12-2008, 01:07 AM
I am having a similar problem: My popup box background color is the same as my forum page and because of this, the text cannot be easily seen. I wish I could change the background color. I cannot install this mod until I get some help with changing the font color and background color.

Another thing that would be helpful is that if the popup could be made to locate itself to the center of the page instead of wherever the highlighted text might appear. This request is because if one highlights some text near the far right edge of the screen, the popup is half off the page and can not be dragged into view or seen - rendering it useless.

This mod has potential, but until it is developed a bit more it is hard to use. Thanks for working on this. I hope you or someone with programing knowledge can fix the bugs.

Thanks,
kether

Anyone?
Thanks! K

brhoom
12-12-2008, 02:24 AM
Nice addon

demoniavbh
01-14-2009, 03:32 PM
Could it be possible to let user choose if they want this enabled or not?
I only have a few foreign members and this would be very helpful for them, but the other members will get pissed off by getting that everytime they mark something...

Coroner
01-14-2009, 03:47 PM
This should come in a later version - but this time, I'm too busy.

demoniavbh
01-14-2009, 04:19 PM
Ok, perfect, I just wanted to know if that could be possible :)

Whenever you have time (don't worry) do it and update for 3.8:P

THANKS A LOT!

soundbarrierpro
01-14-2009, 04:55 PM
AWESOME! Many of my members are from Europe and Scandinavia. This is perfect!

/INSTALLED

dubai2008
01-17-2009, 09:20 PM
To change the color of the font:
Open file: google_translate.php
$strTranslation = '<div background-color:#000000><br /><font color=#ffffff>'

change to:
$strTranslation = '<div background-color:#ffffff><br /><font color=#000000>'
The color will be black.

VargTimmen
01-19-2009, 09:41 PM
Hi,

I installed this, because we have a few english member on our board, who need this.
The problem is, that for every marking up text, the translator pops up.
This would not be so annoying, but you can't click it away. Or set it up, if you want to occur the popup.
I need, you don't have actually much time, but it would be very great, if you can fix it.

Beside of that, the guys from the KDE Desktop Project developed an Inline Google Translation, which gives the user the opportunity to choose in which language he want to translate an entire post.

Mod (http://mods.mybboard.net/view/inline-google-translation)
Official Live Demo (http://forum.kde.org/)
Live Demo at an Testforum by me (http://www.butterkekstorte.de/bridge/forum/showthread.php?tid=1)

Could you do a similar mod for vBulletin? This would be awesome :)

Greetings from germany
Benny

Scalemotorcars
02-02-2009, 06:21 PM
Can someone outline the edits to get this working on VBA pages. I have allot of VBAdvanced pages and I get the google error. Maybe make the links absolute but not sure exactly where to edit so it works site wide. Thanks....

Scalemotorcars
02-02-2009, 08:35 PM
Figured it out. Actually easy fix.

Upload the google_translate.php provided in the hack to the VBA root. Same place your cmps_index.php or index.php resides.

If you have an image folder on the root then just upload the image provided there. If not then the easy way is to an the Images Folder straight to the same root.

Done...
Works perfectly on my site. Scalemotorcar.com (http://scalemotorcars.com/index.php)

Scalemotorcars
02-03-2009, 01:28 PM
I made a few changes to the pop-up. The main difference is the ability to close the pop-up if its triggered accidental. 2nd I changed the background to class="panelsurround" to make it s bit more noticeable. This is a preference of mine but you can use whatever class looks best on your site.

Make sure you change the path to your <img src="http://www.yoursite.com/images/cross.png">.
I used the FamFamFam one. Hope this is of use to someone. Enjoy..

<script type="text/javascript">
<!--
var translate_from = "en";
var translate_to = "de";
// -->
</script>
<div id="translation" style="visibility: hidden; border: 2px; position: absolute; left: 0px; top: 0px" class="tborder">
<div class="tcat">
<a style="display: block; text-align: right; padding: 6px; font-size: 9px;" href="#" onclick="this.parentNode.parentNode.style.visibility='hidde n'">$vbphrase[googletranslator_close_window]</a>
</div>
<div style="padding: 6px;"></div>
</div>
<div id="translate" style="visibility: hidden; border: 0px; position: absolute; left: 0px; top: 0px" class="tborder">
<div class="panelsurround">
<img src="images/ico_searching.gif" alt="" style="vertical-align: middle; display: none;" />
<span class="normalfont">$vbphrase[googletranslator_translate_from]:
<select name="trans_from" onchange="translate_from=this.options[this.selectedIndex].value">
<option value="ar">$vbphrase[googletranslator_arabic]</option>
<option value="bg">$vbphrase[googletranslator_bulgarian]</option>
<option value="zh-CN">$vbphrase[googletranslator_chinese]</option>
<option value="hr">$vbphrase[googletranslator_croatian]</option>
<option value="cs">$vbphrase[googletranslator_czech]</option>
<option value="da">$vbphrase[googletranslator_danish]</option>
<option value="nl">$vbphrase[googletranslator_dutch]</option>
<option value="en" selected="selected">$vbphrase[googletranslator_english]</option>
<option value="fi">$vbphrase[googletranslator_finnish]</option>
<option value="fr">$vbphrase[googletranslator_french]</option>
<option value="de">$vbphrase[googletranslator_german]</option>
<option value="el">$vbphrase[googletranslator_greek]</option>
<option value="hi">$vbphrase[googletranslator_hindi]</option>
<option value="it">$vbphrase[googletranslator_italian]</option>
<option value="ja">$vbphrase[googletranslator_japanese]</option>
<option value="ko">$vbphrase[googletranslator_korean]</option>
<option value="no">$vbphrase[googletranslator_norwegian]</option>
<option value="pl">$vbphrase[googletranslator_polish]</option>
<option value="pt">$vbphrase[googletranslator_portuguese]</option>
<option value="ro">$vbphrase[googletranslator_romanian]</option>
<option value="ru">$vbphrase[googletranslator_russian]</option>
<option value="es">$vbphrase[googletranslator_spanish]</option>
<option value="sv">$vbphrase[googletranslator_swedish]</option>
</select>
$vbphrase[googletranslator_translate_to]
<select name="trans_to" onchange="translate_to=this.options[this.selectedIndex].value">
<option value="ar">$vbphrase[googletranslator_arabic]</option>
<option value="bg">$vbphrase[googletranslator_bulgarian]</option>
<option value="zh-CN">$vbphrase[googletranslator_chinese]</option>
<option value="hr">$vbphrase[googletranslator_croatian]</option>
<option value="cs">$vbphrase[googletranslator_czech]</option>
<option value="da">$vbphrase[googletranslator_danish]</option>
<option value="nl">$vbphrase[googletranslator_dutch]</option>
<option value="en">$vbphrase[googletranslator_english]</option>
<option value="fi">$vbphrase[googletranslator_finnish]</option>
<option value="fr">$vbphrase[googletranslator_french]</option>
<option value="de" selected="selected">$vbphrase[googletranslator_german]</option>
<option value="el">$vbphrase[googletranslator_greek]</option>
<option value="hi">$vbphrase[googletranslator_hindi]</option>
<option value="it">$vbphrase[googletranslator_italian]</option>
<option value="ja">$vbphrase[googletranslator_japanese]</option>
<option value="ko">$vbphrase[googletranslator_korean]</option>
<option value="no">$vbphrase[googletranslator_norwegian]</option>
<option value="pl">$vbphrase[googletranslator_polish]</option>
<option value="pt">$vbphrase[googletranslator_portuguese]</option>
<option value="ro">$vbphrase[googletranslator_romanian]</option>
<option value="ru">$vbphrase[googletranslator_russian]</option>
<option value="es">$vbphrase[googletranslator_spanish]</option>
<option value="sv">$vbphrase[googletranslator_swedish]</option>
</select>
</span> <input type="button" class="button" name="btngo" value="$vbphrase[googletranslator_go]" onclick="translateSelection(translate_from, translate_to, 1);" /> <a href="#" onclick="this.parentNode.parentNode.style.visibility='hidde n'"><img src="http://www.yoursite.com/images/cross.png" border=0 alt="Close Translator"></a>
</div>
</div>

eXaLs
02-03-2009, 09:49 PM
footer
search for

Code:
$ad_location[ad_footer_start

i can't find it
what can be problem?

Scalemotorcars
02-04-2009, 01:07 AM
footer
search for

Code:
$ad_location[ad_footer_start

i can't find it
what can be problem?


Go to Admin CP > Styles & Templates> Style Manager ... Click the GO button.

In the 3rd block from the top is the footer template. Look for the very first line. It should be there. (Unless your have an older version of Vb>

If you dont have that line of code try adding it the top of the footer template. Should work fine.

Scalemotorcars
02-07-2009, 11:54 AM
Got a little problem with, Not really a bug just a glitch.

Ive got this installed and love it. Thanks

But I also installed MK's Image resizer last night and they do both work together but when I enlarge an image with Litebox the google translator pops up at the top left of the page.

Not the entire box but just the two drop down menu's. Any ideal how to fix this.

Heres the link to MK's mod (https://vborg.vbsupport.ru/showthread.php?t=199100&highlight=resizer)

Scalemotorcars
02-10-2009, 10:56 AM
Anyone have an ideal why this in conflicting with MK-Image resizer? I would hate to have to uninstall this mod just over a simple fix. Could use some help here. Thanks.

Scalemotorcars
02-21-2009, 12:31 PM
Had to un-install. It conflicted with other Ajax features of my site. Not support so I couldn't get it fixed. Sad, its a great mod and would have been handy to have.

RWerksman
04-08-2009, 04:37 PM
Hi,

I installed this, because we have a few english member on our board, who need this.
The problem is, that for every marking up text, the translator pops up.
This would not be so annoying, but you can't click it away. Or set it up, if you want to occur the popup.
I need, you don't have actually much time, but it would be very great, if you can fix it.

Beside of that, the guys from the KDE Desktop Project developed an Inline Google Translation, which gives the user the opportunity to choose in which language he want to translate an entire post.

Mod (http://mods.mybboard.net/view/inline-google-translation)
Official Live Demo (http://forum.kde.org/)
Live Demo at an Testforum by me (http://www.butterkekstorte.de/bridge/forum/showthread.php?tid=1)

Could you do a similar mod for vBulletin? This would be awesome :)

Greetings from germany
Benny
That is a fantastic modification! I only wish that was available for VB.

gcxboxps
05-21-2009, 01:33 AM
Is it possible you can make this so that they can type into it?

nrms?
06-10-2009, 03:03 PM
Tested... and removed.
This mod not work in Internet Exp7...

And in Firefox when click "close translator" it return to home forum page. Some fix...?

relaxiha
06-19-2009, 08:13 PM
hello
please update for 3.8.3
and addtion lang

GeoMapia
11-17-2009, 10:34 AM
Google Translator does not work for me today!