Skip to content

Commit dc3adf8

Browse files
committed
Rename gesture_footer key per review feedback
Per review from bgoncal: use a new localized key so the broken translations in Lokalise (de/nl with reversed format specifiers) are not downloaded over the fix on the next nightly sync. Rename kiosk.security.gesture_footer -> kiosk.security.exit_gesture_footer. Lokalise has no translations for the new key, so all non-English locales fall back to the English base text via --export-empty-as base. Translators can then add properly-positional translations at their own pace without any crash risk (both slots are %@). The old key becomes orphaned in de/nl .strings files; the nightly unused-strings CI check will flag it for cleanup.
1 parent 5f9cf3d commit dc3adf8

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

Sources/App/Kiosk/Settings/KioskSettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public struct KioskSettingsView: View {
166166
} footer: {
167167
if viewModel.settings.secretExitGestureEnabled {
168168
Text(
169-
L10n.Kiosk.Security.gestureFooter(
169+
L10n.Kiosk.Security.exitGestureFooter(
170170
viewModel.settings.secretExitGestureCorner.displayName,
171171
String(viewModel.settings.secretExitGestureTaps)
172172
)

Sources/App/Resources/en.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ This server requires a client certificate (mTLS) but the operation was cancelled
492492
"kiosk.section.title" = "Kiosk Mode";
493493
"kiosk.security.device_auth" = "Device Authentication";
494494
"kiosk.security.gesture_corner" = "Exit Gesture Corner";
495-
"kiosk.security.gesture_footer" = "Tap the %1$@ corner %2$@ times to access kiosk settings when locked.";
495+
"kiosk.security.exit_gesture_footer" = "Tap the %1$@ corner %2$@ times to access kiosk settings when locked.";
496496
"kiosk.security.hide_status_bar" = "Hide Status Bar";
497497
"kiosk.security.prevent_autolock" = "Prevent Auto-Lock";
498498
"kiosk.security.secret_gesture" = "Secret Exit Gesture";

Sources/Shared/Resources/Swiftgen/Strings.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,12 +1830,12 @@ public enum L10n {
18301830
public enum Security {
18311831
/// Device Authentication
18321832
public static var deviceAuth: String { return L10n.tr("Localizable", "kiosk.security.device_auth") }
1833-
/// Exit Gesture Corner
1834-
public static var gestureCorner: String { return L10n.tr("Localizable", "kiosk.security.gesture_corner") }
18351833
/// Tap the %1$@ corner %2$@ times to access kiosk settings when locked.
1836-
public static func gestureFooter(_ p1: Any, _ p2: Any) -> String {
1837-
return L10n.tr("Localizable", "kiosk.security.gesture_footer", String(describing: p1), String(describing: p2))
1834+
public static func exitGestureFooter(_ p1: Any, _ p2: Any) -> String {
1835+
return L10n.tr("Localizable", "kiosk.security.exit_gesture_footer", String(describing: p1), String(describing: p2))
18381836
}
1837+
/// Exit Gesture Corner
1838+
public static var gestureCorner: String { return L10n.tr("Localizable", "kiosk.security.gesture_corner") }
18391839
/// Hide Status Bar
18401840
public static var hideStatusBar: String { return L10n.tr("Localizable", "kiosk.security.hide_status_bar") }
18411841
/// Prevent Auto-Lock

Tests/App/Kiosk/KioskLocalization.test.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import XCTest
66
/// Regression tests for kiosk L10n format strings across all bundled locales.
77
///
88
/// Guards against issue #4487, in which German and Dutch translations of
9-
/// `kiosk.security.gesture_footer` reordered format specifiers without using
9+
/// `kiosk.security.exit_gesture_footer` reordered format specifiers without using
1010
/// positional markers (`%N$...`), causing `String(format:)` to misinterpret a
1111
/// CVarArg as the wrong type and crash (EXC_BAD_ACCESS) when the Kiosk
1212
/// settings view body was evaluated.
@@ -27,7 +27,7 @@ final class KioskLocalizationTests: XCTestCase {
2727
("kiosk.clock.accessibility.current_time", ["3:45 PM"], 1),
2828
("kiosk.clock.accessibility.date", ["Wednesday, April 8"], 1),
2929
("kiosk.security.taps_required", ["5"], 1),
30-
("kiosk.security.gesture_footer", ["top-left", "5"], 2),
30+
("kiosk.security.exit_gesture_footer", ["top-left", "5"], 2),
3131
]
3232

3333
func testKioskFormatStringsAcrossAllLocales() throws {
@@ -113,20 +113,20 @@ final class KioskLocalizationTests: XCTestCase {
113113
let language = lprojURL.deletingPathExtension().lastPathComponent
114114
let stringsURL = lprojURL.appendingPathComponent("Localizable.strings")
115115
guard let strings = NSDictionary(contentsOf: stringsURL) as? [String: String],
116-
let format = strings["kiosk.security.gesture_footer"] else {
116+
let format = strings["kiosk.security.exit_gesture_footer"] else {
117117
continue
118118
}
119119

120120
// Inject this locale's format into the LocalizedManager.
121121
let localized = LocalizedManager()
122122
localized.add(stringProvider: { request in
123-
request.key == "kiosk.security.gesture_footer" ? format : nil
123+
request.key == "kiosk.security.exit_gesture_footer" ? format : nil
124124
})
125125
Current.localized = localized
126126

127127
// Call the generated L10n function — this is the exact path
128128
// KioskSettingsView exercises when rendering the footer.
129-
let result = L10n.Kiosk.Security.gestureFooter("top-left", 5)
129+
let result = L10n.Kiosk.Security.exitGestureFooter("top-left", 5)
130130
XCTAssertFalse(
131131
result.isEmpty,
132132
"Locale '\(language)' gestureFooter produced empty result"

0 commit comments

Comments
 (0)