简体   繁体   English

仅使用Bing转换器Web小部件翻译页面的某些部分

[英]Translate certain parts of the page only with Bing translator web widget

Our website is offered in 10 different languages with all static content already translated by external vendors. 我们的网站以10种不同的语言提供,所有静态内容已由外部供应商翻译。 We have a requirement to translate certain parts of the page we do not have in advance. 我们需要翻译我们没有的页面的某些部分。

The Translator Widget from Bing looks good except that it translates the whole page instead of only certain parts of the page. Bing的Translator Widget看起来不错,除了它可以翻译整个页面而不是页面的某些部分。 As a POC, I tried loading the translation API code in a hidden iframe, set the text to translate in a div element, and then called the Translate method and it worked. 作为POC,我尝试将翻译API代码加载到隐藏的iframe中,将文本设置为在div元素中进行翻译,然后调用Translate方法 ,该方法就可以了。 I was able to extract the translation and use it in my web page. 我能够提取翻译并在我的网页中使用它。

I would like to know if this kind of use is allowed or am I required to create an API account with BING or show some message somewhere in my page that a part of the content was translated by BING, since the translator widget is hidden inside the iframe? 我想知道是否允许这种使用,或者我是否需要使用BING创建一个API帐户或在页面上某处显示一些信息,表明部分内容已由BING翻译,因为翻译器小部件隐藏在iframe?

Thanks in advance for helping me. 在此先感谢您的帮助。

According to the documentation on MSDN for the Translate API of the widget, you can exclude elements from being translated by setting the custom attribute 'translate=no' 根据MSDN上有关小部件的Translate API的文档,您可以通过设置自定义属性'translate = no'来排除翻译元素。

https://msdn.microsoft.com/en-us/library/dn341982.aspx https://msdn.microsoft.com/zh-CN/library/dn341982.aspx

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM