简体   繁体   English

如何从谷歌翻译中删除或隐藏由文本提供支持

[英]How to remove or hide powered by text from Google Translate

Is it possible to hide or remove the Powered by Google Translate on the dropdown in Google Translate?是否可以隐藏或删除 Google 翻译下拉菜单中的Powered by Google Translate Translate?

I have removed the logo part, but couldn't remove the Powered by text.我已删除徽标部分,但无法删除Powered by文本。

Here's the code:这是代码:

<div id="google_translate_element"></div>
<script type="text/javascript">
    function googleTranslateElementInit() {
      new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL}, 'google_translate_element');
    }
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

You can add these lines of code in your CSS file:您可以在 CSS 文件中添加这些代码行:

.goog-logo-link {
    display:none !important;
} 
    
.goog-te-gadget{
    color: transparent !important;
}

This CSS worked for me:这个 CSS 对我有用:

.goog-logo-link {
   display:none !important;
}

.goog-te-gadget {
   color: transparent !important;
}

.goog-te-gadget .goog-te-combo {
   color: blue !important;
}

Although, previous answers regarding display: none and color: transparent may work.虽然,以前关于display: nonecolor: transparent的答案可能会起作用。 I use this solution to completely erase text from html , if you want lets say style the box itself.我使用这个解决方案来完全擦除 html 中的文本,如果你想设置框本身的样式。

$(window).load(function(){
    $(".goog-logo-link").empty();
    $('.goog-te-gadget').html($('.goog-te-gadget').children());
})

I use jQuery in this example, however you can switch to JavaScript if you want.我在这个例子中使用了 jQuery,但是你可以根据需要切换到 JavaScript。

Add the css to your stylesheet将 CSS 添加到您的样式表

#google_translate_element {
  color: transparent;
}
#google_translate_element a {
  display: none;
}

The first line will hide the text and the second line will hide the google translate logo.第一行将隐藏文本,第二行将隐藏谷歌翻译徽标。

Test it in all browsers to make sure you do not hide make the dropdown text transparent.在所有浏览器中测试它以确保您不隐藏使下拉文本透明。 If so, add this:如果是这样,请添加:

select.google_translate_element {
  color: black;
}

to remove the "Powered by" text删除“Powered by”文本

div.goog-te-gadget {
  color: transparent !important;
}

Note: I am not sure whether it is within the terms and conditions of use that you are allowed to hide the Google logo, but this should work.注意:我不确定您是否可以在使用条款和条件范围内隐藏 Google 徽标,但这应该可以。

If you decrease the height and hide the overflow, you will hide this area on the screen.如果您降低高度并隐藏溢出,您将在屏幕上隐藏该区域。 Maybe not a very good solution, but it can be a good alternative.也许不是一个很好的解决方案,但它可以是一个很好的选择。

<style> 
    #google_translate_element { height: 26px !important; overflow: hidden !important; }
</style>

You can try using this link.您可以尝试使用此链接。 => https://www.w3schools.com/howto/tryit.asp?filename=tryhow_google_translate => https://www.w3schools.com/howto/tryit.asp?filename=tryhow_google_translate

I am using following to remove google poweredby link or image我正在使用以下内容删除 google 支持的链接或图片

#google_translate_element img
        {
            display: none !important;
        }

Try this to remove logo from language translator i am sure试试这个从语言翻译器中删除标志,我敢肯定

$(window).load(function () {
  $(".goog-logo-link").parent().remove();
  $(".goog-te-gadget").html(
    $(".goog-te-gadget").html().replace('&nbsp;&nbsp;Powered by ', '')
  );
});
.goog-te-gadget {line-height: 2px !important;color: transparent;}

Simply add this..只需添加这个..

.goog-logo-link {display:none !important; } 
.goog-te-gadget {font-size:0px !important;}

Review image OR To remove powered by TEXT in Google Translate api, You can simply add this css.查看图片或删除 Google 翻译 api 中的 Powered by TEXT,您只需添加此 css。

.goog-te-gadget {
    font-size: 0px;
}

Tried the code above and it did work to hide the "Powered by", but it did remove the not the Google Translate section.尝试了上面的代码,它确实可以隐藏“Powered by”,但它确实删除了不是 Google Translate 部分。 What I did and it worked was add below code to the google-language-translators style.css in the css folder within the plugin.我所做的工作是将以下代码添加到插件内的 css 文件夹中的 google-language-translators style.css中。

.goog-logo-link, .goog-logo-link:link, .goog-logo-link:visited, .goog-logo-link:hover, .goog-logo-link:active {
    color: #444;
    **display: none;**
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
}

See Plugin active on http://sethucurryhouse.com/请参阅 http://sethucurryhouse.com/ 上的插件活动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Chrome 中禁用来自 HTML 的谷歌翻译 - How to disable Google translate from HTML in Chrome 如何避免谷歌翻译翻译:参数 - How to avoid google translate to translate :parameters 如何使用 Google Cloud Translate 获取英文字母的翻译文本发音? - How to get translated text pronunciation in english letters using Google Cloud Translate? 将 age() function 从 postgreSQL 翻译成 Google Bigquery - Translate age() function from postgreSQL to Google Bigquery 从谷歌翻译中获取多个变体 API - Get multiple variations from Google Translate API Google 翻译 API V3:如何从文件流中验证服务帐户 - Google translate API V3: How to authenticate service account from file stream 谷歌翻译 API 文字转语音:http 请求被禁止 - Google Translate API text-to-speech: http requests forbidden 谷歌翻译 select 菜单索引问题 - 如何自动将 select 语言翻译成? - google translate select menu indexing problem - how to automatically select language to translate to? 如何翻译来自 Firebase 身份验证的错误代码? - how to translate the error code from Firebase Authentication? 谷歌翻译定价 api - Pricing for google translate api
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM