Change UIDatePicker language in countdown timer mode

I have a UIDatePicker in CountdownTimer mode and you need to change the wording of hours and min to German. I tried both, set locale to German (Germany) in the storyboard and in the code, but both failed, and the application still shows the default English words for hours and min .

 timePicker.locale = Locale(identifier: "de") 

When I set the locale to UIDatePicker in Date and Time mode, it respects German correctly and displays the date in German format. Any idea why the locale doesn't change in countdown timer mode? Thanks.

0
source share
1 answer

Thanks Why doesn't the UIActivityViewController display a localized undo string? The published solution also solved the problem of localizing UIDatePicker in the countdown timer mode, at least on iOS 11. Thanks.

Add this line to your info.plist :

enter image description here

And it also helps to correctly localize the Cancel button on the general sheet of the system: UIActivityViewController - how to change the text of the cancel button .

0
source

All Articles