M
M
Maxim2010-10-21 23:25:01
Google
Maxim, 2010-10-21 23:25:01

Google translate to translate site without top frame

Google translate is great for me to translate the site, but the top frame with the logo confuses me.
I tried to load the lower frame separately, but there is a security code that changes.

Are there alternative services? I would not like to use the API - there is no time for this. It's like the last option.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
ponemetski, 2010-10-22
@ponemetski

you can remove
www.google.com/webelements/#show-translate

D
Desiderata, 2011-02-23
@Desiderata

I recently encountered a similar problem myself.
Here's my not-too-elegant JQuery solution, in case it's useful to someone.

function DeleteGoogleIframe()
{
    // Проверяем есть ли на странице фрейм гугла.
    // Если у вас на сайте есть другие фреймы, данную запись придется менять.
    if($("iframe").length)
    {
        // Ожидаем пока фрейм прогрузится
        $("iframe").load(function()
        {
            // Прячем панель гугла через 250мс (таймаут был подобран экспериментально)
            // Без использования таймаута убрать панель мне не удалось.
            setTimeout(function()
            {
                // прячем панель
                $("iframe").hide();
            }, 250);
        });
    }
}

The call to the DeleteGoogleIframe function must be added to the code placed on the site page:
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'ru',
    includedLanguages: 'en,ru'
  }, 'google_translate_element');
DeleteGoogleIframe();
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

In addition, you need to track the language selection event:
$('.goog-te-combo').live('change', DeleteGoogleIframe);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question