Commit 67d00aceee
Copy SHA
67d00aceeee4e3b391588d31b8bbd8b7569cde55
parent: 961d0562a9
Verified · cmc
cmc <hello@cleberg.net> · 2026-11-22 20:49 UTC
Widgets, Controls and complications: localized fallbacks
The Clock control reads "Clock In to %@" as the watch app does.
Ref #224
Changed files (5)
Sources/OrgstarWatchWidgets/WatchWidgets.swift
+4 −4 · view
@@ -59,7 +59,7 @@ struct NextEntryView: View {
59 59 var body : some View {
60 60 switch family {
61 61 case . accessoryInline :
62 Text ( next . map { " \( $0 . gutter ) \( $0 . title ) " } ? ? ( open = = 0 ? " Agenda clear " : " \( open ) open today " ) )
62 Text ( next . map { " \( $0 . gutter ) \( $0 . title ) " } ? ? ( open = = 0 ? String ( localized : " Agenda clear " ) : String ( localized : " \( open ) open today " ) ) )
63 63 case . accessoryCircular :
64 64 ZStack {
65 65 AccessoryWidgetBackground ( )
@@ -69,11 +69,11 @@ struct NextEntryView: View {
69 69 }
70 70 }
71 71 case . accessoryCorner :
72 Text ( " \( open ) " ) . font ( . title3 . weight ( . semibold ) ) . widgetLabel { Text ( next ? . title ? ? " Agenda clear " ) }
72 Text ( " \( open ) " ) . font ( . title3 . weight ( . semibold ) ) . widgetLabel { Text ( next ? . title ? ? String ( localized : " Agenda clear " ) ) }
73 73 default :
74 74 VStack ( alignment : . leading , spacing : 0 ) {
75 Text ( next ? . gutter ? ? " Agenda " ) . font ( . headline ) . widgetAccentable ( ) . lineLimit ( 1 )
76 Text ( next ? . title ? ? ( entry . agenda = = nil ? " Open orgstar " : " Nothing left today " ) ) . lineLimit ( 2 )
75 Text ( next ? . gutter ? ? String ( localized : " Agenda " ) ) . font ( . headline ) . widgetAccentable ( ) . lineLimit ( 1 )
76 Text ( next ? . title ? ? ( entry . agenda = = nil ? String ( localized : " Open orgstar " ) : String ( localized : " Nothing left today " ) ) ) . lineLimit ( 2 )
77 77 }
78 78 . frame ( maxWidth : . infinity , alignment : . leading )
79 79 }
Sources/OrgstarWidgets/Controls.swift
+5 −4 · view
@@ -9,7 +9,7 @@ struct CaptureControl: ControlWidget {
9 9 var body : some ControlWidgetConfiguration {
10 10 AppIntentControlConfiguration ( kind : " sh.krz.orgstar.capture-control " , intent : CaptureControlConfiguration . self ) { configuration in
11 11 ControlWidgetButton ( action : OpenCaptureIntent ( template : configuration . template ) ) {
12 Label ( configuration . template ? . name ? ? " Capture " , systemImage : " square.and.pencil " )
12 Label ( configuration . template ? . name ? ? String ( localized : " Capture " ) , systemImage : " square.and.pencil " )
13 13 }
14 14 }
15 15 . displayName ( " Capture " )
@@ -23,7 +23,8 @@ struct ClockControl: ControlWidget {
23 23 var body : some ControlWidgetConfiguration {
24 24 StaticControlConfiguration ( kind : " sh.krz.orgstar.clock-control " , provider : ClockValueProvider ( ) ) { clock in
25 25 ControlWidgetToggle ( " Clock " , isOn : clock . running != nil , action : ClockToggleIntent ( ) ) { isOn in
26 Label ( isOn ? clock . running ? ? " Clocked in " : clock . last . map { " In: \( $0 ) " } ? ? " No recent clock " ,
26 Label ( isOn ? clock . running ? ? String ( localized : " Clocked in " )
27 : clock . last . map { String ( localized : " Clock In to \( $0 ) " ) } ? ? String ( localized : " No recent clock " ) ,
27 28 systemImage : isOn ? " stopwatch.fill " : " stopwatch " )
28 29 }
29 30 . tint ( . orange )
@@ -88,7 +89,7 @@ struct CaptureView: View {
88 89 Image ( systemName : " square.and.pencil " ) . font ( . title3 )
89 90 VStack ( alignment : . leading , spacing : 0 ) {
90 91 Text ( " Capture " ) . font ( . headline )
91 Text ( entry . template ? . name ? ? " First template " ) . font ( . caption ) . foregroundStyle ( . secondary ) . lineLimit ( 1 )
92 Text ( entry . template ? . name ? ? String ( localized : " First template " ) ) . font ( . caption ) . foregroundStyle ( . secondary ) . lineLimit ( 1 )
92 93 }
93 94 Spacer ( minLength : 0 )
94 95 }
@@ -96,7 +97,7 @@ struct CaptureView: View {
96 97 }
97 98 . widgetURL ( AppLink . capture ( template : entry . template ? . id ) . url )
98 99 . containerBackground ( for : . widget ) { Color . clear }
99 . accessibilityLabel ( " Capture " + ( entry . template . map { " with \( $0 . name ) " } ? ? " " ) )
100 . accessibilityLabel ( entry . template . map { Text ( " Capture with \( $0 . name ) " ) } ? ? Text ( " Capture " ) )
100 101 }
101 102 }
102 103 #endif
Sources/OrgstarWidgets/TodayWidget.swift
+1 −1 · view
@@ -85,7 +85,7 @@ struct TodayView: View {
85 85 }
86 86
87 87 @ ViewBuilder
88 private func rows ( _ rows : [ AgendaSnapshot . Row ] , _ snapshot : AgendaSnapshot , compact : Bool , empty : String ) -> some View {
88 private func rows ( _ rows : [ AgendaSnapshot . Row ] , _ snapshot : AgendaSnapshot , compact : Bool , empty : LocalizedStringKey ) -> some View {
89 89 if rows . isEmpty {
90 90 Text ( empty ) . font ( . caption ) . foregroundStyle ( . secondary )
91 91 }
docs/manual/guide/14-ios.org
+1 −1 · view
@@ -230,7 +230,7 @@ Widgets can't read your folders, so the app writes the next seven days of the ag
230 230 orgstar has two controls for Control Center, the Lock Screen and the Action button. Add them as any control: in Control Center, touch and hold an empty space and tap Add a Control, then choose orgstar.
231 231
232 232 - Capture :: opens the capture sheet. Touch and hold it while editing Control Center to choose a template; without one it uses the first.
233 - Clock :: on while a clock runs, showing its entry. Turning it off clocks out; turning it on clocks in to the entry clocked last (Clock In Last). If a clock was left running elsewhere, orgstar asks in the app how to resolve it.
233 - Clock :: on while a clock runs, showing its entry; off, it shows Clock In to /heading/ for the entry clocked last . Turning it off clocks out; turning it on clocks in to the entry clocked last (Clock In Last). If a clock was left running elsewhere, orgstar asks in the app how to resolve it.
234 234
235 235 ** The clock's Live Activity
236 236
l10n/Localizable.xcstrings
+102 · view
@@ -6001,6 +6001,40 @@
6001 6001 }
6002 6002 }
6003 6003 },
6004 "Capture with %@": {
6005 "localizations": {
6006 "de": {
6007 "stringUnit": {
6008 "state": "translated",
6009 "value": "Mit %@ erfassen"
6010 }
6011 },
6012 "es": {
6013 "stringUnit": {
6014 "state": "translated",
6015 "value": "Capturar con %@"
6016 }
6017 },
6018 "fr": {
6019 "stringUnit": {
6020 "state": "translated",
6021 "value": "Capturer avec %@"
6022 }
6023 },
6024 "ja": {
6025 "stringUnit": {
6026 "state": "translated",
6027 "value": "%@でキャプチャ"
6028 }
6029 },
6030 "pt-BR": {
6031 "stringUnit": {
6032 "state": "translated",
6033 "value": "Capturar com %@"
6034 }
6035 }
6036 }
6037 },
6004 6038 "Capture, the agenda, today's entries and the clock, from any app. When off, the menu bar shows orgstar only while a clock runs.": {
6005 6039 "localizations": {
6006 6040 "de": {
@@ -13589,6 +13623,40 @@
13589 13623 }
13590 13624 }
13591 13625 },
13626 "First template": {
13627 "localizations": {
13628 "de": {
13629 "stringUnit": {
13630 "state": "translated",
13631 "value": "Erste Vorlage"
13632 }
13633 },
13634 "es": {
13635 "stringUnit": {
13636 "state": "translated",
13637 "value": "Primera plantilla"
13638 }
13639 },
13640 "fr": {
13641 "stringUnit": {
13642 "state": "translated",
13643 "value": "Premier modèle"
13644 }
13645 },
13646 "ja": {
13647 "stringUnit": {
13648 "state": "translated",
13649 "value": "最初のテンプレート"
13650 }
13651 },
13652 "pt-BR": {
13653 "stringUnit": {
13654 "state": "translated",
13655 "value": "Primeiro modelo"
13656 }
13657 }
13658 }
13659 },
13592 13660 "Folder": {
13593 13661 "localizations": {
13594 13662 "de": {
@@ -21587,6 +21655,40 @@
21587 21655 }
21588 21656 }
21589 21657 },
21658 "No recent clock": {
21659 "localizations": {
21660 "de": {
21661 "stringUnit": {
21662 "state": "translated",
21663 "value": "Keine letzte Zeiterfassung"
21664 }
21665 },
21666 "es": {
21667 "stringUnit": {
21668 "state": "translated",
21669 "value": "Sin registro reciente"
21670 }
21671 },
21672 "fr": {
21673 "stringUnit": {
21674 "state": "translated",
21675 "value": "Aucun chronométrage récent"
21676 }
21677 },
21678 "ja": {
21679 "stringUnit": {
21680 "state": "translated",
21681 "value": "最近のクロックはありません"
21682 }
21683 },
21684 "pt-BR": {
21685 "stringUnit": {
21686 "state": "translated",
21687 "value": "Nenhum registro recente"
21688 }
21689 }
21690 }
21691 },
21590 21692 "Node Graph": {
21591 21693 "localizations": {
21592 21694 "de": {