vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Show Thread Enhancements - Translate a Thread in a Google Pop-Up Window (https://vborg.vbsupport.ru/showthread.php?t=168439)

Digital Jedi 01-21-2008 10:00 PM

Translate a Thread in a Google Pop-Up Window
 
Support and updates for this mod will now be given in the 3.7.x thread, as this should work no matter what your version of vB. If you have any questions, please ask in that thread.





Screenshot
https://vborg.vbsupport.ru/external/2008/08/18.png


Supported Languages
https://vborg.vbsupport.ru/external/2008/08/6.gif العربية (Arabic)
https://vborg.vbsupport.ru/external/2008/08/7.gif Български (Bulgarian)
https://vborg.vbsupport.ru/external/2008/08/8.gif 中国 (Chinese - Simplified)
https://vborg.vbsupport.ru/external/2008/08/9.gif 中國 (Chinese - Traditional)
https://vborg.vbsupport.ru/external/2008/08/10.gif Hrvatski (Croatian)
https://vborg.vbsupport.ru/external/2008/08/11.gif Česky (Czech)
https://vborg.vbsupport.ru/external/2008/08/12.gif Dansk (Danish)
https://vborg.vbsupport.ru/external/2008/08/13.gif Nederlands (Dutch)
https://vborg.vbsupport.ru/external/2008/08/14.gif English (This is merely a direct link to the Google Translator)
https://vborg.vbsupport.ru/external/2008/08/15.gif Suomi (Finnish)
https://vborg.vbsupport.ru/external/2008/08/16.gif Fran?ais (French)
https://vborg.vbsupport.ru/external/2008/08/17.gif Ελληνική (Greek)
https://vborg.vbsupport.ru/external/2008/08/18.gif Deutsch (German)
https://vborg.vbsupport.ru/external/2008/08/19.gif हिन्दी (Hindi)
https://vborg.vbsupport.ru/external/2008/08/20.gif Italiano (Italian)
https://vborg.vbsupport.ru/external/2008/08/21.gif 日本語 (Japanese)
https://vborg.vbsupport.ru/external/2008/08/22.gif 한국어 (Korean)
https://vborg.vbsupport.ru/external/2008/08/23.gif Norsk (Norwegian)
https://vborg.vbsupport.ru/external/2008/08/24.gif Polski (Polish)
https://vborg.vbsupport.ru/external/2008/08/25.gif Portugu?s (Portuguese)
https://vborg.vbsupport.ru/external/2008/08/26.gif Rom?nă (Romanian)
https://vborg.vbsupport.ru/external/2008/08/27.gif Русский Russian
https://vborg.vbsupport.ru/external/2008/08/28.gif Espa?ol (Spanish)
https://vborg.vbsupport.ru/external/2008/08/29.gif Svenska (Swedish)


Live Demo
Look for the "Translate" drop-down menu beside the "Display Modes" drop-down.

Digital Jedi 01-22-2008 03:45 AM

Additional "[Language] to..." Options (Step 2A)
If you would like more then the basic "English to..." functionality, add the block(s) of code of your choice underneath (or instead of) the code you added in Step 2. Then proceed to Step 3 in the first post.

*************UNDER DEVELOPMENT***********

ChurchMedia 01-22-2008 04:03 AM

First of all -- you're my official hero for the day. I was about to sign out for the day, but had to install this first. I really want to branch out to reach other languages but I haven't found an easy solution. This will work great!

A couple of things you should fix in your code.

1) You need to add </table></div> right before <!-- / Language Translator Menu -->.

2) For the links that need to be changed to your forum, some of them say www.YOURSITE.NET and some say www.cogonline.net.

3) The Greek flag is missing from the zip file.

Again, great mod!! Thanks! :)

Digital Jedi 01-22-2008 04:17 AM

Whoops. So much for proof reading. :D Thanks ChurchMedia. I'll correct that right away.

EDIT: Fixed both the lack of the closing tags, the demo URLs and added the missing Greek Flag to the zip. I'd forgotten Google added Greek.

punk23 01-22-2008 04:12 PM

GREAT MOD!! Can I make the pop up window wider please as it makes my site look u-g-l-y in a smaller window :)

Digital Jedi 01-22-2008 04:18 PM

Quote:

Originally Posted by punk23 (Post 1426739)
GREAT MOD!! Can I make the pop up window wider please as it makes my site look u-g-l-y in a smaller window :)

