Is it possible to localize CalendarView or DatePicker?

My users calendar is a Persian calendar. I have an algorithm for changing the date and time between Western and Persian calendars. I want to use CalendarView or DatePicker for my users to select dates. Is it possible to localize CalendarView and DatePicker to support my local calendar?

+5
source share
2 answers

CalendarViewuses the current locale to determine how dates should be displayed. It also implements onConfigurationChangedto listen for changes to the current locale and update the calendar. But it does not seem to support your scenario in which you want to specify a different language to be used (for example, the current localization of users is Persian, and you want to show the calendar view in the western locale).

Unfortunately, the setCurrentLocale method is private, so even if you use a subclass of CalendarView, you cannot change the language used.

You can see the Source Code for CalendarView.

0
source

, . . Custom View Google Api. , , , translate.google.com api .

0

All Articles