Made app name customizable

This commit is contained in:
2025-11-30 14:51:53 +01:00
parent 7bd74136e7
commit 7098530cf4
5 changed files with 12 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="Welcome" xml:space="preserve">
<value>Willkommen bei OneForMe</value>
<value>Willkommen bei {0}</value>
</data>
<data name="LoggedInAs" xml:space="preserve">
<value>Angemeldet als</value>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="Welcome" xml:space="preserve">
<value>Welcome to OneForMe</value>
<value>Welcome to {0}</value>
</data>
<data name="LoggedInAs" xml:space="preserve">
<value>Logged in as</value>

View File

@@ -1,6 +1,7 @@
@using Microsoft.AspNetCore.Localization
@using OneForMe.Services
@inject LocalizationService Localizer
@inject IConfiguration Configuration
@model DashboardViewModel
@{
@@ -10,7 +11,7 @@
<div class="container mt-5">
<div class="row mb-4">
<div class="col-md-12">
<h1>@Localizer.Get("Welcome")</h1>
<h1>@Localizer["Welcome", Configuration["AppName"] ?? "OneForMe"]</h1>
</div>
</div>

View File

@@ -1,9 +1,12 @@
<!DOCTYPE html>
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - OneForMe</title>
<title>@ViewData["Title"] - @(Configuration["AppName"] ?? "OneForMe")</title>
<script type="importmap"></script>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
@@ -13,7 +16,7 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">OneForMe</a>
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">@(Configuration["AppName"] ?? "OneForMe")</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@@ -44,7 +47,7 @@
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2025 - OneForMe
&copy; 2025 - @(Configuration["AppName"] ?? "OneForMe")
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>

View File

@@ -1,4 +1,5 @@
{
"AppName": "OneForMe",
"ConnectionStrings": {
"DefaultConnection": "Data Source=OneForMe.db"
},