|
|
@@ -13,41 +13,48 @@ struct WidgetQuickAction: Identifiable, Hashable {
|
|
|
}
|
|
|
|
|
|
let id: String
|
|
|
- let title: String
|
|
|
+ /// Localization key in `Localizable.strings`.
|
|
|
+ let titleKey: String
|
|
|
let systemImage: String
|
|
|
let destination: Destination
|
|
|
+
|
|
|
+ var localizedTitle: String { titleKey.localized }
|
|
|
}
|
|
|
|
|
|
struct WidgetVariant: Identifiable, Hashable {
|
|
|
let id: String
|
|
|
- let title: String
|
|
|
- let subtitle: String
|
|
|
+ /// Localization keys in `Localizable.strings`.
|
|
|
+ let titleKey: String
|
|
|
+ let subtitleKey: String
|
|
|
let size: WidgetSize
|
|
|
let quickActions: [WidgetQuickAction]
|
|
|
+
|
|
|
+ var localizedTitle: String { titleKey.localized }
|
|
|
+ var localizedSubtitle: String { subtitleKey.localized }
|
|
|
}
|
|
|
|
|
|
enum WidgetTemplates {
|
|
|
static let meetVariants: [WidgetVariant] = [
|
|
|
WidgetVariant(
|
|
|
id: "meet_small",
|
|
|
- title: "Google Meet".localized,
|
|
|
- subtitle: "Open and join quickly".localized,
|
|
|
+ titleKey: "Google Meet",
|
|
|
+ subtitleKey: "Open and join quickly",
|
|
|
size: .small,
|
|
|
quickActions: [
|
|
|
- WidgetQuickAction(id: "open", title: "Open Meet".localized, systemImage: "video.fill", destination: .openMeetWeb),
|
|
|
- WidgetQuickAction(id: "join", title: "Join Meetings".localized, systemImage: "arrow.up.forward.app.fill", destination: .joinMeetings)
|
|
|
+ WidgetQuickAction(id: "open", titleKey: "Open Meet", systemImage: "video.fill", destination: .openMeetWeb),
|
|
|
+ WidgetQuickAction(id: "join", titleKey: "Join Meetings", systemImage: "arrow.up.forward.app.fill", destination: .joinMeetings)
|
|
|
]
|
|
|
),
|
|
|
WidgetVariant(
|
|
|
id: "meet_medium",
|
|
|
- title: "Google Meet".localized,
|
|
|
- subtitle: "Upcoming meetings".localized,
|
|
|
+ titleKey: "Google Meet",
|
|
|
+ subtitleKey: "Upcoming meetings",
|
|
|
size: .medium,
|
|
|
quickActions: [
|
|
|
- WidgetQuickAction(id: "schedule", title: "Schedule".localized, systemImage: "clock.badge.checkmark", destination: .schedule),
|
|
|
- WidgetQuickAction(id: "calendar", title: "Calendar".localized, systemImage: "calendar", destination: .calendar),
|
|
|
- WidgetQuickAction(id: "settings", title: "Settings".localized, systemImage: "gearshape.fill", destination: .settings),
|
|
|
- WidgetQuickAction(id: "refresh", title: "Refresh".localized, systemImage: "arrow.clockwise", destination: .refreshMeetings)
|
|
|
+ WidgetQuickAction(id: "schedule", titleKey: "Schedule", systemImage: "clock.badge.checkmark", destination: .schedule),
|
|
|
+ WidgetQuickAction(id: "calendar", titleKey: "Calendar", systemImage: "calendar", destination: .calendar),
|
|
|
+ WidgetQuickAction(id: "settings", titleKey: "Settings", systemImage: "gearshape.fill", destination: .settings),
|
|
|
+ WidgetQuickAction(id: "refresh", titleKey: "Refresh", systemImage: "arrow.clockwise", destination: .refreshMeetings)
|
|
|
]
|
|
|
)
|
|
|
]
|