vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   End-User Options - Forum Translator by Google (https://vborg.vbsupport.ru/showthread.php?t=258009)

Crogge 02-07-2011 09:16 PM

Quote:

Originally Posted by Infopro (Post 2159801)
...

I'm not sure I understand the increased loading time thing. Pages don't load any slower with this in footer that I can see.

...

Well my forums loads normally in 1-2 seconds for me and with this modification it takes 4-5 seconds minimum because its connecting to Google first even if its not in use (No translation).

BadgerDog 02-07-2011 09:36 PM

Quote:

Originally Posted by Crogge (Post 2159938)
Well my forums loads normally in 1-2 seconds for me and with this modification it takes 4-5 seconds minimum because its connecting to Google first even if its not in use (No translation).

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

Dr.osamA 02-07-2011 10:35 PM

Excellent = 5 stars

installed

thank you

SuperTaz 02-09-2011 11:11 PM

Simple and easy. Thank you. Nominated also.

8thos 02-09-2011 11:52 PM

Slowed my site down a lil bit. Uninstalled.

jitsuboy 02-10-2011 05:35 AM

Anyway to put this in the header instead?

OldSchoolDSL 02-18-2011 11:20 PM

Nominated Mod of The Month

This worked wonderfully on my test site, but because I use CometChat... Which already adds to my load ... I will not be able to use this on my community.

thr45h3r 02-19-2011 01:56 AM

Clean easy and works great :)

Marked Installed

Thanks

BlueCheri 02-19-2011 12:15 PM

Great!

Installed and nominated :)

Thanx

scottct1 02-22-2011 01:46 PM

Quote:

Originally Posted by Crogge (Post 2159938)
Well my forums loads normally in 1-2 seconds for me and with this modification it takes 4-5 seconds minimum because its connecting to Google first even if its not in use (No translation).

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.

BadgerDog 02-22-2011 07:14 PM

Quote:

Originally Posted by scottct1 (Post 2165421)
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

guru1221 03-06-2011 01:55 AM

thanks installed

karlm 03-09-2011 02:10 PM

Quote:

Originally Posted by BadgerDog (Post 2165550)
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.

LeventX 03-10-2011 11:35 AM

Thank you..Installed..

SkyStryder 03-11-2011 06:33 PM

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

COL NIL SATIS 03-17-2011 09:24 PM

Installed!!!!!!! great work man

Marv 03-18-2011 04:35 AM

Quote:

Originally Posted by karlm (Post 2171409)
seconded.

gr8 idea btw dev.

Quote:

Originally Posted by BadgerDog (Post 2165550)
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 (Post 2159748)
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 (Post 2159752)
That's what I was trying to say, albeit badly, in my post above, repeated here:

Quote:

Originally Posted by BadgerDog (Post 2159950)
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 ?

Juggernaut 03-18-2011 05:32 AM

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. :)

Infopro 03-21-2011 12:56 PM

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.

MAdotcom 03-22-2011 05:11 PM

Very cool thanks!!!

Baghira 03-26-2011 02:24 PM

Wow, Cool. Thanks.

Simple and effective

LeventX 05-12-2011 08:50 AM

Perfect....Thank you.Installed..

billstelling 05-15-2011 11:38 PM

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.

BadgerDog 05-16-2011 10:19 AM

Quote:

Originally Posted by billstelling (Post 2196153)
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

billstelling 05-17-2011 03:11 AM

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.

raj4x 05-26-2011 02:14 PM

Quote:

Originally Posted by billstelling (Post 2196153)

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.

raj4x 05-26-2011 02:19 PM

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?

TheLastSuperman 05-26-2011 03:38 PM

Quote:

Originally Posted by raj4x (Post 2200221)
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.

raj4x 05-28-2011 09:05 AM

Quote:

Originally Posted by TheLastSuperman (Post 2200241)
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. :)

billstelling 05-28-2011 01:00 PM

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.

UltrasWorldwide 07-06-2011 06:17 AM

this is exactly what i was looking for. thanks for posting. I edited it for VERTICAL and placed it in a block....looks great.

sisterhood 07-06-2011 06:47 AM

Wau! Extra Nice Thy u

MysteriousSoul 07-14-2011 08:30 AM

Really nice, thanks :)

WIJI SEJATI 09-06-2011 08:26 AM

Thank You

galerio 09-08-2011 09:21 PM

Uninstall it: google will discontinue the translation tool and you have to pay if you want to use it.

Infopro 09-09-2011 02:23 PM

Not yet they haven't. So far so good I guess. ;)

The Rocketeer 09-10-2011 01:33 AM

Quote:

On May 26, 2011, Google announced that the Google Translate API had been deprecated and that it would cease functioning on December 1, 2011 "due to the substantial economic burden caused by extensive abuse."
That sucks...

o well.. so far so good ;)

Infopro 09-10-2011 01:46 AM

Should give us plenty of time to use it for creating language packs. :D

Scalemotorcars 10-04-2011 02:24 PM

Im having some issues with jquery and this code. It still works but its pushing any jquery popup over to the right of the forum.

Anyone else run into this.

This is the offending code.

Code:

<script>
function googleTranslateElementInit() {new google.translate.TranslateElement({
        pageLanguage: 'en',    gaTrack: true,}, 'google_translate_element');
}
</script>


Tag Yazid 10-07-2011 10:27 AM

Thanks allot for this


All times are GMT. The time now is 12:53 PM.

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.01421 seconds
  • Memory Usage 1,839KB
  • 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
  • (5)bbcode_code_printable
  • (1)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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