Exemple:
HTML & JAVASCRIPT
<div id="google_translate_element"> </div>
<p>
<script type="text/javascript">// <![CDATA[
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'fr', includedLanguages: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
changeGoogleTranslate();
}
function changeGoogleTranslate() {
if ($("#google_translate_element .goog-te-menu-value > span:first-of-type").text() == "Sélectionner une langue") {
$("#google_translate_element .goog-te-menu-value > span:first-of-type").html('');
$("#centerText").val('');
} else {
setTimeout(changeGoogleTranslate, 50);
}
}
// ]]></script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</p>
CSS
/* CSS */
/* Modification de la boite de traduction de google */
.goog-te-gadget-icon{
background-image:url('/uploaded/95445/drapeau.png') !important;
background-position:center center !important;
background-size: auto auto !important;
background-repeat: no-repeat;
}
#google_translate_element{
position:fixed;
top:20px;
left:0;
z-index:9999;
}
#google_translate_element span, #google_translate_element .goog-te-gadget-simple{
border:transparent !important;
background:transparent;
}
#google_translate_element .goog-te-menu-value{
margin-left:-10px !important;
}
Leave feedback about this