vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Forum Display Enhancements - UKBL ~ Easy Google Translator (https://vborg.vbsupport.ru/showthread.php?t=202949)

UKBusinessLive 01-23-2009 10:00 PM

UKBL ~ Easy Google Translator
 
1 Attachment(s)
UKBL ~ Easy Google Translator


Hi Everyone, :)

Made this for a friends forum and thought i'd share it here :D

Just a Simple Google translator which you can add to your forums, displays in a small Dropdown box in the Forum Home and posibit wrapper.

https://vborg.vbsupport.ru/external/2009/01/22.png

Then you can add the dropdown box in the postbit wrapper so that the option to translate is available with every post ;)

https://vborg.vbsupport.ru/external/2009/01/23.png

Just click on a language and within seconds your posts is converted to a language of your choice

https://vborg.vbsupport.ru/external/2009/01/24.png

Your Members will be able to chose from the following,

Arabic
Chinese Simplified
Chinese Traditional
Dutch
French
German
Greek
Italian
Japanese
Korean
Russian
Spanish
Portuguese

There are loads more available, if you want any lanuage in particular, just post here and i'll add it on

Nice, So how do we add it???

1. Download the zip file with the code and instructions

2. Styles & Templates > All Style Options > Edit Template > Forum home template: FORUMHOME

Find:

Code:

$navbar
Below add:

Code:

<!-- UKBL ~ Easy Translation on forumhome -->

<DIV ALIGN=RIGHT>
<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
<option value="">Translate This Page</option>
<option value="ar">Arabic</option>
<option value="zh-CN">Chinese Simplified</option>
<option value="zh-TW">Chinese Traditional</option>
<option value="nl">Dutch</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="pt">Portuguese</option>
<option value="ru">Russian</option>
<option value="es">Spanish</option>
</select>
</DIV>

<!-- UKBL ~ Easy Translation on forumhome -->

Styles & Templates > All Style Options > Edit Template > Postbit Templates > postbit_wrapper

find

Code:

<!-- post #$post[postid] -->
Then below add

Code:

<!-- UKBL ~ Easy Translation on postbit_wrapper -->

<DIV ALIGN=CENTER>
<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
<option value="">Translate This Page</option>
<option value="ar">Arabic</option>
<option value="zh-CN">Chinese Simplified</option>
<option value="zh-TW">Chinese Traditional</option>
<option value="nl">Dutch</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="el">Greek</option>
<option value="it">Italian</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="pt">Portuguese</option>
<option value="ru">Russian</option>
<option value="es">Spanish</option>
</select>
</DIV>

<!-- UKBL ~ Easy Translation on postbit_wrapper -->

Thats it, So easy and a great treat for your members ;)

As always Please Click installed if you use this :rolleyes:

************************** UPDATED LANGUAGE PACK *********************

Here is an updated language pack, just replace your existing ones with the ones below

Code:

<option value="ar">Arabic</option>
<option value="bg">Bulgarian</option>
<option value="zh-CN">Chinese Simplified</option>
<option value="zh-TW">Chinese Traditional</option>
<option value="hr">Croatian</option>
<option value="cs">Czech</option>
<option value="da">Danish </option>
<option value="nl">Dutch</option>
<option value="en">English</option>
<option value="fi">Finnish</option>
<option value="ph">Filipino</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="il">Hebrew</option>
<option value="el">Greek</option>
<option value="it">Italian</option>
<option value="id">Indonesian</option>
<option value="lv">Latvian</option>
<option value="lt">Lithuanian</option>
<option value="hi">Hindi</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="no">Norwegian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="ro">Romanian</option>
<option value="ru">Russian</option>
<option value="es">Spanish</option>
<option value="sv">Swedish</option>
<option value="rs">Serbian</option>
<option value="sk">Slovak</option>
<option value="si">Slovenian</option>
<option value="ua">Ukrainian</option>
<option value="vn">Vietnamese</option>

