diff --git a/oAI/Services/AnytypeMCPService.swift b/oAI/Services/AnytypeMCPService.swift index 14d4925..4b753d6 100644 --- a/oAI/Services/AnytypeMCPService.swift +++ b/oAI/Services/AnytypeMCPService.swift @@ -44,7 +44,7 @@ class AnytypeMCPService { let result = try await request(endpoint: "/v1/spaces", method: "GET", body: nil) if let spaces = result["data"] as? [[String: Any]] { isConnected = true - return .success("Connected (\(spaces.count) space\(spaces.count == 1 ? "" : "s"))") + return .success(String(localized: "Connected (^[\(spaces.count) space](inflect: true))")) } else { isConnected = true return .success("Connected to Anytype") diff --git a/oAI/Services/PaperlessService.swift b/oAI/Services/PaperlessService.swift index c450e62..7b43db2 100644 --- a/oAI/Services/PaperlessService.swift +++ b/oAI/Services/PaperlessService.swift @@ -49,7 +49,7 @@ class PaperlessService { let result = try await request(endpoint: "/api/documents/", queryParams: ["page_size": "1"]) if let count = result["count"] as? Int { isConnected = true - return .success("Connected (\(count) document\(count == 1 ? "" : "s"))") + return .success(String(localized: "Connected (^[\(count) document](inflect: true))")) } else { isConnected = true return .success("Connected to Paperless-NGX") diff --git a/oAI/Views/Screens/GitSyncManualFixSheet.swift b/oAI/Views/Screens/GitSyncManualFixSheet.swift index bdc207f..cef34b9 100644 --- a/oAI/Views/Screens/GitSyncManualFixSheet.swift +++ b/oAI/Views/Screens/GitSyncManualFixSheet.swift @@ -56,7 +56,7 @@ struct GitSyncManualFixSheet: View { .background(Color.secondary.opacity(0.08)) .clipShape(RoundedRectangle(cornerRadius: 8)) - step(2, "Delete the file\(files.count == 1 ? "" : "s") named in the error:") + step(2, "Delete ^[\(files.count) file](inflect: true) named in the error:") VStack(alignment: .leading, spacing: 4) { ForEach(files, id: \.self) { file in Text(file) @@ -95,7 +95,7 @@ struct GitSyncManualFixSheet: View { } @ViewBuilder - private func step(_ number: Int, _ text: String) -> some View { + private func step(_ number: Int, _ text: LocalizedStringKey) -> some View { HStack(alignment: .firstTextBaseline, spacing: 8) { Text("\(number).") .font(.system(size: 13, weight: .semibold))