1

I have translated a webpage with google translate. But when we get curser over translated text, text disappears.

Can anyone tell how to solve this?

http://careturtle.com/firebase/translate_test.php

<!doctype html>
<html>
    <head>
        <title>Translator</title>
        <script type="text/javascript" src="jquery.min.js"></script>
        <script src="jquery.cookie.js"></script>    
        <style type="text/css">
        .goog-te-banner-frame.skiptranslate{display:none!important;}
        body{top:0px!important;}
        div#goog-gt-tt{display:none!important;}.goog-text-highlight{display:none!important;opacity:0;}
        </style>
    </head>
    <body>
        <script type="text/javascript">
        $.cookie('googtrans', '/en/hi');
        </script>
        <div id="google_translate_element" style="display: none;"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', 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>
    This is a test website.
    </body>
</html>
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Observer
  • 345
  • 1
  • 4
  • 21

2 Answers2

0

I have added the style for the <p> tag in which the google class is appending and hiding the element. That not acutely blinking.

Hope might help you

thanks

<!doctype html>
<html>
    <head>
        <title>Translator</title>
        <script type="text/javascript" src="jquery.min.js"></script>
        <script src="jquery.cookie.js"></script>    
        <style type="text/css">
        .goog-te-banner-frame.skiptranslate{display:none!important;}
        body{top:0px!important;}
        div#goog-gt-tt{display:none!important;}.goog-text-highlight{display:none!important;opacity:0;}
        </style>
<style>
p.appearnone font font{
        display: block !important;
        opacity: 1 !important
}
</style>
    </head>
    <body>
        <script type="text/javascript">
        $.cookie('googtrans', '/en/hi');
        </script>
        <div id="google_translate_element" style="display: none;"></div><script type="text/javascript">
function googleTranslateElementInit() {
  new google.translate.TranslateElement({pageLanguage: 'en', 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>
    <p class="appearnone">This is a test website.
    </body>
</html>
ankit verma
  • 616
  • 5
  • 17
0

Replacing .goog-text-highlight with below code worked.

.goog-text-highlight { background: none !important; box-shadow: none !important;}

Reference: How to disable google translate original text tooltips

Community
  • 1
  • 1
Observer
  • 345
  • 1
  • 4
  • 21