Feel Free to add or delete any you don't want, I'll add more as i get them :rolleyes:

Please Click Installed for unlimited support ;)

UKBusinessLive 01-24-2009 03:55 PM

:D Reserved ;)

TheLastSuperman 01-24-2009 07:29 PM

Ohh been sick today but as soon as I feel a bit better... consider TheLastSuperman as installed!!!

I was just about to do this for my forums so you saved me the trouble and btw nice job and idea!

Mike

UKBusinessLive 01-24-2009 08:27 PM

Quote:

Originally Posted by TheLastSuperman (Post 1723611)
Ohh been sick today but as soon as I feel a bit better... consider TheLastSuperman as installed!!!

I was just about to do this for my forums so you saved me the trouble and btw nice job and idea!

Mike


Thanks Mike :D

Hope you feel better soon mate ;)

TheLastSuperman 01-24-2009 09:11 PM

#4, sorry for the lateness & Thanks! Better already and about to go to Wendy's and KILL a combo lol!

I put mine in navbar on forum home, then the footer for a while so they notice then I will remove, then in all my subforums as some are in different styles in the footer at the very top which makes it just below the box stating:

Quote:

Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Again, many thanks for the great insight UK!

Edit: Demo: --> http://www.tournamentgamingworld.com...splay.php?f=21
Bottom Left below the box as I described.

Edit Again lol: I might change the location to be in w/ the upper code where it says "Display Options" and that will make more sense eh? :D

S-MAN

phoxitin 01-24-2009 11:54 PM

Hi UKBusinessLive,

Can you add language vietnamese ??

thanks,

UKBusinessLive 01-25-2009 08:08 AM

Quote:

Originally Posted by phoxitin (Post 1723802)
Hi UKBusinessLive,

Can you add language vietnamese ??

thanks,

Hi Phoxitin

To add the Vietnamese option just add this to the bottom of your list of language options

Code:

<option value="vn">Vietnamese</option>
That should do it ;)

I'm doing to update the languages later, I only did those ones as they were the ones required, if i add them all (about 35) you'll be able to delete the ones you don't want.

Take care

:D

UKBusinessLive 01-25-2009 10:14 AM

************************** UPDATED LANGUAGE PACK *********************

Here is an updated language pack, just replace your existing ones with the ones below

Code:

<option value="ar">Arabic</option>
<option value="bg">Bulgarian</option>
<option value="zh-CN">Chinese Simplified</option>
<option value="zh-TW">Chinese Traditional</option>
<option value="hr">Croatian</option>
<option value="cs">Cczech</option>
<option value="da">Danish </option>
<option value="nl">Dutch</option>
<option value="en">English</option>
<option value="fi">Finnish</option>
<option value="ph">Filipino</option>
<option value="fr">French</option>
<option value="de">German</option>
<option value="il">Hebrew</option>
<option value="el">Greek</option>
<option value="it">Italian</option>
<option value="id">Indonesian</option>
<option value="lv">Latvian</option>
<option value="lt">Lithuanian</option>
<option value="hi">Hindi</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="no">Norwegian</option>
<option value="pl">Polish</option>
<option value="pt">Portuguese</option>
<option value="ro">Romanian</option>
<option value="ru">Russian</option>
<option value="es">Spanish</option>
<option value="sv">Swedish</option>
<option value="rs">Serbian</option>
<option value="sk">Slovak</option>
<option value="si">Slovenian</option>
<option value="ua">Ukrainian</option>
<option value="vn">Vietnamese</option>

Feel Free to add or delete any you don't want, I'll add more as i get them :rolleyes:

Please Click Installed for unlimited support ;)

TandyServices 01-25-2009 10:51 AM

Great work.. I have alot of different people in and think this will help..

UKBusinessLive 01-25-2009 01:32 PM

Quote:

Originally Posted by TandyServices (Post 1724118)
Great work.. I have alot of different people in and think this will help..


Thanks James :up:

