指定双语页面标题 [英] Specifying a bilingual page title

查看:71
本文介绍了指定双语页面标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此XHTML 1.0严格页面 -
http:// www.studiolirico.org/docs/settimana2003.html

有一个意大利语和英语的双语标题。

页面的主要语言是意大利语,因此< html>标签看起来像这样(没有

xmlns URL中的空格):

< html xmlns =" h ttp://www.w3.org/ 1999 / XHTML" XML:朗= QUOT;它" lang =" it">

在正文中,我有所有意大利文的英文翻译,这些

总是包含在带有lang ="的元素中;恩"属性。但是

标题怎么样?我最初有一个< span>包含英语

翻译,但W3C Validator声称标题可能不包含

跨度。


Amittai Aviram

This XHTML 1.0 Strict page --
http://www.studiolirico.org/docs/settimana2003.html
has a bilingual title in Italian and English. The principle language of the
page is Italian, so the <html> tag looks like this (w/o the space in the
xmlns URL):
<html xmlns="h ttp://www.w3.org/1999/xhtml" xml:lang="it" lang="it">
Within the body, I have English translations for all Italian text, and these
are always contained within elements that bear the lang="en" attribute. But
what about the title? I had originally had a <span> containing the English
translation, but the W3C Validator stated that a title may not contain a
span.

Amittai Aviram

推荐答案

" Amittai Aviram" <是***** @ amittai.com>写道:
"Amittai Aviram" <am*****@amittai.com> wrote:
在正文中,我有所有意大利文的英文翻译,这些
总是包含在带有lang =" en"的元素中。属性。但是
标题呢?
Within the body, I have English translations for all Italian text, and these
are always contained within elements that bear the lang="en" attribute. But
what about the title?




仅为< body>指定语言(lang,xml:lang)但不适用于< html>。


-

但这就是FP放入页面的内容,所以我认为这是正确的

Harry H. Arends in microsoft.public.frontpage.client



Specify the language (lang, xml:lang) only for <body> but not for <html>.

--
But thats what FP puts in to the page, so i asume thats correct
Harry H. Arends in microsoft.public.frontpage.client




" Jukka K. Korpela" < JK ****** @ cs.tut.fi>在消息中写道

news:Xn ***************************** @ 193.229.0.31。 ..

"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..
" Amittai Aviram" <是***** @ amittai.com>写道:
"Amittai Aviram" <am*****@amittai.com> wrote:
我的问题是关于标题元素,因为它包含两种不同的语言。
My question was about the title element because it contains two
different languages.


在实践中,我会使用我会用的语言考虑为主要。


很棒的建议。谢谢。

但不要期待太多。很少有浏览器或程序关心任何关于lang或xml:lang属性的任何内容[...]

In practice, I would use whichever language I would consider as
"primary".
Great advice. Thank you.
But don''t expect much. Very few browsers or programs care anything
about lang or xml:lang attributes at all [...]




我知道,但我喜欢尝试做正确的事。 :-)但是,也不是一些

搜索引擎使用xml:lang或lang属性?


Amittai


" Lars G. Svensson" < SV ****** @ dbf.ddb.de>写道:
"Lars G. Svensson" <sv******@dbf.ddb.de> wrote:
前一段时间我有一个类似的问题,当时我想用一种语言拼写一个< abbr>
拼写(拼写?有没有老师) br />同时在另一个中读出title属性。我想我也需要一些titlelang属性(有点像
hreflang),以便指定。


对于当前的HTML,理论上的答案是

< abbr title =" ..." lang =" ...">< span lang =" ..."> ...< / span>< / abbr>

,因为lang属性指定元素内容的语言

_and_所有属性。相当不切实际。
I had similar problems a while ago when I wanted to have an <abbr>
spelled (spelt? Are there any teachers around) out in one language
while having the title attribute read out in another. I guess I
would need some kind of titlelang attribute too (a bit like
hreflang), in order to specify that.
For current HTML, the theoretical answer would be
<abbr title="..." lang="..."><span lang="...">...</span></abbr>
since the lang attribute specifies the language of element content
_and_ of all attributes. Rather impractical.
但不要期望太多。很少有浏览器或程序关心任何关于lang或xml:lang属性的内容,
But don''t expect much. Very few browsers or programs care anything
about lang or xml:lang attributes at all,


论证,不仅仅关心或使用某种标记
因为UAs don '(还)支持它,总是让我感到不安。


The argumentation, not to care for or use some kind of markup only
because UAs don''t (yet) support it, always leaves me feeling
uneasy.




