Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you style the google translate plugin?

I'm using this plugin (http://translate.google.com/translate_tools) to translate my website. The problem is that I can't figure out how to style it so it does not fit with the rest of the page.

Any suggestions?

like image 885
Vasseurth Avatar asked Jul 09 '11 06:07

Vasseurth


People also ask

Can you customize the Google Translate widget?

To tweak a translation: Hover over a translated sentence to display the original text. Click on 'Contribute a better translation' And finally, click on a phrase to choose an automatic alternative translation —or just double-click to edit the translation directly.

How do I change the font on Google Translate?

Google translate at Google translate site has it's own styles which you cannot change; and Google translate data you probably get from this site cannot change the styles you define on your site. No font size is reducing "due to Google Translate". Google Translate does not have access to your site.

How do I overlay Google Translate?

To use Tap to Translate, copy the text you want to translate, then tap the Tap to Translate overlay icon. Tap to Translate will automatically paste and translate the contents of your clipboard when you tap the overlay icon. The translation will be shown in a partial screen overlay.

Does Google Translate have widgets?

Add the widgetThis feature is only available for devices with Android 5 and above. Learn how to check your Android version. You must install the Google Translate app.


1 Answers

Sure you can style anything that renders out on your page.

Here is a part of the rendered mark-up:

<div id="google_translate_element">
  <div class="skiptranslate goog-te-gadget" style="">
    <div id=":1.targetLanguage">
    <select class="goog-te-combo">
    </select>
  </div>
Powered by
  <span style="white-space: nowrap;">

  </span>
</div>

You can take a look at what goog-te-combo renders out and override it with your own styles like this:

<style>
    .goog-te-gadget {
        font-size: 19px !important;
    }    
</style>

Depending on what it is exactly that you want to change this method can be used for any of the styles rendered out in their classes or to extend them.

like image 58
Mike Veigel Avatar answered Sep 28 '22 05:09

Mike Veigel