MAK-upl 01-27-2009 01:19 AM

You have little mistake in languages. There is Cczech, should be Czech :)

I have translated all names into Polish (in alphabetical order of course) :)

Code:

<DIV ALIGN=RIGHT>
<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=pl&langpair=pl%7C' + this.value + '&u=' + window.location.href;">
<option value="">Przetłumacz Stronę Na:</option>
<option value="en">Angielski</option>
<option value="ar">Arabski</option>
<option value="bg">Bułgarski</option>
<option value="zh-TW">Chiński Tradycyjny</option>
<option value="zh-CN">Chiński Uproszczony</option>
<option value="hr">Chorwacki</option>
<option value="cs">Czeski</option>
<option value="da">Duński</option>
<option value="ph">Filipiński</option>
<option value="fi">Fiński</option>
<option value="fr">Francuski</option>
<option value="el">Grecki</option>
<option value="il">Hebrajski</option>
<option value="hi">Hindi</option>
<option value="es">Hiszpański</option>
<option value="id">Indonezyjski</option>
<option value="ja">Japoński</option>
<option value="ko">Koreański</option>
<option value="lt">Litewski</option>
<option value="lv">Łotewski</option>
<option value="nl">Niderlandzki</option>
<option value="de">Niemiecki</option>
<option value="no">Norweski</option>
<option value="pl">Polski</option>
<option value="pt">Portugalski</option>
<option value="ru">Rosyjski</option>
<option value="ro">Rumuński</option>
<option value="rs">Serbski</option>
<option value="sk">Słowacki</option>
<option value="si">Słoweński</option>
<option value="sv">Szwedzi</option>
<option value="ua">Ukraiński</option>
<option value="vn">Vietnamski</option>
<option value="it">Włoski</option>
</select>
</DIV>

And of course, Great Work! :)

UKBusinessLive 01-27-2009 03:57 AM

Thanks for that, :D

MAK-upl 01-27-2009 11:44 AM

You still didn't correct the Cczech name in languages list :P It should be Czech :P

UKBusinessLive 01-27-2009 03:03 PM

Quote:

Originally Posted by MAK-upl (Post 1726091)
You still didn't correct the Cczech name in languages list :P It should be Czech :P

just going to do it now, been at work all day :D

Fungsten 01-27-2009 09:12 PM

Installed on 3.8.1 BUT, it pushes the forum home to the right with a gap on the left. And it really jumbled up the posts within threads. TIA.

aircool52 01-28-2009 04:06 AM

Do not work from spanish to english?
Google
Error


Translation from English into English is not supported.
Please choose from the following:

Go back to the previous page"
Back to Translate
See original page

aircool52 01-28-2009 11:05 AM

I have it installes ,but most of the time do not translate nathing.

UKBusinessLive 01-28-2009 02:11 PM

Hi,

So you want to translate english to english ???

What exactly is it thats not working???

:confused:

UKBusinessLive 01-28-2009 02:16 PM

Quote:

Originally Posted by Fungsten (Post 1726523)
Installed on 3.8.1 BUT, it pushes the forum home to the right with a gap on the left. And it really jumbled up the posts within threads. TIA.

Hi,

Have you added it to the right part in your template as explained above??? Works fine on my forum http://www.ukbusinesslive.co.uk/forum

post here the code which you used, remember there are Two Codes one for the header and one for the postbit wrapper

All i think could be happening is that you've put the code in between something ??

let me know and we'll get it sorted :D

Fungsten 01-28-2009 07:12 PM

Quote:

Originally Posted by UKBusinessLive (Post 1727252)
Hi,

Have you added it to the right part in your template as explained above??? Works fine on my forum http://www.ukbusinesslive.co.uk/forum

post here the code which you used, remember there are Two Codes one for the header and one for the postbit wrapper

All i think could be happening is that you've put the code in between something ??

let me know and we'll get it sorted :D

On Edit:

In postbit_wrapper:

Quote:

