mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Added localizer, added de & en localization to /Home/Index and /Home/Login
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@inject IViewLocalizer T
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
ViewData["Title"] = T["Home Page"];
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@inject IViewLocalizer T
|
||||
@{
|
||||
ViewData["Title"] = "Login";
|
||||
ViewData["Title"] = T["Login"];
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Login</h1>
|
||||
<h1 class="display-4">@T["Login"]</h1>
|
||||
@{
|
||||
if (Model.ErrorText is not null)
|
||||
{
|
||||
@@ -14,15 +16,15 @@
|
||||
}
|
||||
<form method="post" action="/Home/Login" class="mt-4" style="max-width: 400px; margin: auto;">
|
||||
<div class="form-group mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<label for="username" class="form-label">@T["Username"]</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<label for="password" class="form-label">@T["Password"]</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary w-100">Login</button>
|
||||
<button type="submit" class="btn btn-primary w-100">@T["Login"]</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
@using Microsoft.AspNetCore.Mvc.Localization
|
||||
@inject IViewLocalizer T
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
@@ -26,11 +28,11 @@
|
||||
<li class="nav-item">
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
{
|
||||
<a class="nav-link text" asp-area="" asp-controller="Home" asp-action="Logout">Log out</a>
|
||||
<a class="nav-link text" asp-area="" asp-controller="Home" asp-action="Logout">@T["Log out"]</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a class="nav-link text" asp-area="" asp-controller="Home" asp-action="Login">Login</a>
|
||||
<a class="nav-link text" asp-area="" asp-controller="Home" asp-action="Login">@T["Login"]</a>
|
||||
}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user