具有阿拉伯语的多语言UTF-8网站 [英] Multilanguage UTF-8 website with Arabic

查看:180
本文介绍了具有阿拉伯语的多语言UTF-8网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将编写一个网站,该网站将具有阿拉伯语作为受支持的语言.我相信使用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选择器以文本对齐

谢谢您的输入.

推荐答案

阅读>://www.w3.org/International/tutorials/bidi-xhtml/ http://en.wikipedia.org/wiki/Internationalization_and_localization 可能有用.

我能想到的一些事情

  • 在某些国家/地区,您选择的颜色和图像可能会令人反感或不良品味
  • 每张带有文字的图片均应翻译(图片和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屋!

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