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)

Hippy 02-04-2011 02:16 PM

1 Attachment(s)
with ie8 i noticed the Google Translator coming on just under the tabs.. but it don't stay there..
I wouldn't call it a tool bar...

I also think it could be disabled.. in ie or jsy tick the little box on the right of the bar..

screen shot ...attached

gosiah23 02-04-2011 02:50 PM

1 Attachment(s)
Infopro, thanks for your reply. These are 2 options I like. Whatever is easier, but I think the 1st choice will look better.

See attached image.

Attachment 126408

Thanks a million for this mod and your help!

Margaret

BadgerDog 02-04-2011 03:22 PM

We use Google Analytics and it provides a breakdown that shows visitors to our site by what language they're using.

It follows that there must be a variable on connection that can be interrogated to determine that information?

Would anyone know how to do that, so that we could have this mod display ONLY if the user is connecting using anything except English?

Thanks for any feedback.. :)

Regards,
Doug

Infopro 02-04-2011 06:12 PM

1 Attachment(s)
Quote:

Originally Posted by gosiah23 (Post 2158722)
Infopro, thanks for your reply. These are 2 options I like. Whatever is easier, but I think the 1st choice will look better.

See attached image.


Thanks a million for this mod and your help!

Margaret



Well, this is not perfect I don't think, but should put you in the right direction.

In your navbar template, find:

Code:

        <vb:if condition="$vboptions['enablesearches']">
Just above it place this:

Code:

<!-- Translate vBulletin -->
<div style="position:absolute; right:200px;top:28px;" id="google_translate_element" class="select"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'en',
    multilanguagePage: true,
    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 -->

You really should want that style stuff added to your CSS instead of here but this will place it up by the Advanced Search text as you wanted for now. (see attachment, added to vB default style)

I didn't want to spend much time on this today but If I find some time I'd like to tweak the CSS and js to not be called from Google. In doing so the drop down and menu could be styled a bit nicer to match your site.

The stuff inside the div can be placed where ever you like, the js should be placed as close to the bottom of your page as possible for speed. That's why I originally placed it in footer.

In looking into the CSS end of this I did find one small tweak some might like:

Simply add this to the additional.css template to hide the "toolbar thing" and the balloon tips.

Code:

/* gtranslate */
.goog-te-banner-frame{display: none !important;}
body{top: 0px !important;}
.goog-te-balloon-frame{display: none !important;}
font{background: transparent !important;}
/* gtranslate */


Shamelessly stolen tip from here:

http://www.google.com/support/forum/...48c8591e&hl=en

Lots can be done with this. Just depends on how much playtime you have to experiment. :)

Infopro 02-04-2011 06:16 PM

Quote:

Originally Posted by BadgerDog (Post 2158728)
We use Google Analytics and it provides a breakdown that shows visitors to our site by what language they're using.

It follows that there must be a variable on connection that can be interrogated to determine that information?

Would anyone know how to do that, so that we could have this mod display ONLY if the user is connecting using anything except English?

Thanks for any feedback.. :)

Regards,
Doug

Not sure I follow you, but did you add your GA code to this? (marked in red in first post)

As for ONLY display if user is connecting using anything other than English, well, you can look at the google site in an earlier post and select your options yourself. Then just add your new code where this old code is located. This can be set to automatically translate and other things.

gosiah23 02-04-2011 06:31 PM

Infopro, many thanks again! I will give it a try :)

Margaret

imran_khatri 02-07-2011 09:27 AM

but how to add URDU lang in it becouse Google Translater has urdu but this don't have. any sulotion?

Crogge 02-07-2011 12:54 PM

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?

BadgerDog 02-07-2011 01:09 PM

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?

That's what I was trying to say, albeit badly, in my post above, repeated here:

Quote:

Originally Posted by BadgerDog (Post 2158728)
We use Google Analytics and it provides a breakdown that shows visitors to our site by what language they're using.

It follows that there must be a variable on connection that can be interrogated to determine that information?

Would anyone know how to do that, so that we could have this mod display ONLY if the user is connecting using anything except English?

Thanks for any feedback.. :)

Regards,
Doug


Infopro 02-07-2011 03:50 PM

Quote:

Originally Posted by imran_khatri (Post 2159703)
but how to add URDU lang in it becouse Google Translater has urdu but this don't have. any sulotion?

In the code find:
Code:

    pageLanguage: 'en',
Add this below:
Code:

    includedLanguages: 'ur'
On the Translate Tools Site is where you'd generate the code if you need advanced options, you should have a close look there and at the auto generated code it provides.

Quote:

Originally Posted by BadgerDog (Post 2159752)
That's what I was trying to say, albeit badly, in my post above, repeated here:

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.

If you mean the same thing as this comment:

Quote:

getting a constant "transferring data from translate.googleapis.com" in the status bar?!?!
as mentioned earlier, this is google's code. I can't account for the connection or accuracy of this tool. I didn't make the translator, I only added it to vB using the code I've shared here. I do not think that message in the footer of your browser is a problem, nor slowing page load speed when it's not being used.

When it is in use, sure the time it takes translate a page and finish "transferring data from translate.googleapis.com" to your browser there might be some delay.


All times are GMT. The time now is 04:06 AM.

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.01188 seconds
  • Memory Usage 1,756KB
  • 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
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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