nsdate-helper icon indicating copy to clipboard operation
nsdate-helper copied to clipboard

Support for Locale?

Open chrux opened this issue 10 years ago • 2 comments

Is there any plan to support more language, like spanish?

chrux avatar May 25 '14 19:05 chrux

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.

billymeltdown avatar Apr 21 '15 14:04 billymeltdown

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

chrux avatar Apr 21 '15 14:04 chrux