Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch app with specific locale

Tags:

android

locale

Changing the locale for a device is done in the settings, and can't be done by an app AFAIK. I know how to force my own app to a specific locale, described e.g. here:

http://www.tutorialforandroid.com/2009/01/force-localize-application-on-android.html

So now to my question. Can I force, programatically, the local of an activity that isn't mine?

I can imagine 2 ways this could be possible:

  1. Specifying the locale in an Intent used to start the activity.
  2. Access and manipulate the configuration of running activities (in the same way as I can modify my own activities' configurations).

Any thoughts? Is it possible? Is it reasonable? I guess 2. would be more direct, but require some kind of permission (e.g. the modified atcitiy must allow it in the manifest file). But I'd settle for 1. or similar.

What I want is to be able to see certain apps in a different language, but rather not change the system locale. E.g. the Android Market, that only displays comments in one language. Can't think of other things right now.

Can't find much written on Locale in the documentation, what is and isn't possible. But hoping some undocumented feature might enable this :)

like image 800
hermo Avatar asked Jun 10 '10 06:06

hermo


People also ask

What is a locale application?

The application locale defines the language and codeset for your application. The application locale defines: The language (for messages), The country or territory (for currency symbols and date formats), The code set (for character set encoding).


1 Answers

You can't unless the activity you are calling accepts a special locale parameter.

So, you can implement this with two of your own apps, or with the app of your friend, but there's no general way of doing this.

like image 88
zed_0xff Avatar answered Nov 10 '22 08:11

zed_0xff