Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

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
  #102  
Old 05-19-2013, 11:37 AM
svyrydov svyrydov is offline
 
Join Date: Jan 2012
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

working fine on 4.2.1
Reply With Quote
Благодарность от:
Toorak Times
  #103  
Old 05-21-2013, 04:12 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I see now. This is not really a mod but rather just a snippet from Google. Instead of using this it works better to go to the Google translate page. place the first section in your headincludes and then the last section in your footer. Do it this way and it will somewhat match your site.

When I first installed this I did it quickly because a client wanted it and I did not even realize it was just a snippet from Google. Funny how people post these like they have created a mod or something.

In addition posting it after </form> may not work for many sites depending on what they have in their footer. I suggest posting it at the very bottom but I also suggest not using this code here but use the code directly from Google translate so you end up with the code in your headincludes.
Reply With Quote
Благодарность от:
K4GAP
  #104  
Old 03-14-2015, 12:31 AM
goarack goarack is offline
 
Join Date: Nov 2012
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks That was Pretty simple
Reply With Quote
  #105  
Old 07-21-2015, 10:58 AM
billstelling's Avatar
billstelling billstelling is offline
 
Join Date: Apr 2011
Posts: 246
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Some css I created to mod it a bit.. After coding this in for vB again today I also noticed that it is persistent even if you close the browser.



Code:
.goog-te-gadget-simple {
    border: none !important;
    border-style: solid;
    border-radius: 3px;
    border-color: rgb(222, 222, 222);
	-webkit-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.6);
	-moz-box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.6);
	box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.6);
    background: none repeat scroll 0% 0% rgb(244, 244, 244);
    font-size: 14pt;
    display: inline-block;
    margin-top: 23px;
    padding-top: 1px;
    padding-bottom: 1px;
    cursor: pointer;
}
.goog-te-gadget-simple .goog-te-menu-value span {
    text-decoration: none;
    color: #000 !important;
    font: 14px "Droid Sans",sans-serif,Arial,sans-serif;
}
.goog-te-gadget-icon {
    background-image: none !important;
    border: none !important;
    height: 0px !important;
    margin-left: 0px !important;
    margin-right: 0px !important;
    vertical-align: middle;
    width: 0px !important;
}
#goog-gt-tt {
    
    visibility: hidden !important;
}
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}
.goog-te-banner-frame {
    border-color: -moz-use-text-color -moz-use-text-color #FD7D16 !important;
    box-shadow: 0 0 8px 1px #FD7D16 !important;
}
Reply With Quote
  #106  
Old 02-14-2019, 09:15 PM
Scalemotorcars's Avatar
Scalemotorcars Scalemotorcars is offline
 
Join Date: Mar 2006
Location: NC
Posts: 619
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a note that this messes with the center alignment of highslide if you're using it. It works great but I need the image enlarger more than the translator.
Reply With Quote
  #107  
Old 04-16-2023, 02:21 AM
oldfan's Avatar
oldfan oldfan is offline
 
Join Date: Jul 2004
Posts: 813
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great on 4.2.6. php 7.2
Reply With Quote
Reply

Thread Tools

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 11:10 PM.


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.06672 seconds
  • Memory Usage 2,283KB
  • Queries Executed 22 (?)
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
  • (3)bbcode_code
  • (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
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (6)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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