nsdate-helper
nsdate-helper copied to clipboard
Support for Locale?
Is there any plan to support more language, like spanish?
Hi @chrux I'm sorry I didn't write back to your request sooner, I must have missed it. NSLocalizedString()
is being used for a couple of the few raw strings in this category, there's also some prefixes in there that need to be adjusted, specifically:
https://github.com/billymeltdown/nsdate-helper/blob/master/NSDate%2BHelper.m#L114 https://github.com/billymeltdown/nsdate-helper/blob/master/NSDate%2BHelper.m#L230
Otherwise, you should be able to use this category with a translation now, the two strings localized being "Yesterday" and "Today." Dates are otherwise formatted based on the user's currentCalendar, which takes locale into account.
Yeah, you're right, just one improvement to this line
text = [NSString stringWithFormat:@"%ld days ago", (NSInteger)daysAgo];
Maybe "days ago" should use "NSLocalizedString" too