On Wed, May 16, 2012 at 4:13 PM, Steven R. Loomis <srl@...:
> return CLDR's information about the character layout being right to left?
You are right, it does.
However, it relies on data in the main locales tree, like
data/locales/ar.txt which has
This limits it to the set of locales for which CLDR has data, and relies on
data for relevant locales not having been removed from a customized build.
If you iterate over many locales, it will open each locale's bundle.
Worse: I believe for every language for which ICU does not have a bundle
file the lookup would fall back to the default locale, and so if your
default locale is "ar" then all unknown languages will look
"right-to-left". This would also happen with all scripts for which you
construct "und_<script code>" and try to look up their data. While this
fallback is good for presenting some message string to a user, it's not so
good for lookup of language properties.
It seems like it would be better to have a simple UScript.isRightToLeft()
with a little static data, update it for new Unicode versions and ISO
codes, and use it together with addLikelySubtags().
Google Internationalization Engineering