summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Fabrice Di Meglio <fdimeglio@google.com> 2012-09-05 13:12:02 -0700
committer Fabrice Di Meglio <fdimeglio@google.com> 2012-09-06 11:13:24 -0700
commit8a802dbdabdfd27692c2e38b2c3adafe95566106 (patch)
tree7b933dc6d1dcfb6cd4a7d0a349ce642641712c07
parent18e876806718e28edaa3cd9bb0262a9b400bc82b (diff)
Use "ldrtl" and "ldltr" config qualifiers for RTL / LTR resources
- we cannot use "rtl" / "ltr" qualifiers as they can conflict with ISO-639 Alpha-3 codespace which uses 3 letters for identifying a language code (and could use either "rtl" or "ltr" strings for defining a language in the future). - we are using instead "ldrtl" for RTL and "ldltr" for LTR resources. Those qualifiers are defined by more than 3 chars and outside of what is defined into ISO-639. They are also more understandable as "ld" prefix is for "layoutdirection" Change-Id: Id43e948103707e09bef63ebd54ac1779dde58e72
-rw-r--r--core/java/android/content/res/Configuration.java4
-rw-r--r--libs/androidfw/ResourceTypes.cpp4
-rw-r--r--tools/aapt/AaptAssets.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index 0b7784222a12..71647130646b 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -536,8 +536,8 @@ public final class Configuration implements Parcelable, Comparable<Configuration
int layoutDir = (screenLayout&SCREENLAYOUT_LAYOUTDIR_MASK);
switch (layoutDir) {
case SCREENLAYOUT_LAYOUTDIR_UNDEFINED: sb.append(" ?layoutDir"); break;
- case SCREENLAYOUT_LAYOUTDIR_LTR: sb.append(" ltr"); break;
- case SCREENLAYOUT_LAYOUTDIR_RTL: sb.append(" rtl"); break;
+ case SCREENLAYOUT_LAYOUTDIR_LTR: sb.append(" ldltr"); break;
+ case SCREENLAYOUT_LAYOUTDIR_RTL: sb.append(" ldrtl"); break;
default: sb.append(" layoutDir=");
sb.append(layoutDir >> SCREENLAYOUT_LAYOUTDIR_SHIFT); break;
}
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 069dfa3a34e7..0107da4eea57 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -2061,10 +2061,10 @@ String8 ResTable_config::toString() const {
if (res.size() > 0) res.append("-");
switch (screenLayout&ResTable_config::MASK_LAYOUTDIR) {
case ResTable_config::LAYOUTDIR_LTR:
- res.append("ltr");
+ res.append("ldltr");
break;
case ResTable_config::LAYOUTDIR_RTL:
- res.append("rtl");
+ res.append("ldrtl");
break;
default:
res.appendFormat("layoutDir=%d",
diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp
index 438a670452e4..5b71adc81cbe 100644
--- a/tools/aapt/AaptAssets.cpp
+++ b/tools/aapt/AaptAssets.cpp
@@ -995,12 +995,12 @@ bool AaptGroupEntry::getLayoutDirectionName(const char* name, ResTable_config* o
(out->screenLayout&~ResTable_config::MASK_LAYOUTDIR)
| ResTable_config::LAYOUTDIR_ANY;
return true;
- } else if (strcmp(name, "ltr") == 0) {
+ } else if (strcmp(name, "ldltr") == 0) {
if (out) out->screenLayout =
(out->screenLayout&~ResTable_config::MASK_LAYOUTDIR)
| ResTable_config::LAYOUTDIR_LTR;
return true;
- } else if (strcmp(name, "rtl") == 0) {
+ } else if (strcmp(name, "ldrtl") == 0) {
if (out) out->screenLayout =
(out->screenLayout&~ResTable_config::MASK_LAYOUTDIR)
| ResTable_config::LAYOUTDIR_RTL;