带有阿拉伯语的多语言 UTF-8 网站 [英] Multilanguage UTF-8 website with Arabic
问题描述
我将编写一个支持阿拉伯语的网站.使用 UTF8 unicode 我相信我可以覆盖阿拉伯字母.我还读到它是从右向左读的,所以我想我应该在用阿拉伯语显示时向右对齐.
I will be coding a website that will have Arabic as a supported language. With UTF8 unicode I believe I can cover Arabic alphabet. I've also read that it reads right to left so I guess I should align right when displaying on Arabic.
我向社区询问经验和可能的陷阱.
- utf-8 Unicode
- 用于切换文本对齐方式的 css 选择器
预先感谢您的意见.
推荐答案
阅读 http://www.w3.org/International/tutorials/bidi-xhtml/ 和 http://en.wikipedia.org/wiki/Internationalization_and_localization 可能有用.
Reading http://www.w3.org/International/tutorials/bidi-xhtml/ and http://en.wikipedia.org/wiki/Internationalization_and_localization could be useful.
我能想到的一些事情:
- 在某些国家/地区,您选择的颜色和图像可能会令人反感或品味不佳
- 每个带有文本的图像都应该被翻译(图像和 alt);每个具有方向性的图像都应该反转(例如:箭头)
- 如果您不希望以后遇到麻烦,请尽量避免使用
class="left"
之类的类命名.顶部、底部、之前或之后都可以,我认为但不是左/右. - 你必须检查每个关于文本对齐、背景位置、浮动、清除和明显左右位置的 CSS 说明:绝对/相对;
- 不同的字体需要不同的字体大小(虽然这个问题主要涉及亚洲字体)
- 对于任何其他受支持的语言,应翻译模板中的许多文本.
- your choice of colors and images could prove offensive or bad taste in some countries
- every image with text should be translated (image and alt); every image with directionality should be reversed (ex: an arrow)
- try to avoid class naming like
class="left"
if you don't want future headaches. Top, bottom, before or after are OK I think but not left/right. - you'll have to check each CSS instructions about text-align, background-position, float, clear and obviously left and right with position: absolute/relative;
- different fonts need different font sizes (though this problem concerns asiatic fonts mainly)
- as for any other supported language, many bits of text in templates should be translated.
用 css 选择器切换文本对齐方式"是指 dir="rtl"
吗?这是一个 HTML 属性.但是你仍然需要一个类(在 body 元素上会很好)来像一个巨大的开关来满足你的设计需求.喜欢
By "css selector to swith text alignment", do you mean dir="rtl"
? This is an HTML attribute. But you'll still need a class ('ll be fine on the body element) to act like a giant switch for your design needs. Like
.en .yourclass { background: url(images/en/bg.jpg) }
.ar .yourclass { background: url(images/ar/bg.jpg) }
属性选择器会做同样的事情,但还有那些糟糕的 IE ...
edit: an attribute selector would do the same but then there are those bad ol' IE ...
:lang(ar) .yourclass { background: url(images/ar/bg.jpg) }
or
[lang|="ar"] .yourclass { background: url(images/ar/bg.jpg) }
这篇关于带有阿拉伯语的多语言 UTF-8 网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!