PDA

View Full Version : Add-On Releases - Language Changer for Vbulletin


billstelling
08-20-2011, 10:00 PM
This is a little add on for VB so your members can switch the site to their chosen language.
I have it in the footer but if you know what you are doing you can put it just about anywhere. It will work in the header or footer like I have it now. If you are new at VB it's not to hard with a little trial and error to get it were you want it.
UPDATED 9/12/2011
to change margin and padding
to chance font color
<!-- Translate vBulletin -->
<style>
.goog-te-banner-frame{
display: none !important;
}
.goog-te-balloon-frame{
display: none !important;
}
.goog-te-gadget {
font-size: 0px;
color #333333;
}
.goog-te-gadget img {
display: none !important;
}
.goog-te-combo {
margin-left: 14px;
margin-right: 14px;
vertical-align: baseline;
}
.goog-te-gadget .goog-te-combo {
margin: 0px 0px 0px 0px;
border: 0px solid #444444;
float:right;
}
.goog-logo-link, .goog-logo-link:link, .goog-logo-link:visited, .goog-logo-link:hover, .goog-logo-link:active {
display: none !important;
}
.goog-te-combo, .goog-te-banner *, .goog-te-ftab *, .goog-te-menu *, .goog-te-menu2 *, .goog-te-balloon * {
font-family: none;
font-size: none;
color: #ffffff;
}
body{
top: 0px !important;
}
font{
clear: both !important;
color:auto !important;
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.HOR IZONTAL,
pageLanguage: 'en', gaTrack: true,}, 'google_translate_element');
}
</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<!-- /Translate vBulletin -->

I have placed it after this for the theme I am using..
example:
this is the start of footer templet
{vb:raw ad_location.ad_footer_start}
{vb:raw ad_location.global_above_footer}
<div id="footer" class="floatcontainer footer">

<form action="{vb:link forumhome|nosession}" method="get" id="footer_select" class="footer_select">


<vb:if condition="$show['quickchooser']">
<select name="styleid" onchange="switch_id(this, 'style')">
<optgroup label="{vb:rawphrase quick_style_chooser}">
{vb:raw quickchooserbits}
</optgroup>
</select>
</vb:if>

<vb:if condition="$show['languagechooser']">
<select name="langid" onchange="switch_id(this, 'lang')">
<optgroup label="{vb:rawphrase quick_language_chooser}">
{vb:raw languagechooserbits}
</optgroup>
</select>
</vb:if>
</form>

This is from the start of the footer template for common templates down to </form> and I put it after that.


I found parts for doing this from here and from Google's code for the translator. It took a little trial and error to get it this far but it works really good so i have decided to let every one check it out but keep in mind we are still working on improving it.

Credit goes To me, Mark over at Virtual Customs as well as those whose code we started out with.

If you can make it any better feel free to do so and post up what you have here.

You can also change colors of the text for different parts of as you can see in the code. Just play around with it and you will figure out which is which.

Bugs.
! so far. It will preempt the color of text in post bits.. So if you have posted coloring you text it shows up white on the forum. But not in the editor.. go figure. But I dont color my text so it doesn't bother me a bit, but we are working on it. If you figure it out let me know.

Mr GRiM
08-21-2011, 10:27 PM
Nice one Bill, lets see if we can get the collective to improve on this a bit :)

NightLord
08-22-2011, 12:02 AM
very nice, thank you

thedvs
08-22-2011, 04:57 AM
works fine in firefox, chrome, but when using IE, I get a powered by text before the language chooser box

AdrianH
08-22-2011, 09:46 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=258009&highlight=Google+translation" target="_blank">https://vborg.vbsupport.ru/showt...le+translation</a>

HMBeaty
08-22-2011, 02:48 PM
https://vborg.vbsupport.ru/showthread.php?t=258009&highlight=Google+translation
This one has a slighly different layout

leejohn02
08-22-2011, 07:51 PM
u should really say where to put both the codes, for css and footer, that way it will help people who cant code work out where is best to put both

billstelling
08-25-2011, 02:47 PM
only one "code" and it goes in the footer.. every theme is different so.... placement will be slightly different. As I said it goes after </form>
try reading what I wrote.. It's pretty much a no brainer.

billstelling
09-12-2011, 04:40 PM
Just letting everyone know that the mod has been updated.

Nirjonadda
10-22-2015, 03:25 PM
Please can you make this mod without manual template edit?

billstelling
10-22-2015, 06:27 PM
I might consider it once I get some free time. I will keep it under consideration though..