Skip to content

Problem with NSLocale #1

@TXF

Description

@TXF

NSLocale property isn't considered at all, 'cos property is set after

 -(void)initCommon

method in

- (void)setLocale:(NSLocale *)loc

, so it gives no effect.

To force locale work properly I had to change:

- (void)setLocale:(NSLocale *)loc {
    _locale = loc;
}

to

- (void)setLocale:(NSLocale *)loc {
    _locale = loc;
    self.calendar.locale = loc;
    [self initPickerData];
}

the problem that it also demand's repopulate dataSource array for years ( 10 000 by default).
It maybe seems that years are always presented as a numbers, and only take into consideration months that could have different names in other languages, but I found that this isn't true for japanese language (maybe others too)

screen shot 2015-04-17 at 3 53 34 am

Thus

- (void)initPickerData () { 
....
_months = [dateFormatter monthSymbols];  /* it works only for months (looks good for japanese)
// Form list of years
 [dateFormatter setDateFormat:@"yyyy"]; /* this doesn't and needs to be rewritten as @"yyyy年MM月dd日" */  

I dunno maybe exists a better solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions