"语言"现在是“朗”? [英] "language" is now "lang"?

查看:84
本文介绍了"语言"现在是“朗”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你输入Script Lang ...时,



视觉工作室反对'语言'并喜欢'Lang'之类的东西,告诉我HTML5没有这样的属性脚本标记的'language'。



这是Microsoft驱动的HTML5扩展还是W3C推荐?我在后一个网站找不到同等的引文,因此问这个问题。

When you type Script Lang...,

Visual studio objects to 'Language' and prefers something like 'Lang' telling that HTML5 has no such attribute like 'language' for script tag.

Is this a Microsoft-driven HTML5 extension or W3C recommendation? I could not find an equivalent citation in the latter site and hence asking this question.

推荐答案

在HTML5中,脚本的语言属性声称已过时:

http://www.w3.org/TR/html-markup/script。 html [ ^ ]。



然而,也没有属性,之前并不真正需要lang。请参阅HTML 4.01规范所说的内容:

http: //www.w3.org/TR/html401/interact/scripts.html#h-18.2.2 [ ^ ]。



脚本元素语言由属性内容。



但是,也许有一种混乱。 语言是什么意思?计算机语言或与人类文化相关的语言(英语,法语等)?如果你的意思是第二件事,我不明白为什么这样的属性应该属于这个脚本。脚本是代码,应该是中立的。如果你在脚本代码中使用了一些特定于文化的文本,那将是一个不好的做法;你总是可以从数据中获得一些你需要的文本,比如HTML DOM本身。



-SA
In HTML5, the "language" attribute for script is claimed obsolete:
http://www.w3.org/TR/html-markup/script.html[^].

However, nor attribute, neither "lang" weren't really needed earlier. Please see what HTML 4.01 specification says:
http://www.w3.org/TR/html401/interact/scripts.html#h-18.2.2[^].

Script element language is controlled by the attribute "content".

However, perhaps there is a confusion. What do you mean by "language"? Computer language or the language associated with the human cultures (English, French, etc.)? If you mean the second thing, I don't see why such attribute should belong to the scrip. Script is code, should be neutral. If you used some culture-specific text in the code of script, it would be a bad practice; you could always get some text you need from data, such as HTML DOM itself.

—SA


这篇关于"语言"现在是“朗”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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