Yes, you can adjust the window size by editing each instance of width=800,height=800. But bear in mind that your users are all using different browser resolutions, and anything too much larger then 800px will create a window larger then the screen for some users.

punk23 01-22-2008 04:24 PM

Thank you - done and looking much better :)

MachMood 01-22-2008 04:49 PM

very very very usefull
thanx

dreads 01-22-2008 06:06 PM

Its really good yet it takes a bit longer to load for some weird reason

but in general very nice mod

Digital Jedi 01-22-2008 06:35 PM

Quote:

Originally Posted by MachMood (Post 1426766)
very very very usefull
thanx

No problem. Don't forget to click "Install". :D

Quote:

Originally Posted by dreads (Post 1426807)
Its really good yet it takes a bit longer to load for some weird reason

but in general very nice mod

Thanks much. Do you mean the Google window, or the page the menu is on? The menu shouldn't slow the page load at all, but Google's translation service can take a moment, and longer if their server is busy (which seems to be the case late at night, at least, locally.)

Lombardo 01-23-2008 05:04 PM

can't translate things to english it takes you to a translation page to do it yourself,can that be changed?

Digital Jedi 01-23-2008 08:45 PM

Quote:

Originally Posted by Lombardo (Post 1427462)
can't translate things to english it takes you to a translation page to do it yourself,can that be changed?

The English link is there as a courtesy mainly. The way Google's "Translate a Web Page" works is it has to know what language your translating to and from. So it is possible to get it to translate to English, but the starting language would always have to be the same, meaning ALWAYS Spanish to English or ALWAYS Dutch to English, etc. Likely not practical to most forums.

I may be able to come up with an modification to the modification (I just like saying that) that adds all of Google's [Insert Language] to English options. But it may take me a bit to make it practical and user friendly. I'll look into it.

Itworx4me 01-23-2008 10:55 PM

I have installed this mod. I also have vbseo installed and it doesn't play very friendly with the mod. I get red x's where images should be. Anyway of making this vbseo friendly?

Thanks,
Itworx4me

Digital Jedi 01-24-2008 12:31 AM

Quote:

Originally Posted by Itworx4me (Post 1427676)
I have installed this mod. I also have vbseo installed and it doesn't play very friendly with the mod. I get red x's where images should be. Anyway of making this vbseo friendly?

Thanks,
Itworx4me

Not without knowing more about vBSEO. My first impression though, presuming the link in your profile is the correct site, is that it's Google causing the problem and not a conflict with the two mods, per se. I took one of your threads and copy and pasted the URL into Google's "Translate a Web Page" directly, and it did the same thing. Apparently, each time it translates a page it thinks the images are in the same directory as your thread. So, for example, if there's a post icon in a thread in General Chat, Google thinks the icon is located at:

/general-chat/images/icons/icon10.gif

Rather than where it actually is, in:

/images/icons/icon10.gif

Same thing for an image in NHRA. It tacks /nhra just after the .com. I hate to leave it at that, but unless I know more about how vBSEO formats your threads, I'm afraid this is one of those "don't know" questions. For now anyway. I'll do my best to look into it.

Digital Jedi 01-24-2008 08:31 AM

Quote:

Originally Posted by Lombardo (Post 1427462)
can't translate things to english it takes you to a translation page to do it yourself,can that be changed?

Lombardo, and to anyone else interested, I added an alternative version of the mod that should do what you asked. Please see Post 2 for more information and let me know this works for you.

Lombardo 01-24-2008 12:56 PM

I can't get it too work mate,first thing its hard to keep your cursor over it to click it because it just closes and when i eventually get to click it nothing happens.

Digital Jedi 01-24-2008 02:04 PM

Well, that might be the problem. Your not supposed to click it. :) It just opens when you move your mouse over it. vBulletin menus just open once you've already opened a window. For example, try opening a regular drop down, and you'll notice when move your mouse over any of the other ones, they open and close without clicking. If you click them, you close it again.

That's what's been happening here. Just mouse over the menu like you would any other kind of drop down menu, and the sub menu will automatically open. If you try to click it, your just going to turn the menu off.

Lombardo 01-24-2008 07:51 PM

Yeah when i put my mouse over it it closes tho.

vbob 01-24-2008 08:30 PM

