页面中有多种语言 [英] More than one language in a page

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

问题描述

标记div或p的正确方法是什么,以表明

与主页的语言不同?是否有



相关的不同浏览器的任何潜在陷阱?如果它有任何区别,这是参考

a页面的混合英语和法语:
http://www.chem.utoronto.ca/IChO.Ontario/index.html

解决方案

2008-10-21,David Stone< no ****** @ domain.invalidwrote:


什么标记div或p的正确方法是指示

它与主页面的语言不同?



你只需要< div lang =" en"等。什么浏览器实际上使用

lang属性并不是那么清楚。在大多数情况下可能没什么,虽然

它可能会影响某些字体的选择。


我见过的大多数用于英语的字体也会包含法语所需的所有

字形。


我不知道听觉渲染器是否用它来影响语音选择

合成器。我对此表示怀疑,但你永远不知道。


是否有任何潜在的陷阱与不同的浏览器关联

这样做?如果它有任何不同,这是参考一个混合英语和法语的

页面:
http://www.chem.utoronto.ca/IChO.Ontario/index.html


Ben C写道:


你只需要< div lang =" en"等。什么浏览器实际上使用

lang属性并不是那么清楚。在大多数情况下可能没什么,虽然它可能会影响某些字体的选择。



好​​吧,有些语言从右到左显示,所以那里的差异应该是显着的。我相信在一些标点符号和单词分裂问题上也存在间距问题

。当然,

完全取决于浏览器的编码。


-

史蒂夫Swift
http://www.swiftys.org.uk/swifty .html
http://www.ringers.org.uk


2008-10-22,Swifty< st *********** @ gmail.comwrote:
< blockquote class =post_quotes>
Ben C写道:


>你只需要< div lang =" en"等。什么浏览器实际上使用
lang属性并不是那么清楚。在大多数情况下可能没什么,尽管它可能会影响某些字体的选择。



好​​吧,有些语言从右到左显示,所以那里的差异

应该是重要的。



为此你必须使用dir = rtl或direction:rtl。 lang = ar by

本身没什么区别。


我相信在一些标点符号周围也存在间距问题,

以及分词问题。当然,这完全归功于浏览器编码的

护理。



我没有看到lang有所作为,但也许它应该。一些

浏览器使用基于Unicode附件14的内容进行换行,并且

语言不参与他们在那里描述的算法。


另请参阅 http://www.cs .tut.fi / ~jkorpela / unicode / linebr.html


What is the correct way to mark up, say, a div or p, to indicate
that it is in a different language to the main page? Are there
any potential pitfalls with different browsers associated with
doing this? If it makes any difference, this is in reference to
a page in mixed English and French:
http://www.chem.utoronto.ca/IChO.Ontario/index.html

解决方案

On 2008-10-21, David Stone <no******@domain.invalidwrote:

What is the correct way to mark up, say, a div or p, to indicate
that it is in a different language to the main page?

You just do <div lang="en"etc. What browsers actually do with that
lang attribute is not so clear. In most cases probably nothing, although
it may influence choice of font in some.

Most fonts I''ve seen that are used for English will also contain all the
glyphs needed for French anyway.

I don''t know if aural renderers use it to influence choice of speech
synthesizer. I doubt it, but you never know.

Are there any potential pitfalls with different browsers associated
with doing this? If it makes any difference, this is in reference to a
page in mixed English and French:
http://www.chem.utoronto.ca/IChO.Ontario/index.html


Ben C wrote:

You just do <div lang="en"etc. What browsers actually do with that
lang attribute is not so clear. In most cases probably nothing, although
it may influence choice of font in some.

Well, some languages display right-to left so the difference there
should be significant. I believe that there are also spacing issues
around some punctuation, and word-splitting issues as well. Of course,
it''s all down to the care with which the browser was coded.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk


On 2008-10-22, Swifty <st***********@gmail.comwrote:

Ben C wrote:

>You just do <div lang="en"etc. What browsers actually do with that
lang attribute is not so clear. In most cases probably nothing, although
it may influence choice of font in some.


Well, some languages display right-to left so the difference there
should be significant.

For that you''ve got to use dir=rtl or "direction: rtl". lang=ar by
itself won''t make any difference.

I believe that there are also spacing issues around some punctuation,
and word-splitting issues as well. Of course, it''s all down to the
care with which the browser was coded.

I haven''t seen lang making a difference, but perhaps it should. Some
browsers use something based on Unicode Annex 14 for line-breaking, and
language is not involved in the algorithm they describe there.

See also http://www.cs.tut.fi/~jkorpela/unicode/linebr.html


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

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