指定语言,如< span lang =" en">? [英] specify language as in <span lang="en">?

查看:68
本文介绍了指定语言,如< span lang =" en">?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




不能算出这个,用什么方式指定语言?


在HTML中,它只是一个lang =" xx"属性,或XHTML

xml:lang =" xx",但是,在CSS中怎么样?这将是一个

屏幕阅读器(文本到语音)的可访问性,以帮助读者

软件使用正确的演示方法(例如正确的语言

模块)。


作为我正在寻找的一个伪示例:设置芬兰语''fi''

某些td 's $

td.fi {

lang:fi;

font-family:Arial,Helvetica;

}


我只能找到关于听觉样式表的信息。但这些不是
包含指定语言的任何方式。它必须在某个地方,

虽然...(?)


谢谢,

- Jan

解决方案

" Jan Wagner" <无***** @ thanks.net>写道:

无法解决这个问题,指定语言的CSS方式是什么?


无。语言规范是元数据的问题,在标记中进行,

不是演示问题。它是声明性的,而不是推荐任何特定的渲染。在合适的选择器中,例如CSS

规则中的这些语言信息可能是_utilized_,例如当说某些语言的文本

用某种特定字体呈现时。但即便如此,这主要只是理论。

在HTML中,它只是一个lang =" xx"属性,或XHTML xml:lang =" xx",


正确。

这对于<的屏幕阅读器(文本到语音)来说是必需的辅助功能,帮助读者软件使用正确的演示方法(例如正确的语言模块)。


理论上,是的。在实践中,很少有程序能够合理地使用语言

信息。在任何情况下,它都是标记问题,而不是样式表问题。

作为我正在寻找的一个伪示例:为某些
td's

td.fi {
lang:fi;
font-family:Arial,Helvetica;
}


这假设你有< td class =" fi">在你的标记中。为什么不使用

< td lang =" fi">代替?好吧,你可能有理由使用_both_一个lang

属性_and_一个class属性,因为td.fi得到了很好的支持,

td [lang =" fi" ]目前支持得非常差。

我只能找到关于听觉样式表的信息。


几乎没有任何实施值得提及。

但这些不包含任何指定语言的方法。




他们不应该。语言是文本的固有属性,而不是关于渲染的偶然建议。


Jan Wagner写道:

无法解决这个问题,指定语言的CSS方式是什么?




语言信息是内容,而不是演示。因此它不像CSS那样属于



-

Johannes Koch

Spem in alium nunquam habui praeter in te,Deus Israel。

(托马斯·塔利斯,40部分的音乐剧)


> Jan Wagner <无***** @ thanks.net>写道:

这将是屏幕阅读器(文本到语音)的可访问性,以帮助读者软件使用正确的
演示方法(例如正确的语言模块)。



Jukka K. Korpela写道:理论上,是的。在实践中,很少有程序能够合理地使用语言信息。




屏幕阅读器。

-

Johannes Koch

Spe in alun nunquam habui praeter in te,Deus Israel。

(托马斯塔利斯,40部分的音乐剧)


Hi,

can''t figure this one out, what''s the CSS way to specify the language?

In HTML it would be simply an lang="xx" attribute, or XHTML
xml:lang="xx", but, how about in CSS? This would be required for a
screen reader (text to speech) for accessibility, to help the reader
software use the correct presentation method (e.g. correct language
module).

As a pseudo example of what I''m looking for: set Finnish ''fi'' for
certain td''s

td.fi {
lang: fi;
font-family: Arial,Helvetica;
}

I can find only info about "aural style sheets" but these don''t
contain any way to specify the language. It''s got to be somewhere,
though... (?)

thanks,
- Jan

解决方案

"Jan Wagner" <no*****@thanks.net> wrote:

can''t figure this one out, what''s the CSS way to specify the language?
None. Language specification is a matter of metadata, to be made in markup,
not a presentation issue. It is declarative, instead of recommending any
particular rendering. Such language information might be _utilized_ in CSS
rules, in suitable selectors, e.g. when saying that texts in some language
be rendered in some particular font. But even this is mostly just theory.
In HTML it would be simply an lang="xx" attribute, or XHTML xml:lang="xx",
Right.
This would be required for a screen reader (text to speech) for
accessibility, to help the reader software use the correct presentation
method (e.g. correct language module).
In theory, yes. In practice, few programs make any sensible use of language
information. In any case, it''s a markup issue, not a style sheet issue.
As a pseudo example of what I''m looking for: set Finnish ''fi'' for certain
td''s

td.fi {
lang: fi;
font-family: Arial,Helvetica;
}
This postulates that you have <td class="fi"> in your markup. Why not use
<td lang="fi"> instead? Well, you might have a reason to use _both_ a lang
attribute _and_ a class attribute, since td.fi is well supported,
td[lang="fi"] is very poorly supported at present.
I can find only info about "aural style sheets"
which hardly have any implementation worth mentioning.
but these don''t contain any way to specify the language.



They are not supposed to. Language is an inherent property of text, not a
casual suggestion on rendering.


Jan Wagner wrote:

can''t figure this one out, what''s the CSS way to specify the language?



Language information is content, not presentation. So it does not belong
into a presentation language like CSS.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)


> "Jan Wagner" <no*****@thanks.net> wrote:

This would be required for a screen reader (text to speech) for
accessibility, to help the reader software use the correct
presentation method (e.g. correct language module).


Jukka K. Korpela wrote: In theory, yes. In practice, few programs make any sensible use of
language information.



Screen readers do.
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)


这篇关于指定语言,如&lt; span lang =&quot; en&quot;&gt;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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