How in iOS to localize text of the month in UIDatePicker, and if it is possible at all?

new2ios picture new2ios · Jun 1, 2015 · Viewed 15.8k times · Source

I make search and up to now I see that UIDatePicker is working with localization of the device.

I have app which has internal lozalization. I need to change month's text dependantly of my internal localization. As I read it appears that this is not possible - I have to make my own custom picker.

Is there a way to achieve that without custom Dat picker?

Answer

Andrey Kuznetsov picture Andrey Kuznetsov · Jun 1, 2015

Use locale property of UIDatePicker. I can't see any signs that the property is deprecated.

This code will localize picker to Japanese.

[datePicker setLocale: [NSLocale localeWithLocaleIdentifier:@"ja"]];

Replace "ja" with any language code you need.