</select>
</td>
</DIV>
<!-- UKBL ~ Easy Translation on postbit_wrapper -->
Add in the </td>

In the forumhome:

Quote:

$navbar
<tr>
<td>
<!-- UKBL ~ Easy Translation on forumhome -->
<DIV ALIGN=RIGHT>
Put in the <tr> <td>

Then make sure to close.

Quote:

<!-- UKBL ~ Easy Translation on forumhome -->
</td>
</tr>
<if condition="$show['guest']">
BUT, when clicking on translate I have to log back in again then it shows no translation; even though it says that it is the translation. TIA.

MAK-upl 01-30-2009 01:00 AM

aircool52 it won't work because you've pasted wrong language shortcuts in the link.
In UK's code there is a link given, right after <DIV ALIGN=RIGHT>:
Code:

<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
The only thing you need to do is to set up proper shortcuts of your language.
For spanish language it will be es.

Here is an example for you:
Code:

<DIV ALIGN=RIGHT>
<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=es&langpair=es%7C' + this.value + '&u=' + window.location.href;">


KrU$ty 02-03-2009 10:13 AM

i was hoping you could tell me how i could add this translation mod to the end of the menu mod you released the other day?

My forum has tabs in it, and so adding it under the navbar looks pretty messy.

UKBusinessLive 02-03-2009 06:51 PM

Quote:

Originally Posted by KrU$ty (Post 1732914)
i was hoping you could tell me how i could add this translation mod to the end of the menu mod you released the other day?

My forum has tabs in it, and so adding it under the navbar looks pretty messy.

Experiment ;) Add it to the Footer, or the Top of the forumhome template, Try it and see is the best bet, Remember to back up your template files first ;)

KrU$ty 02-03-2009 07:50 PM

Quote:

Originally Posted by UKBusinessLive (Post 1733334)
Experiment ;) Add it to the Footer, or the Top of the forumhome template, Try it and see is the best bet, Remember to back up your template files first ;)

I did experiment, and couldn't get it to work in the drop down menu mod, that's why i'm asking you about it in this thread. :)

UKBusinessLive 02-03-2009 08:13 PM

Quote:

Originally Posted by KrU$ty (Post 1733379)
I did experiment, and couldn't get it to work in the drop down menu mod, that's why i'm asking you about it in this thread. :)

Oh i see what you mean, In that case select a language that you want to make a tab for, say german, you'll see an url like this as the page translates

HTML Code:

http://translate.google.com/translate?hl=en&langpair=en%7Cde&u=http://www.ukbusinesslive.co.uk/forum/index.php
You just use this in the Url part of the menu tabs and with a discription of Translate to German in the tab, But i can't see you adding 30+ tabs for all the different languges :confused:

aircool52 02-04-2009 04:15 PM

My vb is in Spanish , but some of the participant came from UK and like to read it in English , so when I choose language translator gave me this error:
Google
Error

Translation from English into English is not supported.
Please choose from the following:

Go back to the previous page"
Back to Translate
See original page

UKBusinessLive 02-04-2009 04:34 PM

Quote:

Originally Posted by aircool52 (Post 1734367)
My vb is in Spanish , but some of the participant came from UK and like to read it in English , so when I choose language translator gave me this error:
Google
Error

Translation from English into English is not supported.
Please choose from the following:

Go back to the previous page"
Back to Translate
See original page

Hola Amigo :rolleyes:

Thats because your using the default english setup, what you need to do is find this line in the begining of the code

Code:

<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
and in the google url chnage the following In red to es

google. com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href

so it looks like this..

google .com/translate_c?hl=en&langpair=es%7C' + this.value + '&u=' + window.location.href

and save, thats it, what your doing is telling google that your main lauguage is spanish, and now you'll be able to translate your spanish site into english :D

aircool52 02-04-2009 05:07 PM

ho??? thanks man it works find now.

compact123 02-04-2009 08:38 PM

Can you add language turkish ?

