Skip to content

Commit 3ae4362

Browse files
authored
Merge pull request #24 from FlineDev/wip/localization
All localization entries translated & proofread with TranslateKit
2 parents 6b13687 + 3e6fcfd commit 3ae4362

2 files changed

Lines changed: 20661 additions & 722 deletions

File tree

Sources/ErrorKit/BuiltInErrors/DatabaseError.swift

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,19 @@ public enum DatabaseError: Throwable, Catching {
148148
bundle: .module
149149
)
150150
case .recordNotFound(let entity, let identifier):
151-
let idMessage = identifier.map { " with ID \($0)" } ?? ""
152-
return String(
153-
localized: "BuiltInErrors.DatabaseError.recordNotFound",
154-
defaultValue: "The \(entity) record\(idMessage) was not found in the database. Verify the details and try again.",
155-
bundle: .module
156-
)
151+
if let identifier {
152+
return String(
153+
localized: "BuiltInErrors.DatabaseError.recordNotFoundWithID",
154+
defaultValue: "The \(entity) record with ID \(identifier) was not found in the database. Verify the details and try again.",
155+
bundle: .module
156+
)
157+
} else {
158+
return String(
159+
localized: "BuiltInErrors.DatabaseError.recordNotFound",
160+
defaultValue: "The \(entity) record was not found in the database. Verify the details and try again.",
161+
bundle: .module
162+
)
163+
}
157164
case .generic(let userFriendlyMessage):
158165
return userFriendlyMessage
159166
case .caught(let error):

0 commit comments

Comments
 (0)