diff --git a/src/Controllers/HomeController.cs b/src/Controllers/HomeController.cs index 6b0647f..6b8645e 100644 --- a/src/Controllers/HomeController.cs +++ b/src/Controllers/HomeController.cs @@ -129,14 +129,14 @@ public class HomeController : Controller switch (authenticationResult.AuthenticationState) { case UserNotAuthenticatedReason.InvalidCredentials: - return View(new LoginViewModel() { ErrorText = "Invalid login credentials" }); // TODO add localization (e.g. T["Invalid login credentials"]; see: https://learn.microsoft.com/de-de/dotnet/core/extensions/localization) + return View(new LoginViewModel() { ErrorText = "Invalid login credentials" }); case UserNotAuthenticatedReason.UserLockedOut: - return View(new LoginViewModel() { ErrorText = "Your account has been locked. Wait a few minutes or ask an administrator to unlock you" }); // TODO add localization (e.g. T["Invalid login credentials"]; see: https://learn.microsoft.com/de-de/dotnet/core/extensions/localization) + return View(new LoginViewModel() { ErrorText = "Your account has been locked. Wait a few minutes or ask an administrator to unlock you" }); case UserNotAuthenticatedReason.UserNotAuthorized: - return View(new LoginViewModel() { ErrorText = "You are not authorized for login. Ask an administrator to authorize you." }); // TODO add localization (e.g. T["Invalid login credentials"]; see: https://learn.microsoft.com/de-de/dotnet/core/extensions/localization) + return View(new LoginViewModel() { ErrorText = "You are not authorized for login. Ask an administrator to authorize you." }); default: await HttpContext.RaiseError(new HellFrozeOverException()); - return View(new LoginViewModel() { ErrorText = "Hell froze over. Make a screenshot and send it to an administrator." }); // TODO add localization (e.g. T["Invalid login credentials"]; see: https://learn.microsoft.com/de-de/dotnet/core/extensions/localization) + return View(new LoginViewModel() { ErrorText = "Hell froze over. Make a screenshot and send it to an administrator." }); } } diff --git a/src/Resources/Views.Home.Login.de.resx b/src/Resources/Views.Home.Login.de.resx index 22edd86..d010f49 100644 --- a/src/Resources/Views.Home.Login.de.resx +++ b/src/Resources/Views.Home.Login.de.resx @@ -25,4 +25,16 @@ Passwort + + Ungültige Anmeldedaten + + + Ihr Konto wurde gesperrt. Warten Sie einige Minuten oder bitten Sie einen Administrator, die Sperre aufzuheben. + + + Sie sind nicht zur Anmeldung berechtigt. Bitten Sie einen Administrator, Ihnen die Berechtigung zu erteilen. + + + Die Hölle ist zugefroren. Machen Sie einen Screenshot und senden Sie ihn an einen Administrator. + diff --git a/src/Views/Home/Login.cshtml b/src/Views/Home/Login.cshtml index 934b417..fc7d34f 100644 --- a/src/Views/Home/Login.cshtml +++ b/src/Views/Home/Login.cshtml @@ -1,4 +1,5 @@ @using Microsoft.AspNetCore.Mvc.Localization +@model LoginViewModel @inject IViewLocalizer T @{ ViewData["Title"] = T["Login"]; @@ -10,7 +11,7 @@ if (Model.ErrorText is not null) {
-

@Model.ErrorText

+

@T[Model.ErrorText]

} }