thank for your hard waork sir..

UKBusinessLive 02-04-2009 11:41 PM

Quote:

Originally Posted by compact123 (Post 1734616)
Can you add language turkish ?

thank for your hard waork sir..

Hello Sir, unforunately Turkish is not available at the moment from Google, The full list of languages are here http://www.google.com/intl/en/help/f...html#langpairs.

keep checking regularly as they do add everynow and again ;)

akvaryumforum 02-05-2009 12:11 PM

In google translate home turkish supported, But in faq page its shown as not supported.

UKBusinessLive 02-05-2009 04:16 PM

Quote:

Originally Posted by akvaryumforum (Post 1735100)
In google translate home turkish supported, But in faq page its shown as not supported.

I'll look at this now and see if we can get something working for our Turkish Friends
:)

Done it,

Right all you need to do is this

First in the code find this line

Code:

<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
<option value="">Translate This Page</option>

Now thats ok, for websites that are normally in English, But if you have a Turkish website then you'll need to change the code a little

Firstly in that line of code find the google url and the bits you need to change is in red

google . com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">

Now the en tells google your site is in english, well we need to change that to Turkish so change that for tr, the 2 letter country code for Turkey

So now your code should look something like...

Code:

<td nowrap style="border-left: 1px solid #dddddd;" align="center"> <select name="translate" style="height:20px; font-size:11px;" onchange="javascript:window.location = 'http://www.google.com/translate_c?hl=tr&langpair=tr%7C' + this.value + '&u=' + window.location.href;">
<option value="">Translate This Page</option>

Thats the first bit, secondly we need to add Turkish to the list of options so at the bottom, Below spanish, add a new option line for our Turkish Translation like this...

Code:

<option value="tr">Turkish</option>
Once you've done that, save and refresh your site, you'll be able to translate Turkish to the world :D

Enjoy :up:

akvaryumforum 02-05-2009 07:15 PM

Thanks

Fungsten 02-05-2009 10:10 PM

Quote:

Originally Posted by Fungsten (Post 1727479)

BUT, when clicking on translate I have to log back in again then it shows no translation; even though it says that it is the translation. TIA.


Bump.

UKBusinessLive 02-06-2009 05:00 AM

Quote:

Originally Posted by Fungsten (Post 1735582)
Bump.

Sorry Buddy, Must of forgotten about you :eek:

Tell me a bit more of what your trying to do?? What country are you in?? and where you've added your code.

What languages are you translating to show you that error???

Perhaps a link would allow me to see the problem first hand, PM me if you do not want to post the link, but prefer to send it to me.

Thanks, we'll try and sort this for you today ;)

compact123 02-06-2009 10:33 AM

thanks for turkish suupport sir :D

good luck...

Fungsten 02-06-2009 04:36 PM

Quote:

Originally Posted by UKBusinessLive (Post 1735806)
Sorry Buddy, Must of forgotten about you :eek:

Tell me a bit more of what your trying to do?? What country are you in?? and where you've added your code.

What languages are you translating to show you that error???

Perhaps a link would allow me to see the problem first hand, PM me if you do not want to post the link, but prefer to send it to me.

Thanks, we'll try and sort this for you today ;)

Check your PMs.

UKBusinessLive 02-06-2009 05:07 PM

Quote:

Originally Posted by Fungsten (Post 1736253)
Check your PMs.

Have Replied ;)

Winterworks 02-08-2009 10:35 AM

Wow, Uk!

I'm starting to really love your work mate...

My new forum software, this would be perfect as a language chooser, as it translates everything.

Thank you mate ;)
[high]* Winterworks installs[/high]

lgnd 02-08-2009 01:03 PM

Installed thanks! How can add this into the navbar? Thanks!


All times are GMT. The time now is 05:46 AM.

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.01527 seconds
  • Memory Usage 1,883KB
  • 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
  • (14)bbcode_code_printable
  • (1)bbcode_html_printable
  • (20)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