diff --git a/Modules/Sources/Login/Resources/en.lproj/Localizable.strings b/Modules/Sources/Login/Resources/en.lproj/Localizable.strings index e53614f..f571afc 100644 --- a/Modules/Sources/Login/Resources/en.lproj/Localizable.strings +++ b/Modules/Sources/Login/Resources/en.lproj/Localizable.strings @@ -11,5 +11,5 @@ "login.text_field.password.placeholder" = "Password"; "login.button.log_in.text" = "Log in"; -"login.error.authentication_failed.text" = "The provided username and/or password are incorrect.\nPlease try again."; -"login.error.unknown.text" = "An unexpected error occurred while trying to authenticate your credentials.\nPlease try again at a later time."; +"login.error.authentication_failed.text" = "The given username and/or password are not correct.\nPlease re-enter your credentials and try again."; +"login.error.authentication_unknown.text" = "An unexpected error occurred while trying to authenticate your credentials.\nPlease try again at a later time."; diff --git a/Modules/Sources/Login/UI/Components/LoginForm.swift b/Modules/Sources/Login/UI/Components/LoginForm.swift index c40fc6c..543dc27 100644 --- a/Modules/Sources/Login/UI/Components/LoginForm.swift +++ b/Modules/Sources/Login/UI/Components/LoginForm.swift @@ -76,9 +76,17 @@ struct LoginForm: View { if let errorMessage { Divider() - Text(errorMessage) - .font(.body) - .foregroundColor(.red) + Text( + NSLocalizedString( + errorMessage, + bundle: .module, + comment: "The error message received from the backend." + ) + ) + .font(.body) + .foregroundColor(.red) + .frame(maxWidth: .infinity) + .multilineTextAlignment(.center) } } .frame(maxWidth: .infinity, alignment: .leading) diff --git a/Modules/Sources/Login/UI/Views/LoginView.swift b/Modules/Sources/Login/UI/Views/LoginView.swift index 89e8e0e..955a6f3 100644 --- a/Modules/Sources/Login/UI/Views/LoginView.swift +++ b/Modules/Sources/Login/UI/Views/LoginView.swift @@ -142,10 +142,10 @@ private extension LoginView.LoginContainer { password: password ) } catch APIClientError.authenticationFailed { - errorMessage = .init(localized: "login.error.authentication_failed.text") + errorMessage = "login.error.authentication_failed.text" isAuthenticating = false } catch { - errorMessage = .init(localized: "login.error.unknown.text") + errorMessage = "login.error.authentication_unknown.text" isAuthenticating = false } }