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
  #62  
Old 03-26-2011, 02:24 PM
Baghira Baghira is offline
 
Join Date: Mar 2011
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, Cool. Thanks.

Simple and effective
Reply With Quote
  #63  
Old 05-12-2011, 08:50 AM
LeventX's Avatar
LeventX LeventX is offline
 
Join Date: Nov 2010
Location: Turkey
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perfect....Thank you.Installed..
Reply With Quote
  #64  
Old 05-15-2011, 11:38 PM
billstelling's Avatar
billstelling billstelling is offline
 
Join Date: Apr 2011
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<!-- Translate vBulletin -->
<style>
.goog-te-banner-frame{display: none !important;}
body{top: 0px !important;}
</style>

<style>
.goog-te-balloon-frame{display: none !important;}
font{background: transparent !important;}
</style>

<div id="google_translate_element" class="footer_select"></div><script>
function googleTranslateElementInit() {new google.translate.TranslateElement({
         pageLanguage: 'en',    gaTrack: true,}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!-- /Translate vBulletin -->
there is no pop up in this one and instead it is a list like the theme selector and also the stuff wont pop up when you mouse over text.. much more user friendly.. you can check it out on my site www.thewindowscenter.com. I found the changed code on google dev.
I want to change the powered by google to the right of it instead on under it if anyone can figure that one out. or get rid of that part all together.. either way is fine with me.
Reply With Quote
  #65  
Old 05-16-2011, 10:19 AM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by billstelling View Post
there is no pop up in this one and instead it is a list like the theme selector and also the stuff wont pop up when you mouse over text.. much more user friendly.. you can check it out on my site www.thewindowscenter.com. I found the changed code on google dev.
I want to change the powered by google to the right of it instead on under it if anyone can figure that one out. or get rid of that part all together.. either way is fine with me.
Thanks ... :up:

Do you put your gaId: in anywhere, or is it necessary?

Also, any idea how to make the mod appear ONLY if the user acessing the site has his browser set for anything other than English? This is a nice mod, but it does dramatically slow down the home page display by up to a few seconds, depending upon how busy the access is to Google to get the code. It would be great for us if it only went out to Google to get the code and offer the translate option if the accessing user's browser was not set for English.

Regards,
Doug
Reply With Quote
  #66  
Old 05-17-2011, 03:11 AM
billstelling's Avatar
billstelling billstelling is offline
 
Join Date: Apr 2011
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no i didn't put it in with it. stopped using adsense and gaId.. you can add that part back if you do.. I guess an andif parameter could be added, I'm just not sure of how to do it for there product. will take a better coder.. I'm still leaning it all. I can do mods and what not to existing code but not good enough you to do my own stuff. I just figure it out by trial and error..
but i do like this one and like you wish it was a bit more configurable.
Reply With Quote
  #67  
Old 05-26-2011, 02:14 PM
raj4x raj4x is offline
 
Join Date: May 2011
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by billstelling View Post

I want to change the powered by google to the right of it instead on under it if anyone can figure that one out. or get rid of that part all together.. either way is fine with me.
Add/change to:

PHP Code:
layoutgoogle.translate.TranslateElement.InlineLayout.HORIZONTAL 
That should put the text on right side next to box.
Still finding a way to remove the whole thing, might not be possible.

Cheers, Raj.
Reply With Quote
  #68  
Old 05-26-2011, 02:19 PM
raj4x raj4x is offline
 
Join Date: May 2011
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did anyone notice the translation does not "stick"...?

If you select a language on a page/thread and click on new thread, it's back to the default language again?
Reply With Quote
  #69  
Old 05-26-2011, 03:38 PM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by raj4x View Post
Did anyone notice the translation does not "stick"...?

If you select a language on a page/thread and click on new thread, it's back to the default language again?
Works fine for me navigating, usually takes a second to reload the page - translated of course.... "New Thread" though might be the issue besides you don't want everyone posting in languages you can't admin so best for it to return to your default language as a reminder per say imo.
Reply With Quote
  #70  
Old 05-28-2011, 09:05 AM
raj4x raj4x is offline
 
Join Date: May 2011
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TheLastSuperman View Post
Works fine for me navigating, usually takes a second to reload the page - translated of course.... "New Thread" though might be the issue besides you don't want everyone posting in languages you can't admin so best for it to return to your default language as a reminder per say imo.
Yep, works now, thanks.
Reply With Quote
  #71  
Old 05-28-2011, 01:00 PM
billstelling's Avatar
billstelling billstelling is offline
 
Join Date: Apr 2011
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<!-- Translate vBulletin -->
<style>
.goog-te-banner-frame{display: none !important;}
body{top: 0px !important;}
.goog-te-balloon-frame{display: none !important;}
font{background: transparent !important;}
</style>
<div id="google_translate_element" class="footer_select"></div><script>
function googleTranslateElementInit() {new google.translate.TranslateElement({
layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,
         pageLanguage: 'en',    gaTrack: true,}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!-- /Translate vBulletin -->
this is how i have it now.
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 08:11 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.05108 seconds
  • Memory Usage 2,341KB
  • 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
  • (4)bbcode_code
  • (1)bbcode_php
  • (4)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