有一个表格视图可以在我的应用程序中显示所有本机日历源标题和日历标题,这是我获取标题的代码:
NSArray <EKSource *> *nativeCalendarEventSources = self.eventStore.sources
for (EKSource *ekSource in nativeCalendarEventSources)
{
NSSet<EKCalendar *> *ekCalendars = [ekSource calendarsForEntityType:EKEntityTypeEvent];
// We import sources if it has non-zero calendars.
if (ekCalendars.count)
{
NativeCalendarAccountSource *localSource = [NativeCalendarAccountSource findOrCreateWithIdentifier:ekSource.sourceIdentifier
managedObjectContext:context];
localSource.title = ekSource.title;
[sourcesToBeDeleted removeObject:localSource];
for (EKCalendar *ekCalendar in ekCalendars)
{
NativeCalendarAccount *localCalendarAccount = [NativeCalendarAccount findOrCreateWithIdentifier:ekCalendar.calendarIdentifier
managedObjectContext:context];
localCalendarAccount.title = ekCalendar.title;
localCalendarAccount.source = localSource;
}
}
但我发现标题:“其他”,“订阅的日历”未本地化, 我们有什么方法可以将它本地化吗?