Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

451
Visualizações
Google Translate has stopped working on Chrome, Safari and Opera (still works on Firefox)

Some time ago the Google section translate function has stopped working on most browsers (excluding Firefox), resulting in blank page with "about:blank#blocked" address when someone click on TRANSLATE link under the post (example post, does not need to log in or register to use translate feature: https://www.elvikom.pl/hp-probook-6560b-cure-uma-hr-hpb-mv-mb-v1-sam-sie-uruchamia-t65407.html).

I found that piece of code on stackoverflow: Google Translate shows blank screen in Chrome but I do not know where to place it exactly. Tried to add it right before closing </head> tag as well as right after opening <body> tag but cannot get this code working.

My code right after opening <body> tag (still works on Firefox):

<script>
function googleSectionalElementInit() {
  new google.translate.SectionalElement({
    sectionalNodeClassName: 'goog-trans-section',
    controlNodeClassName: 'goog-trans-control',
    background: '#f4fa58'
  }, 'google_sectional_element');
}
</script>
<!-- IF S_USER_LANG eq 'pl' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=pl"></script>
<!-- ELSEIF S_USER_LANG eq 'ru' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=ru"></script>
<!-- ELSEIF S_USER_LANG eq 'en' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script>
<!-- ELSEIF S_USER_LANG eq 'sl' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=sl"></script>
<!-- ELSEIF S_USER_LANG eq 'de' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=de"></script>
<!-- ELSEIF S_USER_LANG eq 'it' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=it"></script>
<!-- ENDIF -->

And my template (html) code:

<div class="goog-trans-section">{postrow.MESSAGE}<br /><br /><a href="javascript:void(0);"><span class="goog-trans-control"></span></a></div>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Just a moment after I have posted my question, I've tried to put that suggested code inside the function googleSectionalElementInit() function. So my current code right after opening <body> tag looks like that:

<script>
function googleSectionalElementInit() {
  new google.translate.SectionalElement({
    sectionalNodeClassName: 'goog-trans-section',
    controlNodeClassName: 'goog-trans-control',
    background: '#f4fa58'
  }, 'google_sectional_element');
 $(document).ready(function(){
  setTimeout( function() {
   $(".goog-te-gadget-link").click(function(){
    $(this).attr('href', 'javascript:;');
   });
  }, 2000);
 });
}
</script>
<!-- IF S_USER_LANG eq 'pl' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=pl"></script>
<!-- ELSEIF S_USER_LANG eq 'ru' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=ru"></script>
<!-- ELSEIF S_USER_LANG eq 'en' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=en"></script>
<!-- ELSEIF S_USER_LANG eq 'sl' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=sl"></script>
<!-- ELSEIF S_USER_LANG eq 'de' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=de"></script>
<!-- ELSEIF S_USER_LANG eq 'it' -->
<script src="//translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl=it"></script>
<!-- ENDIF -->

And now the translate function works perfectly fine on Chrome, Opera and Safari :)

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda