Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with NSLocale #1

Open
TXF opened this issue Apr 17, 2015 · 1 comment
Open

Problem with NSLocale #1

TXF opened this issue Apr 17, 2015 · 1 comment

Comments

@TXF
Copy link

TXF commented Apr 17, 2015

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

@lukaszmargielewski
Copy link

I have similar issue and need for laocazation to work properly.
Created pull request: #2

nairteashop pushed a commit that referenced this issue Feb 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants