Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Forum Translator by Google Details »»
Forum Translator by Google
Version: 1.00, by Infopro Infopro is offline
Developer Last Online: Jun 2016 Show Printable Version Email this Page

Category: End-User Options - Version: 4.1.0 Rating:
Released: 01-28-2011 Last Update: Never Installs: 151
Template Edits
Re-useable Code Translations  
No support by the author.

I'm not sure if anyone else has posted this, if so I apologize. I did find some other earlier versions of mods to use Google Translate, but could not find one similar and as simple to use as this.

In the footer template, find the first instance of:

Code:
</form>
Just below it add this:

Code:
<!-- Translate vBulletin -->
<div id="google_translate_element" class="footer_select"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en',
    multilanguagePage: true,
    gaTrack: true,
    gaId: 'UA-12345-12',
    layout: google.translate.TranslateElement.InlineLayout.SIMPLE
  }, 'google_translate_element');
}
</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!-- /Translate vBulletin -->
Remove the 2 lines in red if you don't use Google Analytics. If you do, edit the number to your own.

It's so simple I think this would work on any version of vB.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
CarpCharacin, Code Geass, hexeditor, Toorak Times

Comments
  #22  
Old 01-31-2011, 12:00 PM
Infopro Infopro is offline
 
Join Date: May 2003
Location: Pennsylvania
Posts: 267
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zelnik View Post
Using Firefox is anyone getting a constant "transferring data from translate.googleapis.com" in the status bar?!?!

Doesn't seem to do it on Chrome or IE?
Sounds like some sort of plugin preventing the connection if I was to guess.

I suppose another solution to using this might be to clone your main theme as a child style (so that any changes made to the parent are made to child as well) and name it multi-language. Make that style available on the style selector and only use this translator on that style, not the default.

If a guest visits and see this style and selects it, they would then be given the option to change language.

Just an idea of course.
Reply With Quote
  #23  
Old 01-31-2011, 12:17 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Infopro View Post
I suppose another solution to using this might be to clone your main theme as a child style (so that any changes made to the parent are made to child as well) and name it multi-language. Make that style available on the style selector and only use this translator on that style, not the default.

If a guest visits and see this style and selects it, they would then be given the option to change language.

Just an idea of course.
That's an excellent idea ...

Regards,
Doug
Reply With Quote
  #24  
Old 02-01-2011, 05:58 AM
RK KINGKONG RK KINGKONG is offline
 
Join Date: May 2010
Location: NEW JERSEY
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i second that installed
Nominated
rated..

very nice mod
Quote:
Originally Posted by Hippy View Post
installed
Nominated
rated..

very nice mod
Reply With Quote
  #25  
Old 02-01-2011, 09:07 PM
CharlieDelta CharlieDelta is offline
 
Join Date: Apr 2010
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Simple, neat and fantastic!
Reply With Quote
  #26  
Old 02-01-2011, 09:14 PM
Danasy Danasy is offline
 
Join Date: Jun 2008
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice mod, thank you!
Reply With Quote
  #27  
Old 02-04-2011, 08:03 AM
zelnik zelnik is offline
 
Join Date: Aug 2008
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Infopop.

Got an odd one for you.

A user on my site is claiming that ever since I installed this modification that it loads a toolbar on his browser?!?!

Supposedly it only happens on my site and doesn't show up when he is browsing other sites?
Reply With Quote
  #28  
Old 02-04-2011, 08:18 AM
Infopro Infopro is offline
 
Join Date: May 2003
Location: Pennsylvania
Posts: 267
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ask him to grab a screenshot that you can post here, for fun, to take a peek. There are no popups added to this from Google that I'm aware of.
Reply With Quote
  #29  
Old 02-04-2011, 12:32 PM
zelnik zelnik is offline
 
Join Date: Aug 2008
Posts: 374
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Infopro View Post
Ask him to grab a screenshot that you can post here, for fun, to take a peek. There are no popups added to this from Google that I'm aware of.
Unfortunately the user is not very computer literate but has pasted the following he gets on the screen, I've googled the text and found nothing and I've installed every damn toolbar on the planet and can not replicate it.

"Ver esta p?gina en: espa?ol Traductor de Google Desactivar para: ingl?s
Traducci?n en curso (%) Cancelar
Traducido al: Mostrar texto original
Error: el servidor no ha podido completar la solicitud. Vuelve a intentarlo m?s tarde.
M?s informaci?n "
Reply With Quote
  #30  
Old 02-04-2011, 01:20 PM
gosiah23's Avatar
gosiah23 gosiah23 is offline
 
Join Date: Jun 2009
Location: Morehead City NC
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Infopro, I would love to have this right below the header or somewhere at the top of the forum so every visitor would see it. How do I do this?

Thanks,

Margaret
Reply With Quote
  #31  
Old 02-04-2011, 02:06 PM
Infopro Infopro is offline
 
Join Date: May 2003
Location: Pennsylvania
Posts: 267
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zelnik View Post
Unfortunately the user is not very computer literate but has pasted the following he gets on the screen, I've googled the text and found nothing and I've installed every damn toolbar on the planet and can not replicate it.

"Ver esta p?gina en: espa?ol Traductor de Google Desactivar para: ingl?s
Traducci?n en curso (%) Cancelar
Traducido al: Mostrar texto original
Error: el servidor no ha podido completar la solicitud. Vuelve a intentarlo m?s tarde.
M?s informaci?n "
From what I can make out of that message, it is indeed from Google, if I was to guess.

Something about timing out. Is this user on a dialup connection or old computer maybe? No clues, but if this continues for this user and others you might try my suggestion above to hide it from some user groups.

I can't really comment on the code for how this works or Googles servers responses of course. I have nothing to do with Google. I'm just adding some code from google to a forum. If that code from Google does not work properly, not much I can do except to suggest removing this, or hide it for specific user groups. If a user is bothered by it, add them to a special addon usergroup that can't see it, for example.

@gosiah23

Shouldn't be too much trouble, point me to exactly where you'd like to see it.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:59 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10037 seconds
  • Memory Usage 2,337KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete