如何确保成功的XHTML验证并具有不可翻译的元素? [英] How to ensure successful XHTML validation and have non-translatable elements?

查看:97
本文介绍了如何确保成功的XHTML验证并具有不可翻译的元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上有代码清单,我不会将它们用于翻译。
我知道我可以使用translate =" no"对我不想翻译的元素的属性。
但它打破了XHTML验证。
是否还有其他方法可以防止元素被翻译? (例如,class =" donttranslate")

在此先感谢,
Luke

I have code listings on my website and I don't wand them to be translated.
I know I can use translate="no" attribute on elements which I don't want to be translated.
But it breaks XHTML validation.
Is there any other way to prevent an element from being translated? (eg. class="donttranslate")

Thanks in advance,
Luke

推荐答案

某些元素总是从翻译中排除:< head> ,< script>,< style>,< code>,< samp>,< var>,< kbd>,< pre>,< input>,< object>,< frame> ,< iframe>,& < address>。 此列表可能会在将来进行细化,但在您的情况下,将代码清单包装在< code>中。元素应该足以抑制它们的翻译。

Certain elements are always excluded from translation: <head>, <script>, <style>, <code>, <samp>, <var>, <kbd>, <pre>, <input>, <object>, <frame>, <iframe>, & <address>.  This list may be refined in future however in your case wrapping your code listings in <code> elements should be sufficient to suppress translation on them.

Sandor Maurice
微软翻译团队


这篇关于如何确保成功的XHTML验证并具有不可翻译的元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