什么是正确的到左语言在Android上的地位?地位、正确、语言、Android

2023-09-06 01:23:58 作者:路人假゛

我需要创建一个有许多语言的字符串,包括RTL(从右至左)语言的应用程序。我想知道什么是RTL(从右到左)的当前状态,在Android(甚至在最新的API)的支持,例如:

I need to create an application that has strings of many languages, including RTL (right-to-left ) languages. I want to know what is the current status of RTL (Right To Left) support on Android (even on latest API), for example:

是它可以动态/静态检查设备的当前语言是RTL类型?我知道这是可能获得当前的语言环境,但我需要一个更一般的方法来检查,如果当前的语言是RTL。例如,英语和法语这将返回false,但对于阿拉伯语和希伯来语它将返回true。

is it possible to dynamically/statically check if the device's current language is RTL type? I know that it is possible to get the current locale, but i need a more general way to check if the current language is RTL. For example, for English and French it will return false, but for Arabic and Hebrew it will return true.

是有可能设置一个布局自动镜像为RTL语言? 例如,如果一个的LinearLayout(与水平方向)具有其子1-> 2,现在将有2'-1,以及新的儿童将在左边创建。

is it possible to set a layout to automatically be mirrored for RTL languages ? For example, if a linearLayout (with horizontal orientation) had its children 1->2, now it will have 2<-1, and new children will be created on the left.

有一个限定词添加到资源文件夹,将处理所有的RTL语言?例如,RES /布局是LTR(从左到右),和RES /布局RTL是RTL语言。

is there a qualifier to add to the resources folders that will handle all RTL languages? For example, "res/layout" is for LTR (Left To Right), and "res/layout-rtl" is for RTL languages.

似乎Eclipse的内容辅助建议安卓的layoutDirection为的LinearLayout和机器人:textDirection的TextView的,但是当我选择他们,我得到一个编译错误,它并不能识别它们。我也无法了解这些属性在互联网上的更多信息。这是什么意思,而且我怎么就不能使用它们?

it seems that eclipse's content assist suggests "android:layoutDirection" for linearLayout and "android:textDirection" for textView, but when I choose them, I get a compilation error that it doesn't recognize them. I also can't find out more information on the internet about those attributes. What do they mean, and how come I can't use them?

编辑:看来,安卓4.1对RTL语言的一些改进。不知道是什么,他们在哪里我可以了解他们。

seems that Android 4.1 has some improvement on RTL languages. Wonder what are they and where I can read about them.

推荐答案

与Android 4.2开始,有知道的特殊属性的RTL一些更多的信息,甚至有一个选项来自动镜像布局RTL语言。

Starting with android 4.2 , there is a little more info known about the special RTL attributes , and there is even an option to mirror layouts automatically for RTL languages .

更多信息,可以发现这里

希望,他们将增加有关如何使用它,包括一些示例code,甚至一个支持库对此事的更多信息。

Hopefully , they will add more information about how to use it , including some sample code and maybe even a support library on this matter.

编辑:现在,他们已经增加了如何使用新的RTL支持一些更多的信息:

now they've added some more information of how to use the new RTL support:

http://android-developers.blogspot.co.il/2013/03/native-rtl-support-in-android-42.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+blogspot/hsDu+(Android+Developers+Blog)

虽然我不知道如果NIKUD(希伯来相当于元音,除非它们是可选的,它们被显示为点而不是字母)正常工作了。

I wonder though if the NIKUD ( Hebrew equivalent to vowels, except that they are optional and they are shown as dots instead of letters) works fine now .

编辑:现在我已经测试了它,它实际上作品真的很好(这是圣经的第一章):

Now i've tested it, and it actually works really well (this is the first chapter of the holy bible) :

 
精彩推荐