Hi,
My main Language of my forum is Greek. I want to translate Greek to English...etc...!!! When I press the menu to translate my thread to English, the pop up does not translate anything, but it just shows me the Google translation page...!!! What should I change to the code so it can be functional from Greek to any other language???
Edit: Hmm another issue: ...I have the "Welcome" mod for guests to show them a message and invite them to register to the site...!!! it seems that if the mod translates something from the thread it just translate the welcome message - because google isn't a registered user and sees that message!!!! Is there a way to make the mod tranlate the thread correctly? :-)
(Still...when I press the english flag, it just shows me the Google translation page only and doesn't do any translation)

Thank you...!!! :-)

Digital Jedi 01-24-2008 10:08 PM

Quote:

Originally Posted by Lombardo (Post 1428178)
Yeah when i put my mouse over it it closes tho.

It shouldn't. Can I see a link to where you have it installed?

Quote:

Originally Posted by vbob (Post 1428212)
Hi,
My main Language of my forum is Greek. I want to translate Greek to English...etc...!!! When I press the menu to translate my thread to English, the pop up does not translate anything, but it just shows me the Google translation page...!!! What should I change to the code so it can be functional from Greek to any other language???

See post two of this thread. That's the alternative if you want more [LANGUAGE] to English options.

If you don't want all those options, you could also just remove the block of code marked <!--English--> in the first version and replace it with the line of code marked <!--English To Greek--> in Post 2. EDIT: (Yes, I just realized I have that entire menu marked wrong. They shoud all be marked [LANGUAGE] to English, not English to [LANGUAGE])

Quote:

Edit: Hmm another issue: ...I have the "Welcome" mod for guests to show them a message and invite them to register to the site...!!! it seems that if the mod translates something from the thread it just translate the welcome message - because google isn't a registered user and sees that message!!!! Is there a way to make the mod tranlate the thread correctly? :-)
Unfortunately, no. Google can only translate what it can see. Or conversely, it will translate everything it sees. Basically this mod utilized 3rd party functionality, and as such, is limited by what the 3rd party offers. But I have presented the issue to Google. It remains to be seen when (or if) they'll get back to me. :)

Quote:

(Still...when I press the english flag, it just shows me the Google translation page only and doesn't do any translation)
See above. ;)

Quote:

Thank you...!!! :-)
No problem.

Digital Jedi 01-24-2008 10:26 PM

Okay, minor wording problem on the Post 2 <!--comments--> fixed. That would not have affected performance at all. But it sure would have made support a bit more confusing then it already is. :rolleyes:

Lombardo 01-24-2008 10:54 PM

my forum http://www.ucsampdoria.co.uk

Digital Jedi 01-24-2008 11:14 PM

Quote:

Originally Posted by Lombardo (Post 1428314)

Okay, I think I see the problem. It actually is opening. But it's opening way down towards the bottom of the next post. Remember in the instructions where I say that you may need to adjust this line margin-top:-308px to maintain the illusion that the menu is changing? That's what's happening here. The old menu is closing, but the new menu is opening in the wrong part of the screen.

I see you adjusted that line a little bit, setting -308 to -300. But actually, your going to need a larger negative number. Right now it looks like this:

Code:


  <!-- English to [LANGUAGE] Submenu -->
<div class="vbmenu_popup" id="english_menu" style="display:none;margin-left:0px;margin-top:-300px;">

Change the -300 to something like -600 and play around with that. Because everyone's styles are different, everyone will likely have to adjust that line to get it to line up just perfectly. The larger the negative number the higher it will go. The closer to 0 you get the lower it will go.

By the way, what browser are you using?

Digital Jedi 01-24-2008 11:23 PM

Ugh, apparently this is a browser compatibility thing. I just checked FireFox and it opens the menu in a completely different location. I can probably fix this. But I'll need some time.

Lombardo 01-24-2008 11:26 PM

so no point changing it?

apiasto 01-25-2008 07:10 AM

nice work,my question is could v add any other languages to the menu? thnx

baghdad4ever 01-25-2008 07:51 AM

thanks

vbob 01-25-2008 08:12 AM