如果人们花时间和精力添加,我会感到不安/>
标记实际上几乎没用 - 除非他们被告知

情况是什么,他们做出了明智的决定。

我们真的试图做正确的事情,不是吗?我尝试生成现在有效且两年,十年或一百年的HTML。


即使你遵守
推荐有效。 />
每个当前的推荐。实际上,lang属性被弃用,而不推荐使用xb:lang。明年,他们可以弃用两个赞成优惠的东西。

浏览器支持最终会来,我很确定,


它会吗?


事实上,语言标记系统的设计很差,另外还有几乎没有实现的b $ b。我对此的详细描述是

仅以芬兰语提供,所以我只是指出一个明显的问题 -

一个小但有症状的问题。 HTML规范说明lang属性的

默认值是未知的。这是非常草率的

语言(双关语)。这是否意味着默认值是

字符串未知?显然不是,因为这不符合HTML规范所引用的规范。他们使用und

(未确定)。所以它似乎说_是一个默认值

的价值,但它是未知的 - 对谁?对任何人?这个

有什么意义呢?如果未知,默认值的用途是什么?我想我可以猜出他们实际意味着什么,但他们肯定设法避免

说出来。

另外:WCAG指南4
< http :// http://www.w3.org/TR/WAI-WEBC...iated-and-fore
ign>告诉html-writer清楚地识别文档的文本和任何文本等同物的自然语言的变化(例如,字幕)。如果我 - 出于什么原因 - 需要/想要符合,我* *标记语言更改,在这种情况下我必须关注不同于



I would feel uneasy if people spent their time and energy with adding
markup that is practically almost useless - unless they have been told
what the situation is and they have made an informed decision.
We really try to do the *proper* thing, don''t we. I try to
produce html which is valid now and in two, ten or a hundred years.
There''s no guarantee that your HTML will be valid according to the W3C
recommendation next week even if you obey the spirit and letter of
every current recommendation. In fact, the lang attribute is being
deprecated in favor of xml:lang. Next year they could deprecate both in
favor of something fancier.
Browser support will come eventually, I''m sure,
Will it?

And in fact, the language markup system is poorly designed, in addition
to being virtually unimplemented. My detailed description of this is
available in Finnish only, so I''ll just point out an apparent problem -
a small but symptomatic problem. The HTML specification says that the
default value of the lang attribute is unknown. That''s very sloppy
language (pun intended). Does it mean that the default value is the
literal string "unknown"? Apparently not, since that would not comply
with the specifications that the HTML specs refer to; they use "und"
(for ''undetermined''). So it seems to say that there _is_ a default
value, but it is unknown - to whom? to anyone? What sense could this
make? What''s the use of a default value, if it is unknown? I think I
can guess what they actually meant, but they surely managed to avoid
saying it.
Also: WCAG Guideline 4
<http://http://www.w3.org/TR/WAI-WEBC...iated-and-fore
ign> tells the html-writer to "clearly identify changes in the
natural language of a document''s text and any text equivalents
(e.g., captions)." If I - for what reason whatsoever - need/want to
conform, I *have* to mark up language changes, and in that case I
have to care about attribute values in a language different from
that of the element content, too. i18n is more difficult than I
though.




但是为什么你要符合这个要求,这生动地说明了b $ b提醒我的马太福音23:4 - ?即使WAI页面本身也没有实际符合WAI要求,尽管显示了一个图标

声称这样的一致性。页面 http://www.w3.org/WAI/ 甚至违反

指定主要语言的要求 - 这将是

_extremely_ simple to lang =" en"进入< html>,但是他们没有做到这样,即使是这样,但却强加了一个更加困难的优先级1要求

指定了_all_语言的变化(没有试图满足那个
WAI页面上的
要求,除了随便)。


语言标记,特别是如果全面适用于所有语言

更改,则是如果你真的尝试使用它会非常困难。只要它只用非常抽象的术语来描述,它可能看起来很容易。


-

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

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



But why would you want to conform with that requirement, which vividly
reminds me of Matthew 23:4 -? Even the WAI pages themselves do not
actually conform to WAI requirements, despite showing an icon that
claims such conformance. The page http://www.w3.org/WAI/ even violates
the requirement of specifying the primary language - it would be
_extremely_ simple to add lang="en" into <html>, but they failed to do
even that, yet impose a much more difficult Priority 1 requirement of
specifying _all_ language changes (without trying to satisfy that
requirement on WAI pages, except casually).

Language markup, especially if applied comprehensively for all language
changes, is very difficult if you actually try to use it. As long as it
is described in very abstract terms only, it may look rather easy.

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


这篇关于指定双语页面标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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