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
  #52  
Old 02-22-2011, 07:14 PM
BadgerDog BadgerDog is offline
 
Join Date: Oct 2006
Location: Toronto
Posts: 1,789
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by scottct1 View Post
I have had to uninstall it from mine because of this issue.

I hope they can fix it as its a great mod, but I was getting to many complaints from people.
If we could get an "if then ..." statement to check for the standard language, then the mod wouldn't execute and hence the Google load delay wouldn't happen, except in the case where the user was connecting with a language other than the site default. If the latter, then I don't think he's going to mind the delay if he's able to use the mod to get the site displayed in his own native language.

Regards,
Doug
Reply With Quote
  #53  
Old 03-06-2011, 01:55 AM
guru1221 guru1221 is offline
 
Join Date: Jun 2009
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks installed
Reply With Quote
  #54  
Old 03-09-2011, 02:10 PM
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Location: England
Posts: 447
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BadgerDog View Post
If we could get an "if then ..." statement to check for the standard language, then the mod wouldn't execute and hence the Google load delay wouldn't happen...
seconded.

gr8 idea btw dev.
Reply With Quote
  #55  
Old 03-10-2011, 11:35 AM
LeventX's Avatar
LeventX LeventX is offline
 
Join Date: Nov 2010
Location: Turkey
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you..Installed..
Reply With Quote
  #56  
Old 03-11-2011, 06:33 PM
SkyStryder SkyStryder is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awesome. I have installed it. Some people have mentioned that it is
slowing down the page load. I believe that will only happen if you
are using the Google Analytics lines. Unfortunately, Google Analytics
does add a delay when the page is loaded. They usually specify to
put it in the header but I put it in the footer to reduce "apparent" load time.
It does mean that if the user aborts before the page is fully loaded, it
won't be counted.

Thank you!
Rick
Reply With Quote
  #57  
Old 03-17-2011, 09:24 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed!!!!!!! great work man
Reply With Quote
  #58  
Old 03-18-2011, 04:35 AM
Marv Marv is offline
 
Join Date: Jun 2002
Location: Germany
Posts: 372
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by karlm View Post
seconded.

gr8 idea btw dev.
Quote:
Originally Posted by BadgerDog View Post
If we could get an "if then ..." statement to check for the standard language, then the mod wouldn't execute and hence the Google load delay wouldn't happen, except in the case where the user was connecting with a language other than the site default. If the latter, then I don't think he's going to mind the delay if he's able to use the mod to get the site displayed in his own native language.

Regards,
Doug
Quote:
Originally Posted by Crogge View Post
I really like this modification, though I noticed a increased loading time because it is connecting to the Google servers each time. Is there a possibility to use this modification and let it access the Google servers only when you actually need it?
Quote:
Originally Posted by BadgerDog View Post
That's what I was trying to say, albeit badly, in my post above, repeated here:
Quote:
Originally Posted by BadgerDog View Post
Yup ... +1 ...

Anyway, on the other matter, what I'm trying to say ... is it possible to make the execution of this mode conditional?

In other words, wrap the mod in IF THEN code?

ie: If the language is NOT English, then execute this code

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 -->
ELSE do not execute the mod....

Is that any clearer and is it possible to create such a conditional?

Thanks for any help ...

Regards,
Doug
+1. Anyone ?
Reply With Quote
  #59  
Old 03-18-2011, 05:32 AM
Juggernaut Juggernaut is offline
 
Join Date: Dec 2009
Location: California
Posts: 589
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The if condition should be doable. I wonder if someone will come up with the code here, will keep an eye out, as I haven't tried anything myself.
Reply With Quote
  #60  
Old 03-21-2011, 12:56 PM
Infopro Infopro is offline
 
Join Date: May 2003
Location: Pennsylvania
Posts: 267
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not aware of a language conditional. If you have a link to one we could surely use it.

There are usergroup conditionals of course, and an option to use one was posted earlier in this thread.
Reply With Quote
  #61  
Old 03-22-2011, 05:11 PM
MAdotcom MAdotcom is offline
 
Join Date: Aug 2010
Posts: 76
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool thanks!!!
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:52 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.05193 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
  • (3)bbcode_code
  • (7)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