vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   End-User Options - AJAX Google Translator (https://vborg.vbsupport.ru/showthread.php?t=190112)

Coroner 09-04-2008 10:00 PM

AJAX Google Translator
 
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
  • Safari
How 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
    Quote:

    <script type="text/javascript" src="clientscript/vbulletin_global.js?v=$vboptions[simpleversion]"></script>
    add below
    Code:

    <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
    Code:

    $ad_location[ad_footer_start
    add below
    Code:

    <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='hidden'">$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:
  1. Arabic
  2. Bulgarian
  3. Chinese
  4. Croatian
  5. Czech
  6. Danish
  7. Dutch
  8. English
  9. Finnish
  10. French
  11. German
  12. Greek
  13. Hindi
  14. Italian
  15. Japanese
  16. Korean
  17. Norwegian
  18. Polish
  19. Portuguese
  20. Romanian
  21. Russian
  22. Spanish
  23. Swedish
Known 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

Quote:

Originally Posted by yahoooh (Post 1615358)
dos this translate words or the page?

It will translate marked text.

Coroner 09-06-2008 03:09 AM

Quote:

Originally Posted by home9000 (Post 1615400)
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

Quote:

Originally Posted by yahoooh (Post 1615356)
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

Quote:

Originally Posted by Coroner (Post 1615600)
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

Ghanem 11-05-2008 10:14 PM

Thank you for the nice mod..
Quote:

Originally Posted by akulion (Post 1622458)
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

Quote:

Originally Posted by Ghanem (Post 1660164)
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

Quote:

Originally Posted by kether1 (Post 1662330)
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
Official Live Demo
Live Demo at an Testforum by me

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

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..

HTML Code:

<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='hidden'">$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='hidden'"><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

Quote:

Originally Posted by eXaLs (Post 1733489)
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

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.


All times are GMT. The time now is 04:54 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.01497 seconds
  • Memory Usage 1,874KB
  • 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
  • (1)bbcode_html_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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