Re: Localized time estimates?
Re: Localized time estimates?
- Subject: Re: Localized time estimates?
- From: Maxthon Chan <email@hidden>
- Date: Fri, 29 Nov 2013 02:08:46 +0800
I’d usually go with this:
MSSTR(NSLocalizedString(@“ui.approxTimeFormat”, nil), MSLocalizedTimeInterval(timeInterval))
In en_US it expands:
ui.approxTimeFormat = “Approx. %@“
In zh_CN:
ui.approxTimeFormat = “大约 %@后“
Note: MSSTR(...) is a macro expands to [NSString stringWithFormat:__VA_ARGS__] to save space, and I have a habit of using code-like localisation keys, you can find an alternative implementation in my MSBooster library (and hence the prefix). The MSLocalizedTimeInterval turns a time interval into its localised human-friendly version.
On Nov 29, 2013, at 1:31, Graham Cox <email@hidden> wrote:
> I’m fairly sure the answer’s no, but is there any way to get a localized time-estimate string, given a NSTimeInterval? e.g. “about 10 seconds”, etc for progress indicators and the like.
>
> —Graham
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden