Lang属性基础知识 [英] Lang attribute basics

查看:83
本文介绍了Lang属性基础知识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为我不可能使用lang

属性遇到麻烦,但结果并非如此。


我用英语写作,并使用HTML 4.01 DTD,因此添加< html

lang =" en">看起来很合理。然后我虽然我有更好的工作

如何使一个段落成为另一种语言,以防万一。我当时正在看StarTrek,所以我转向
http://www.loc.gov/standards/iso639-2/englangn.html

其中ISO639.2说明代码Klingon是tlh


所以我想了一个新段落< p lang =" tlh">这是对的。

然而我看了
http://www.w3.org/TR/REC-html40/stru...ang.html#h-8.1

,它给出了一个使用x-klingon而不是tlh的例子。


所以任何人都可以告诉我哪里出错了(以及W3C得到的地方

语言名称?)


-
http://www.ericlindsay.com

I thought that I couldn''t possibly get into trouble with the lang
attribute, but this turned out not to be the case.

I am writing in English, and using the HTML 4.01 DTD, so adding <html
lang="en"> seemed pretty reasonable. Then I though I had better work
out how to make one paragraph another language, just in case. I was
watching StarTrek at the time, so I turned to
http://www.loc.gov/standards/iso639-2/englangn.html
where the ISO639.2 says the code for Klingon is tlh

So I thought a new paragraph <p lang="tlh"> would be the right thing.
However then I looked in
http://www.w3.org/TR/REC-html40/stru...ang.html#h-8.1
and it gives an example using x-klingon not tlh.

So can anyone tell me where I went wrong (and also where W3C got their
language name?)

--
http://www.ericlindsay.com

推荐答案

文章< NO *********** *********************@freenews.iinet .net.au> ;,

Eric Lindsay< NO ****** ****@ericlindsay.com>写道:
In article <NO********************************@freenews.iinet .net.au>,
Eric Lindsay <NO**********@ericlindsay.com> wrote:
我用英文写作,并使用HTML 4.01 DTD,所以添加< html
lang =" en">看起来很合理。然后我虽然我有更好的工作
如何使一个段落成为另一种语言,以防万一。我当时正在看StarTrek,所以我转向
http://www.loc.gov/standards/iso639-2/englangn.html
其中ISO639.2说Klingon的代码是tlh

所以我想了一个新段落< p lang =" tlh">将是正确的。
然后我查看了
http://www.w3.org/TR/REC-html40/stru...ang.html#h-8.1
它给了一个例如使用x-klingon而不是tlh。
所以有人能告诉我哪里出错(以及W3C的语言名称是哪里?)
I am writing in English, and using the HTML 4.01 DTD, so adding <html
lang="en"> seemed pretty reasonable. Then I though I had better work
out how to make one paragraph another language, just in case. I was
watching StarTrek at the time, so I turned to
http://www.loc.gov/standards/iso639-2/englangn.html
where the ISO639.2 says the code for Klingon is tlh

So I thought a new paragraph <p lang="tlh"> would be the right thing.
However then I looked in
http://www.w3.org/TR/REC-html40/stru...ang.html#h-8.1
and it gives an example using x-klingon not tlh. So can anyone tell me where I went wrong (and also where W3C got their
language name?)




lang =" tlh"对于属性是正确的,尽管仅接受语言

解析tl属性。一部分;你应该在.htaccess中的某处添加类型P,tpHa / x-klingon

,这样文字在K''AmaY,A中是可读的;

只有当前的Klingon浏览器。哦,一定要在你的

Apache配置中使用mod_include。否则,你就搞砸了。


leo


-

< http:// web0 .greatbasin.net / ~lio />



lang="tlh" is correct for the attribute, although Accept-Language only
parses the "tl" part of it; You should AddType "P,tpHa/x-klingon"
somewhere in your .htaccess so the text is readable in K''AmaY,A; the
only current Klingon browser. Oh, and be sure to use mod_include in your
Apache configuration. Otherwise, you''re screwed.

leo

--
<http://web0.greatbasin.net/~leo/>


Leonard Blaisdell< le*@greatbasin.com>写道:
Leonard Blaisdell <le*@greatbasin.com> wrote:
lang =" tlh"对于属性是正确的,


正如问题所说,是的。

虽然Accept-Language只解析了tl。一部分;


废话。取回你为HTTP / 1.1

协议规范的伪造副本支付的钱,或者停止讲坏话。

