在Android和资源预选赛RTL语言的支持 [英] RTL Languages support in android and resource qualifiers
问题描述
我读到这句话的Android 2.3增加了支持从右到左(RTL)的语言 现在我想RTL支持添加到我的应用程序。但我不知道什么是预选赛添加到我的布局。
I read this sentence " Android 2.3 added support for right-to-left (RTL) languages" and now I want to add RTL support to my app. But I do not know what is qualifiers to add to my layouts.
关于RES /价值/ strings.xml中,我可以叫这样的RES /值-AR / strings.xml中
About res/values/strings.xml , I can named like this res/values-ar/strings.xml
我想有不同的布局RLT语言。我不想刚才不同的字符串,我也想不同的布局。什么布局文件夹的名称应该是什么样子?
I want to have different layout for RLT languages. I do not want to have just different strings , I also want different layout. What the layout folder name should look like ?
在这一刻左到右的语言它被命名为 RES / lauyots / main.xml中 但我不知道如何命名它为RTL语言
At this moment for the left to right languages it is named res/lauyots/main.xml but I do not know how to name it for RTL languages
是这样的限定词present呢?
Is this kind qualifier is present at all ?
推荐答案
@Silwek是正确的。这就是他的回答,我只是把它在这里,因为我的答案已经被标记为回答。
@Silwek is right. This is his answer, I am merely putting it here because my answer has been marked as answered.
res/layout-ldltr/ (Left to Right, default value)
res/layout-ldrtl/ (Right to Left)
旧答案
检查本地化和的多屏支持,他们给你的想法有关资源文件夹和预选赛。
Check Localization and Multiple Screen Support, they give you idea about resource folders and qualifiers.
您可以使用特定于语言环境的资源和布局是这样的:
You can use locale specific resources and layout like this:
有关语言特定的资源:
res/values/strings.xml
res/values-fr/strings.xml (French)
res/values-ja/strings.xml (Japanese)
有关特定语言的布局:
res/layout-fr/main.xml
res/layout-ar/main.xml
这篇关于在Android和资源预选赛RTL语言的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!