Localize Android DatePickerDialog

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

+4
source share
2 answers

By default, DatePickerDialog is localized. I tried it on a real device, and the localization of the dialogue adapts to the system standard.

+4
source

You can create 2 DatePickerDialog and use a condition based on the Locale class to select one or the other. However, since there is no β€œEurope” language standard, but only for countries, you may need to place European locales on the list and check if the language standard is on the list. Access the current phone language using: Locale.getDefault()

0
source

All Articles