你应该AddType" P,tpHa / x -klingon
你的.htaccess中的某个地方所以文字在K''AmaY,A中是可读的;只有当前的克林贡浏览器。
lang="tlh" is correct for the attribute,
As the question said, yes.
although Accept-Language only parses the "tl" part of it;
Nonsense. Get back the money you paid for a forged copy of the HTTP/1.1
protocol specification, or stop telling bad jokes.
You should AddType "P,tpHa/x-klingon"
somewhere in your .htaccess so the text is readable in K''AmaY,A; the
only current Klingon browser.




看来你似乎很有趣。我相信你的幽默在你的宇宙中是相当不错的。


-

Yucca, http://www.cs.tut.fi/~jkorpela/

有关网页制作的网页: http:// www .cs.tut.fi / ~jkorpela / www.html



It seems that you are trying to be funny. I''m sure your humour is quite OK in
your universe.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


Eric Lindsay< NO ********* *@ericlindsay.com>写道:
Eric Lindsay <NO**********@ericlindsay.com> wrote:
我认为我不可能在lang
属性上遇到麻烦,但事实证明并非如此。


您希望在哪里获得它?

我用英语写作,并使用HTML 4.01 DTD,所以添加< html
lang =" en">看起来很合理。


鉴于书面形式的英语之间存在差异,使用en-US,en-GB会更合理。或其他一些更详细的语言

代码。但是,由于识别lang属性的少数程序可能仅仅了解主要代码,甚至无法从代码中提取它们,例如en-US,使用& US。烯"也许是最好的。
http:// www。 loc.gov/standards/iso639-2/englangn.html
其中ISO639.2说Klingon的代码是tlh


那是' ISO 639-2代码的权威注册表。然而,HTML

规范是对RFC 1766的规范性引用,在

转向中对ISO 639的特定版本进行了规范性引用。

既然RFC 1766已经废弃,我们在哪里? HTML规范提到了RFC 1766正在更新的
,但这样的说明也不是规范性的。这是一个

规格中的草率的例子 - 很难被允许的

in _standard_。

所以我想了一个新的段落< p lang =" tlh">将是正确的。
然后我查看了
http://www.w3.org/TR/REC-html40/stru...ang.html#h-8.1
它给了一个示例使用x-klingon而不是tlh。
I thought that I couldn''t possibly get into trouble with the lang
attribute, but this turned out not to be the case.
Where did you expect to get with it?
I am writing in English, and using the HTML 4.01 DTD, so adding <html
lang="en"> seemed pretty reasonable.
Given the differences between written forms of English, it would be more
reasonable to use "en-US", "en-GB", or some other more detailed language
code. But since the few programs that recognize lang attributes may
understand only the primary codes and even fail to extract them from codes
like "en-US", using "en" is perhaps best.
http://www.loc.gov/standards/iso639-2/englangn.html
where the ISO639.2 says the code for Klingon is tlh
That''s the authoritative registry of ISO 639-2 codes. The HTML
specifications, however, make a normative reference to RFC 1766, which in
turn makes a normative reference to a specific version of ISO 639.
Now that RFC 1766 has been obsoleted, where are we? The HTML spec mentions
that RFC 1766 is being updated, but such a note is nor normative. This is an
example of sloppyness in the specs - something that would hardly be allowed
in a _standard_.
So I thought a new paragraph <p lang="tlh"> would be the right thing.
However then I looked in
http://www.w3.org/TR/REC-html40/stru...ang.html#h-8.1
and it gives an example using x-klingon not tlh.




这是因为RFC 1766不知道任何三字母的主要代码。

x-前缀是(和)用于私人使用代码,所以

你可以编写自己的语言代码(对于现有的或不存在的

语言) - 当然你不能指望其他人理解

他们,除非有特别协议。


此外,tlh是相当新的,在2004年注册,如
http://www.loc.gov/standards/iso639-2/codechanges.html


(示例i-navajo也已过时。 Navajo语言是两个字母

代码nv现在。)


-

Yucca, http://www.cs.tut.fi/~jkorpela/

有关网页制作的网页: http:// www.cs.tut.fi/~jkorpela/www.html



That''s because RFC 1766 doesn''t know any three-letter primary codes.
The "x-" prefix was (and is) used for "private use" codes, so that
you could make up your own language codes (for existing or nonexisting
languages) - and naturally you cannot expect anyone else to understand
them, except by a special agreement.

Besides, "tlh" is fairly new, registered in 2004, as mentioned at
http://www.loc.gov/standards/iso639-2/codechanges.html

(The example "i-navajo" is dated, too. The Navajo language the two-letter
code "nv" now.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


这篇关于Lang属性基础知识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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