views:

148

answers:

3

Is it possible to configure android.app.DatePickerDialog so that it is localized for the European format easily (exchange day and month and exchange the english button names with localized ones) ?

A: 

You could design 2 DatePickerDialogs and use a condition based on the Locale class to choose between one or the other. However, as there is no "Europe" locale, but only countries locales, you might need to put the european locales in a list, and check if the locale is in the list. The current locale of the phone is accessed with : Locale.getDefault()

Sephy
But the android.app.DatePickerDialog has no option to localize it to another format, or do i oversee it ? Do i have to rewrite it on my own ?
Georg
I don't know a lot about this kind of dialog, but I think you do have to rewrite your own.
Sephy
A: 

The DatePickerDialog is localized by default. I tried it on a real device and the localization of the dialog adapts to the system default.

Georg
A: 

In my app, I've language preferences, where user can select the language of the application s/he wants to view application in. Depending upon the language selected, is it possible to set locale of DatePickerDialog "programatically"?

Jay