Hi

QUESTION:
How can I determine which alternate resources Android has decided to
load? Even simply detecting the language loaded for a particular
string (such as the screen title string) would be sufficient.

SCENARIO:
My application retrieves some localized information from a server. The
application currently only supports a few languages and when a
particular language is not supported Android falls back to the default
application language which is English. I am concerned about the
following case:

A user's phone is set to a language which my application does not
support (for example, Russian). The server nevertheless happens to
support Russian. If I ask the phone for its locale using
getApplicationContext().getResources().getConfiguration().locale.toString() ,
I will receive ru , for Russian, since that is what the user set. If I
send 'ru' to the server, the server will respond with Russian-language
text. My application though is currently displaying everything in
English, since that's the default fallback language. Even though the
user probably will understand the Russian text (since the phone is set
to Russian), it looks quite strange to have the mix of languages on
the same screen.

(The naive solution is for me to manually crawl my resource folders
and then implement a selection process which mimics the selection
process that Android performs as described in, "How Android finds the
best matching directory" of
http://developer.android.com/guide/topics/resources/resources-i18n.html#AlternateResources
. This in general sounds like a bad idea for obvious reasons).

Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to