From 10d421b25b57d51a905587fad390e58826a2c47e Mon Sep 17 00:00:00 2001 From: Felipe Giacomini Cocco Date: Thu, 5 Feb 2026 18:27:11 -0300 Subject: [PATCH] Fix strings detections and translates the entire "Live Activities" section --- DynamicIsland/Localizable.xcstrings | 140 ++++++++++++++++++ .../components/Settings/SettingsView.swift | 30 ++-- DynamicIsland/models/Constants.swift | 6 +- 3 files changed, 158 insertions(+), 18 deletions(-) diff --git a/DynamicIsland/Localizable.xcstrings b/DynamicIsland/Localizable.xcstrings index 67ceccb..b0f87de 100644 --- a/DynamicIsland/Localizable.xcstrings +++ b/DynamicIsland/Localizable.xcstrings @@ -1710,6 +1710,16 @@ } } }, + "Accent" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Destaque" + } + } + } + }, "Accent color" : { "localizations" : { "pt-BR" : { @@ -7251,6 +7261,16 @@ } } }, + "Custom Focus metadata" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Metadados de Foco Customizado" + } + } + } + }, "Custom height" : { "localizations" : { "ar" : { @@ -9208,6 +9228,16 @@ } } }, + "Enable Camera Detection" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ativar Detecção de Câmera" + } + } + } + }, "Enable Clipboard Manager" : { "localizations" : { "pt-BR" : { @@ -9348,6 +9378,16 @@ } } }, + "Enable Focus Detection" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ativar Detecção de Foco" + } + } + } + }, "Enable gestures" : { "localizations" : { "pt-BR" : { @@ -9532,6 +9572,16 @@ } } }, + "Enable Microphone Detection" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Habilitar Detecção de Microfone" + } + } + } + }, "Enable Minimalistic UI" : { "localizations" : { "pt-BR" : { @@ -9702,6 +9752,16 @@ } } }, + "Enable Screen Recording Detection" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ativar Detecção de Gravação de Tela" + } + } + } + }, "Enable shelf" : { "localizations" : { "pt-BR" : { @@ -10765,6 +10825,16 @@ } } }, + "Full Disk Access unlocks custom Focus icons, colors, and labels. Standard Focus detection still works without it—grant access only if you need personalized indicators." : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "O Acesso Total ao Disco desbloqueia ícones, cores e rótulos personalizados do Foco. A detecção de foco padrão ainda funciona sem ele - conceda acesso apenas se você precisar de indicadores personalizados." + } + } + } + }, "Fully charged" : { "comment" : "Charging fallback label when already charged", "localizations" : { @@ -11688,6 +11758,16 @@ } } }, + "Green" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Verde" + } + } + } + }, "grid" : { "localizations" : { "pt-BR" : { @@ -20994,6 +21074,26 @@ } } }, + "Show Caps Lock Indicator" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar Indicador de Caps Lock" + } + } + } + }, + "Show Caps Lock label" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar rótulo Caps Lock" + } + } + } + }, "Show Change Media Output control" : { "localizations" : { "pt-BR" : { @@ -21110,6 +21210,36 @@ } } }, + "Show Focus as brief toast" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar Foco como um breve visualização" + } + } + } + }, + "Show Focus Indicator" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar Indicador de Foco" + } + } + } + }, + "Show Focus Label" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar Rótulo do Foco" + } + } + } + }, "Show full event titles" : { "comment" : "A toggle that shows or hides the full event titles in the calendar view", "isCommentAutoGenerated" : true, @@ -21464,6 +21594,16 @@ } } }, + "Show Recording Indicator" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Mostrar Indicador de Gravação" + } + } + } + }, "Show sneak peek on playback changes" : { "comment" : "A toggle that enables showing sneak peek when the currently playing track changes.", "isCommentAutoGenerated" : true, diff --git a/DynamicIsland/components/Settings/SettingsView.swift b/DynamicIsland/components/Settings/SettingsView.swift index 9977d7a..1b47734 100644 --- a/DynamicIsland/components/Settings/SettingsView.swift +++ b/DynamicIsland/components/Settings/SettingsView.swift @@ -3298,10 +3298,10 @@ struct LiveActivitiesSettings: View { var body: some View { Form { Section { - Defaults.Toggle("Enable Screen Recording Detection", key: .enableScreenRecordingDetection) + Defaults.Toggle(String(localized: "Enable Screen Recording Detection"), key: .enableScreenRecordingDetection) .settingsHighlight(id: highlightID("Enable Screen Recording Detection")) - Defaults.Toggle("Show Recording Indicator", key: .showRecordingIndicator) + Defaults.Toggle(String(localized: "Show Recording Indicator"), key: .showRecordingIndicator) .disabled(!enableScreenRecordingDetection) .settingsHighlight(id: highlightID("Show Recording Indicator")) @@ -3332,30 +3332,30 @@ struct LiveActivitiesSettings: View { Section { if !fullDiskAccessPermission.isAuthorized { SettingsPermissionCallout( - title: "Custom Focus metadata", - message: "Full Disk Access unlocks custom Focus icons, colors, and labels. Standard Focus detection still works without it—grant access only if you need personalized indicators.", + title: String(localized: "Custom Focus metadata"), + message: String(localized: "Full Disk Access unlocks custom Focus icons, colors, and labels. Standard Focus detection still works without it—grant access only if you need personalized indicators."), icon: "externaldrive.fill", iconColor: .purple, - requestButtonTitle: "Request Full Disk Access", - openSettingsButtonTitle: "Open Privacy & Security", + requestButtonTitle: String(localized: "Request Full Disk Access"), + openSettingsButtonTitle: String(localized: "Open Privacy & Security"), requestAction: { fullDiskAccessPermission.requestAccessPrompt() }, openSettingsAction: { fullDiskAccessPermission.openSystemSettings() } ) } - Defaults.Toggle("Enable Focus Detection", key: .enableDoNotDisturbDetection) + Defaults.Toggle(String(localized: "Enable Focus Detection"), key: .enableDoNotDisturbDetection) .settingsHighlight(id: highlightID("Enable Focus Detection")) - Defaults.Toggle("Show Focus Indicator", key: .showDoNotDisturbIndicator) + Defaults.Toggle(String(localized: "Show Focus Indicator"), key: .showDoNotDisturbIndicator) .disabled(!enableDoNotDisturbDetection) .settingsHighlight(id: highlightID("Show Focus Indicator")) - Defaults.Toggle("Show Focus Label", key: .showDoNotDisturbLabel) + Defaults.Toggle(String(localized: "Show Focus Label"), key: .showDoNotDisturbLabel) .disabled(!enableDoNotDisturbDetection || focusIndicatorNonPersistent) .help(focusIndicatorNonPersistent ? "Labels are forced to compact on/off text while brief toast mode is enabled." : "Show the active Focus name inside the indicator.") .settingsHighlight(id: highlightID("Show Focus Label")) - Defaults.Toggle("Show Focus as brief toast", key: .focusIndicatorNonPersistent) + Defaults.Toggle(String(localized: "Show Focus as brief toast"), key: .focusIndicatorNonPersistent) .disabled(!enableDoNotDisturbDetection) .settingsHighlight(id: highlightID("Show Focus as brief toast")) .help("When enabled, Focus appears briefly (on/off) and then collapses instead of staying visible.") @@ -3392,10 +3392,10 @@ struct LiveActivitiesSettings: View { } Section { - Defaults.Toggle("Show Caps Lock Indicator", key: .enableCapsLockIndicator) + Defaults.Toggle(String(localized: "Show Caps Lock Indicator"), key: .enableCapsLockIndicator) .settingsHighlight(id: highlightID("Show Caps Lock Indicator")) - Defaults.Toggle("Show Caps Lock label", key: .showCapsLockLabel) + Defaults.Toggle(String(localized: "Show Caps Lock label"), key: .showCapsLockLabel) .disabled(!Defaults[.enableCapsLockIndicator]) .settingsHighlight(id: highlightID("Show Caps Lock label")) @@ -3414,9 +3414,9 @@ struct LiveActivitiesSettings: View { } Section { - Defaults.Toggle("Enable Camera Detection", key: .enableCameraDetection) + Defaults.Toggle(String(localized: "Enable Camera Detection"), key: .enableCameraDetection) .settingsHighlight(id: highlightID("Enable Camera Detection")) - Defaults.Toggle("Enable Microphone Detection", key: .enableMicrophoneDetection) + Defaults.Toggle(String(localized: "Enable Microphone Detection"), key: .enableMicrophoneDetection) .settingsHighlight(id: highlightID("Enable Microphone Detection")) if privacyManager.isMonitoring { @@ -3473,7 +3473,7 @@ struct LiveActivitiesSettings: View { } Section { - Defaults.Toggle("Enable reminder live activity", key: .enableReminderLiveActivity) + Defaults.Toggle(String(localized: "Enable reminder live activity"), key: .enableReminderLiveActivity) .settingsHighlight(id: highlightID("Enable reminder live activity")) } header: { Text("Reminder Live Activity") diff --git a/DynamicIsland/models/Constants.swift b/DynamicIsland/models/Constants.swift index 4afb8e1..44aca8b 100644 --- a/DynamicIsland/models/Constants.swift +++ b/DynamicIsland/models/Constants.swift @@ -355,11 +355,11 @@ enum CapsLockIndicatorTintMode: String, CaseIterable, Identifiable, Defaults.Ser var displayName: String { switch self { case .green: - return "Green" + return String(localized: "Green") case .accent: - return "Accent" + return String(localized: "Accent") case .white: - return "White" + return String(localized: "White") } }