I checked out again. Because guests can read (they have permissions) my forum that's not a problem for google(Google can see/read all the text needed)!!! Google just have "extra text" (the welcome message) to translate.... :-) :-) so everything is ok for guests and google !!!The only problem is that I have to change the From Language in First case of code..to Greek (the default is english)!!! The hover menu in second case, just don't work for me (I am using firefox). (and in general I think that many users will be confused too) I prefer to use the first case of code (the simplicity of the menu I mean) and not the alternative one.

I tested the second case (I added that "second case" part of code after the "Greek" in the first case of code - Not the alternative)

PHP Code:

<!--Greek to English-->
<
tr><td align="right" class="vbmenu_option"><a href="#" onClick="Fenster1=window.open('http://translate.google.com/translate?u=http%3A%2F%2Fwww.MYSITE.NET%2Fshowthread.php%3Ft%3D$thread[threadid]&langpair=el%7Cen&hl=en&ie=UTF-8','','directories=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no,menubar=no,width=800,height=800')">
<
span title="Greek">Greek</span> <img src="$stylevar[imgdir_button]/gr.gif" alt="Greek" width="15" height="10" border="0" /></a></td></tr

And it works fine...!!!
The question is that I want to translate from Greek to any language
What should i do for the rest languages?

Digital Jedi 01-25-2008 09:19 AM

The alternative code, and this my fault really, as I didn't check FireFox before I went to bed last night, wont necessarily work for cross browsers. Both browser require different lines of code to align them similarly. And everything I've looked at so far just seems inelegant from what I had intended. This is really my fault also for trying to get fancy with code I'm not all that familiar with.

I think I have a much simpler, more elegant solution for folks, without trying to get all fancy and cute. It should actually provide a solution for everyone. Just give me a few to edit Post 2. If it gets to late tonight (6 AM here), I'll try to have a replacement up by Friday night, barring flood or famine (or just forgetting to pay my Internet bill =/ ).

baghdad4ever 01-25-2008 09:26 AM

i love this mod but

sorry it is not work on IE

but it work on firefox

see this

http://www.baghdad4ever.net/vb/showt...362#post791362

vbob 01-25-2008 11:03 AM

Quote:

Originally Posted by Digital Jedi (Post 1428574)
The alternative code, and this my fault really, as I didn't check FireFox before I went to bed last night, wont necessarily work for cross browsers. Both browser require different lines of code to align them similarly. And everything I've looked at so far just seems inelegant from what I had intended. This is really my fault also for trying to get fancy with code I'm not all that familiar with.

I think I have a much simpler, more elegant solution for folks, without trying to get all fancy and cute. It should actually provide a solution for everyone. Just give me a few to edit Post 2. If it gets to late tonight (6 AM here), I'll try to have a replacement up by Friday night, barring flood or famine (or just forgetting to pay my Internet bill =/ ).

:-)

I believe that this mod is wonderful!!! :-)
(and thank you for your mod) :-)
To solve any problems, You should begin with the rule "keep it simple". :-)
If I were you, i would give 3 kind of different "Code situations" so anyone can fit the code in his needs. :-)

1) Make a script that can translate FROM: Any* Language TO: English (that could be very useful as English language is the Language that most of people could understand). So if someone have a i.e. Greek language board, can use the Greek to English option to be sure that at least the translation to the basics will be done for sure. :-)
*= by "Any language" I mean the languages that you already have in the script. :-)
2) Give people an example of "how to" transform existing code to make the script translate from "Any" to "Any" language he like (all the combinations) :-)
3) Make sure the code is simple (so it is surelly supported from all browsers)
4) Then make any experiments and supply people with the script that can do tricks like the one you've done as alternative.

So people can really have a code fitted to their needs, and working for sure. As for the alternative, they could experiment them selfs with various of browsers and give you feedback too. :-)

I hope I helped somehow. :-)
(keep up the good work...!!! I love that mod, thank you. Looking forward for the new "working in all browsers and flexible" (Greek to English...Greek to Any, Any to Any) version.....):-)

(ohh...it would be useful to have icons with words too in the menu like the way I show you below.
for example
[Icon_Country_Flag] Greek to [Icon_Country_Flag] English
[Icon_Country_Flag] Greek to [Icon_Country_Flag] German
.
.
.
etc......

(the ideal should be to recognize the language automatically and the user could just select the language he like to translate "to", but its is difficult and could have problems) :-)

vbob 01-25-2008 06:46 PM

Quote:

Originally Posted by baghdad4ever (Post 1428580)
i love this mod but

sorry it is not work on IE

