Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIDatePicker locale does nothing?

I'm creating a UIDatePicker programmatically, and setting its locale with the following code:

datePicker.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"] autorelease];

The datepicker still appears in English (or whatever language I've set the phone to). Anyone have any idea why this does nothing, or how to fix it?

like image 395
DougW Avatar asked Apr 01 '26 19:04

DougW


1 Answers

As answered here Can I localize a UIDatePicker?, the picker display depends on country settings, not on language settings.

In your example you are changing the language locale only.

like image 165
Vlad Grichina Avatar answered Apr 04 '26 10:04

Vlad Grichina