Hello,
This issue is reported in the MAUI github:DatePicker is not localization in the calendar view. #15744 Please track on this issue in the above link.
You can use following DatePickerHandler in the app.xaml.cs, except the cancel and Ok button's text will not be changed, other content will be changed as normal.
Microsoft.Maui.Handlers.DatePickerHandler.Mapper.PrependToMapping("MyCustomization", (handler, view) =>
{
#if ANDROID
Java.Util.Locale locale = new Java.Util.Locale("fr-FR");
handler.PlatformView.TextLocale = locale;
Android.Content.Res.Configuration config = new Android.Content.Res.Configuration();
config.Locale = locale;
Java.Util.Locale.SetDefault(Java.Util.Locale.Category.Format, locale);
Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.Configuration.SetLocale(locale);
Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.Configuration.Locale = locale;
Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.UpdateConfiguration(config, Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.DisplayMetrics);
Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.UpdateConfiguration(config, Microsoft.Maui.ApplicationModel.Platform.CurrentActivity.Resources.DisplayMetrics);
#endif
});
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.