From df665866026bfd4844744082923904276b328e36 Mon Sep 17 00:00:00 2001 From: Felipe Giacomini Cocco Date: Thu, 5 Feb 2026 14:57:27 -0300 Subject: [PATCH] Fix strings detections and translates the entire "Clipboard Manager" section and change the width to work better with all languages --- DynamicIsland/Localizable.xcstrings | 80 ++++++++++++++++++- .../components/Settings/SettingsView.swift | 22 ++--- DynamicIsland/managers/ClipboardManager.swift | 12 +-- 3 files changed, 95 insertions(+), 19 deletions(-) diff --git a/DynamicIsland/Localizable.xcstrings b/DynamicIsland/Localizable.xcstrings index 2f9c320..784872f 100644 --- a/DynamicIsland/Localizable.xcstrings +++ b/DynamicIsland/Localizable.xcstrings @@ -1003,6 +1003,36 @@ }, "shouldTranslate" : false }, + "%lldd ago" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "%lldd atrás" + } + } + } + }, + "%lldh ago" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "%lldh atrás" + } + } + } + }, + "%lldm ago" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "%lldm atrás" + } + } + } + }, "%lldx" : { "localizations" : { "fr" : { @@ -1845,7 +1875,7 @@ "pt-BR" : { "stringUnit" : { "state" : "translated", - "value" : "Ativar" + "value" : "Ativo" } } } @@ -10429,6 +10459,16 @@ "feedback" : { "shouldTranslate" : false }, + "File" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Arquivo" + } + } + } + }, "Files dropped on the shelf will be shared via this service" : { "comment" : "A description below the currently selected quick share provider, explaining that files dropped on the shelf will be shared via that provider.", "isCommentAutoGenerated" : true, @@ -12410,6 +12450,16 @@ } } }, + "Image" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Imagem" + } + } + } + }, "Import" : { "localizations" : { "fr" : { @@ -12757,6 +12807,16 @@ } } }, + "Just now" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Agora mesmo" + } + } + } + }, "keyboard" : { "localizations" : { "pt-BR" : { @@ -15552,7 +15612,7 @@ "pt-BR" : { "stringUnit" : { "state" : "translated", - "value" : "Status de Monitoramente" + "value" : "Status de Monitoramento" } } } @@ -19527,6 +19587,9 @@ } } }, + "Rich Text" : { + "shouldTranslate" : false + }, "Right" : { "localizations" : { "pt-BR" : { @@ -22784,6 +22847,16 @@ } } }, + "Text" : { + "localizations" : { + "pt-BR" : { + "stringUnit" : { + "state" : "translated", + "value" : "Texto" + } + } + } + }, "TheDynamicIsland" : { "shouldTranslate" : false }, @@ -24004,6 +24077,9 @@ }, "shouldTranslate" : false }, + "URL" : { + "shouldTranslate" : false + }, "Usage" : { "comment" : "A label displayed above the CPU usage statistics.", "isCommentAutoGenerated" : true, diff --git a/DynamicIsland/components/Settings/SettingsView.swift b/DynamicIsland/components/Settings/SettingsView.swift index b4e05db..f7c1c36 100644 --- a/DynamicIsland/components/Settings/SettingsView.swift +++ b/DynamicIsland/components/Settings/SettingsView.swift @@ -6114,7 +6114,7 @@ struct ClipboardSettings: View { if enableClipboardManager { Section { - Defaults.Toggle("Show Clipboard Icon", key: .showClipboardIcon) + Defaults.Toggle(String(localized: "Show Clipboard Icon"), key: .showClipboardIcon) .settingsHighlight(id: highlightID("Show Clipboard Icon")) HStack { @@ -6126,7 +6126,7 @@ struct ClipboardSettings: View { } } .pickerStyle(.menu) - .frame(width: 100) + .frame(width: 200) } .settingsHighlight(id: highlightID("Display Mode")) @@ -6140,7 +6140,7 @@ struct ClipboardSettings: View { Text("10 items").tag(10) } .pickerStyle(.menu) - .frame(width: 100) + .frame(width: 200) } .settingsHighlight(id: highlightID("History Size")) @@ -6237,16 +6237,16 @@ struct ClipboardSettings: View { let interval = Date().timeIntervalSince(date) if interval < 60 { - return "Just now" + return String(localized: "Just now") } else if interval < 3600 { let minutes = Int(interval / 60) - return "\(minutes)m ago" + return String(localized: "\(minutes)m ago") } else if interval < 86400 { let hours = Int(interval / 3600) - return "\(hours)h ago" + return String(localized: "\(hours)h ago") } else { let days = Int(interval / 86400) - return "\(days)d ago" + return String(localized: "\(days)d ago") } } } @@ -6413,16 +6413,16 @@ struct ScreenAssistantSettings: View { let interval = Date().timeIntervalSince(date) if interval < 60 { - return "Just now" + return String(localized: "Just now") } else if interval < 3600 { let minutes = Int(interval / 60) - return "\(minutes)m ago" + return String(localized: "\(minutes)m ago") } else if interval < 86400 { let hours = Int(interval / 3600) - return "\(hours)h ago" + return String(localized: "\(hours)h ago") } else { let days = Int(interval / 86400) - return "\(days)d ago" + return String(localized: "\(days)d ago") } } } diff --git a/DynamicIsland/managers/ClipboardManager.swift b/DynamicIsland/managers/ClipboardManager.swift index c6f7ba8..d3a11a6 100644 --- a/DynamicIsland/managers/ClipboardManager.swift +++ b/DynamicIsland/managers/ClipboardManager.swift @@ -155,12 +155,12 @@ enum ClipboardItemType: String, CaseIterable, Codable { var displayName: String { switch self { - case .text: return "Text" - case .url: return "URL" - case .file: return "File" - case .image: return "Image" - case .rtf: return "Rich Text" - case .unknown: return "Unknown" + case .text: return String(localized: "Text") + case .url: return String(localized: "URL") + case .file: return String(localized: "File") + case .image: return String(localized: "Image") + case .rtf: return String(localized: "Rich Text") + case .unknown: return String(localized: "Unknown") } } }