NSCalendar的本地化名称

时间:2015-12-17 19:48:39

标签: swift nscalendar

我想创建一个包含可用日历的表格视图。

…
var cells: [CLProperty.PropertyCell] = []
let calendars = [NSCalendarIdentifierBuddhist, NSCalendarIdentifierChinese, NSCalendarIdentifierEthiopicAmeteAlem, NSCalendarIdentifierEthiopicAmeteMihret, NSCalendarIdentifierGregorian, NSCalendarIdentifierHebrew, NSCalendarIdentifierIndian, NSCalendarIdentifierIslamic, NSCalendarIdentifierIslamicCivil, NSCalendarIdentifierIslamicTabular, NSCalendarIdentifierIslamicUmmAlQura, NSCalendarIdentifierISO8601, NSCalendarIdentifierJapanese, NSCalendarIdentifierPersian, NSCalendarIdentifierRepublicOfChina]
for cal in calendars {
  let co = NSCalendar(calendarIdentifier: cal)
  let ll: String = … // method to obtain the localized calendar name
  cells.append(CLProperty.PropertyCell(cellIdentifier: CLProperty.PropertyCellTypes.SimpleCell, propertyID: NSCalendar.Properties.Calendar, cellBehavior: .None, caption: ll, currentValue: co))
}
…

我无法找到合适的方法。我应该使用NSLocalizedString吗?

0 个答案:

没有答案