Set Language to French in Android Datepickerdialog

Set default Locale to DatePicker and TimePicker

You need to create your custom DatePicker or TimePicker
.
See this link https://stackoverflow.com/a/9220899/3864698. It can help you to solve your problem.

Or you can use Reflection to edit the NumberPicker values, follow this link for the complete solution.

DatePickerDialog in arabic language

I found the answer is to change the "Locale" of the whole app to "ar"
At your starting activity set your application Locale to "ar" by below code and all views and dialogs will be switched to Arabic.

    Locale locale = new Locale("ar");
Locale.setDefault(locale);
Configuration config =
getBaseContext().getResources().getConfiguration();
config.setLocale(locale);
createConfigurationContext(config);

How to change language in datepicker?

change here

days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"],
daysShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],

TO

days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sonntag"],

daysShort: ["Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat"],

daysMin: ["Sun", "Mon", "Tue", "Wed", "Thr", "Fri", "Sat"],


Related Topics



Leave a reply



Submit