Skip to content

Commit

Permalink
fix: missing localized strings
Browse files Browse the repository at this point in the history
closes #450
  • Loading branch information
ejbills committed Jan 9, 2025
1 parent 78b5745 commit c7432ce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
6 changes: 3 additions & 3 deletions DockDoor/Components/EnabledActionRowView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ struct EnabledActionRowView: View {
var iconName: String
var action: (() -> Void)?
var disableShine: Bool = false
var buttonText: String = "Open Settings"
var statusText: String = "Granted"
var buttonText: String = .init(localized: "Open Settings")
var statusText: String = .init(localized: "Granted")
var customStatusView: AnyView?
var hideStatus: Bool = false

Expand All @@ -34,7 +34,7 @@ struct EnabledActionRowView: View {
} else {
VStack(alignment: .trailing, spacing: 4) {
HStack {
Text(isGranted ? statusText : "Not \(statusText.lowercased())")
Text(isGranted ? statusText : String(localized: "Not \(statusText.lowercased())"))
.font(.caption)
.foregroundStyle(.secondary)
Image(systemName: isGranted ? "checkmark.circle.fill" : "xmark.circle.fill")
Expand Down
10 changes: 8 additions & 2 deletions DockDoor/Components/StyledGroupBox.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import SwiftUI

struct StyledGroupBox<Content: View>: View {
let label: String
let label: LocalizedStringKey
let content: Content

init(label: String, @ViewBuilder content: () -> Content) {
init(label: LocalizedStringKey, @ViewBuilder content: () -> Content) {
self.label = label
self.content = content()
}

// Add convenience init for string literals
init(_ label: LocalizedStringKey, @ViewBuilder content: () -> Content) {
self.label = label
self.content = content()
}
Expand Down
14 changes: 12 additions & 2 deletions DockDoor/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -9899,7 +9899,6 @@
}
},
"Colors" : {
"extractionState" : "stale",
"localizations" : {
"af" : {
"stringUnit" : {
Expand Down Expand Up @@ -12565,6 +12564,9 @@
}
}
}
},
"Dock Previews" : {

},
"Dock Previews & Window Switcher" : {
"comment" : "Preview window title display condition option",
Expand Down Expand Up @@ -17900,7 +17902,6 @@
}
},
"Granted" : {
"extractionState" : "stale",
"localizations" : {
"af" : {
"stringUnit" : {
Expand Down Expand Up @@ -25326,6 +25327,9 @@
}
}
}
},
"Not %@" : {

},
"Not granted" : {
"extractionState" : "stale",
Expand Down Expand Up @@ -42089,6 +42093,9 @@
}
}
}
},
"Traffic Light Buttons" : {

},
"Traffic Light Buttons Position" : {
"extractionState" : "stale",
Expand Down Expand Up @@ -48564,6 +48571,9 @@
}
}
}
},
"Window Preview Layout" : {

},
"Window Preview Layout Limits" : {
"extractionState" : "stale",
Expand Down

0 comments on commit c7432ce

Please sign in to comment.