but it work on firefox

see this

http://www.baghdad4ever.net/vb/showt...362#post791362

For me (my site) it Works fine Both in Firefox and I.E. and Opera too...!!! :-)
I checked your site and yes it have problem with I.E.

Check Out my forum and try to translate from Greek to English if you like to see if you have problem with I.E., Opera, and Firefox there...!!! :-)

http://madseeds.com/forum

Here is the Code I used for my forum (Step.2)

PHP 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">Translate</td></tr>
 


<!--
Greek to English-->
<
tr><td align="right" class="vbmenu_option"><a href="#" onClick="Fenster1=window.open('http://translate.google.com/translate?u=http%3A%2F%2Fwww.madseeds.com/forum%2Fshowthread.php%3Ft%3D$thread[threadid]&langpair=el%7Cen&hl=en&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">Greek to English Translation</span> <img src="$stylevar[imgdir_button]/us.gif" alt="English" width="15" height="10" border="0" /></a></td></tr>
 
  
   </
table></div>
 
  <!-- / 
Language Translator Menu --> 


(I also Changed the "Language" title to "Translation" title..!!!)
Later when i find some time I will fix it for the other languages too if I can..!!! :-)
I prefer to have simple menus so any unexperienced user can use it...(I mean that I want the menu to work to all browsers for sure)!!! :-)

yeku 01-26-2008 01:23 AM

Hello, my forum is in Spanish.

What I have to do modifications because you do not work

I need you to help me please.

thanks

Digital Jedi 01-26-2008 09:57 AM

Okay, guys. This took me a bit longer to put together then I thought it would. I'm sure it's not completely perfect, but see post 2 of this thread again. You can now add a link to all the available language options that Google offers.

Vbob, thanks for letting me know about the translation working in Greek. That's really the only thing about this mod that I can't test myself, so thanks much for the feedback. And thanks also for the suggestions. I was thinking along the same lines as well.

Baghad4ever, I'm sorry. But it appears to be an issue with Google and IE. My uneducated guess would be that is has something to do with the fact that their is a "vb" in your thread URLs. One other user had the same problem with way his URLs were formatted. Still, I can't imagine why FireFox would translate just fine and IE wouldn't. But at the moment, I don't know why.

Apiasto, see the new version I added to post 2 just now.

Yeku, what problems are you having exactly? If your trying find a Spanish to English translator, I only just added that now in post 2.

yeku 01-26-2008 11:47 AM

Quote:

In order to accept POST request originating from this domain, the admin must add this domain to the whitelist.
This is the answer, in admincp, I have "google.com/language_tools" and "translate.google.com/translate?"

Also when I try to make a translation, finalize session:erm:

What do I do wrong??

pd: Alternative 2, post n?2

Lombardo 01-26-2008 12:09 PM

In order to accept POST request originating from this domain, the admin must add this domain to the whitelist.

I get that too when i try to translate Italian to english all the rest work fine,just this.

baghdad4ever 01-26-2008 02:40 PM

thanks my dear

but my forum is arabic lang

so

only translate to english would be work

bec the google option only from arabic to english

so how can i made another translations to be work??

vbob 01-26-2008 02:57 PM

Quote:

Originally Posted by Digital Jedi (Post 1429217)
Vbob, thanks for letting me know about the translation working in Greek. That's really the only thing about this mod that I can't test myself, so thanks much for the feedback. And thanks also for the suggestions. I was thinking along the same lines as well.

You are welcome Digital Jedi. I am glad I helped. Thanks for your mod..!!! :-)
It is working fine for me (Greek to English and English to Greek Translation, tested in Firefox, I.E., Opera) :-)

Digital Jedi 01-26-2008 03:18 PM

Lombardo, yeku, in order for Google to translate a page, it needs to be able to see your page. So you'd need Guest browsing enabled, as you wont be able to log in from a translated page. I'm sorry, that's just how Google's service works.

baghdad4ever, what additional languages are you looking for? Have you tried the other language options yet? Sorry if I'm misunderstanding you.

Vbob, that's good to know. Feel free to ping this thread if you run into any other problems.

Lombardo 01-26-2008 03:30 PM

Works now mate,thanks a lot for your efforts mate.Its much appreciated.


All times are GMT. The time now is 10:34 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.02930 seconds
  • Memory Usage 1,907KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (16)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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