2

I want to get localized timer labels on my developing application. For example, "hour,hours" and "min" on en_US, "時間" and "分" on ja_JP, "ora,ore" and "min" on it_IT etc. UIDatePickerCountDownTimer mode can display them, but there seems no method to access.

I studied NSDateFormatter,NSLocale,UIDatePicker,etc, but I couldn't find the solution. Please help me...

colori
  • 21
  • 1
  • Can you show a more explicit example of the output you would like to show? Would it be something like `9 hours, 20 minutes and 34 seconds`? – Fran Sevillano Dec 05 '11 at 15:21
  • Thanks, my app saves amount of seconds, for example 5400. Then I want to display it to "1hour 30min" on en_US locale and "1分 30秒" on ja_JP. – colori Dec 05 '11 at 23:43
  • @colori Did you ever find a solution to this? My initial thought is to subclass UIDatePicker and add custom labels over the default hour/minute labels. – ssnielsen Mar 04 '16 at 10:03

1 Answers1

0

The text of the "hour" and "min" labels on UIDatePicker is not accessible to developers. If you want to use that text in your own app in a different context, you'll have to provide it yourself.

Of course, if you feel like this is something the frameworks should provide, please file a bug requesting this enhancement.

Dave DeLong
  • 242,470
  • 58
  • 448
  • 498
  • Thank you. I think so... UIDatePicker may get labels information on background proccess. I don't have to access it via UIDatePicker, but I want to know the origin. – colori Dec 05 '11 at 23:56
  • @colori based on your comment to the question, you'll have to supply the "hours" and "分" stuff yourself. – Dave DeLong Dec 06 '11 at 00:11
  • Ok. It will hard for me to prepare many languages combination, so I'll use simplified "hour(s)" and "min" label. Thank you. – colori Dec 06 '11 at 07:36