Reputation: 5056
I have a calendar and can make local month names and short weekday names, for example weekdaynames with:
NSArray *weekdayNames = [[[[NSDateFormatter alloc] init] autorelease] shortWeekdaySymbols];
How can I localize these?
For example:
a daycounter i = 1..31
daystr = [NSString stringWithFormat: @" %i", daycounter];}
I get fine 1...31
in latin Numbers
What do I have to change/add that I get for example Arabic Numbers, Chinese Numbers etc?
Upvotes: 0
Views: 174
Reputation: 5056
I solved it now with:
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
daystr = [formatter stringFromNumber:[NSNumber numberWithInt:daycounter]];
[formatter release];
Upvotes: 1
Reputation: 24602
You could remove the restrictions altogether.
daystr = [NSString stringWithString: @" %s", daycounter];}
Upvotes: 0