Refactor translation handling and remove unused language support in templates

This commit is contained in:
Christian Krakau-Louis
2025-04-14 03:27:24 +02:00
parent d595b468e9
commit 2af9cd17ea
6 changed files with 98 additions and 194 deletions
+5 -37
View File
@@ -1,61 +1,29 @@
{% extends "base.html" %}
{% block content %}
<div class="container mx-auto p-4">
<h1 class="text-2xl font-bold text-irish-green mb-4">{{ _("About LeagueLedger") }}</h1>
<h1 class="text-2xl font-bold text-irish-green mb-4">About LeagueLedger</h1>
<p class="mb-4">
{% if locale == "de" %}
LeagueLedger ist Ihr ultimativer Begleiter für die Verfolgung von Pub-Quiz-Team-Erfolgen. Wir möchten eine unterhaltsame und ansprechende Plattform für Quiz-Enthusiasten bieten, um sich zu vernetzen, zu wetteifern und ihr Wissen zu feiern.
{% else %}
LeagueLedger is your ultimate companion for tracking pub quiz team achievements. We aim to provide a fun and engaging platform for quiz enthusiasts to connect, compete, and celebrate their knowledge.
{% endif %}
</p>
<p class="mb-4">
{% if locale == "de" %}
Als Pub-Quiz-Meister können Sie QR-Codes für Ihre bestplatzierten Teams generieren, diese verteilen und Teams diese auf unserer Website für Punkte einlösen lassen.
{% else %}
As a pub quiz master, you can generate printout QR codes for your top-ranking teams, distribute them, and let teams redeem them for points on our website.
{% endif %}
</p>
<p class="mb-4">
{% if locale == "de" %}
Als Pub-Quiz-Teammitglied können Sie QR-Codes einlösen, einen Teamnamen erstellen, andere Mitglieder einladen und Social-Logins für einen einfachen Zugang nutzen.
{% else %}
As a pub quiz team member, you can redeem QR codes, create a team name, invite other members, and use social logins for easy access.
{% endif %}
</p>
<h2 class="text-xl font-semibold text-irish-green mt-6 mb-2">
{% if locale == "de" %}Unsere Mission{% else %}Our Mission{% endif %}
</h2>
<h2 class="text-xl font-semibold text-irish-green mt-6 mb-2">Our Mission</h2>
<p class="mb-4">
{% if locale == "de" %}
Die Pub-Quiz-Erfahrung zu verbessern, indem wir eine nahtlose und intuitive Plattform für die Verfolgung des Teamfortschritts bieten, freundlichen Wettbewerb fördern und den Geist des Quiz feiern.
{% else %}
To enhance the pub quiz experience by providing a seamless and intuitive platform for tracking team progress, fostering friendly competition, and celebrating the spirit of trivia.
{% endif %}
</p>
<h2 class="text-xl font-semibold text-irish-green mt-6 mb-2">
{% if locale == "de" %}Unser Team{% else %}Our Team{% endif %}
</h2>
<h2 class="text-xl font-semibold text-irish-green mt-6 mb-2">Our Team</h2>
<p class="mb-4">
{% if locale == "de" %}
LeagueLedger ist eine Open-Source-Initiative und Teil der KaufDeinQuiz-Plattform. Es wird von Christian Louis IT Beratung und Medienproduktion entwickelt, unter der Leitung von Christian Krakau-Louis, einem Team von engagierten Quiz-Enthusiasten und Softwareentwicklern, die leidenschaftlich daran arbeiten, innovative Lösungen für die Pub-Quiz-Community zu schaffen.
{% else %}
LeagueLedger is an Open-Source initiative and part of the KaufDeinQuiz platform. It is brought to you by Christian Louis IT Beratung und Medienproduktion, led by Christian Krakau-Louis, a team of dedicated quiz enthusiasts and software developers passionate about creating innovative solutions for the pub quiz community.
{% endif %}
</p>
<h2 class="text-xl font-semibold text-irish-green mt-6 mb-2">
{% if locale == "de" %}Lizenz{% else %}License{% endif %}
</h2>
<h2 class="text-xl font-semibold text-irish-green mt-6 mb-2">License</h2>
<p class="mb-4">
{% if locale == "de" %}
LeagueLedger ist unter der Apache License 2.0 lizenziert. Die vollständige Lizenz finden Sie in unserer GitHub-Repository oder auf Anfrage.
{% else %}
LeagueLedger is licensed under the Apache License 2.0. You can find the full license in our GitHub repository or upon request.
{% endif %}
</p>
<p class="mt-8 text-sm text-gray-600">
{% if locale == "de" %}Letzte Aktualisierung: April 2025{% else %}Last updated: April 2025{% endif %}
</p>
<p class="mt-8 text-sm text-gray-600">Last updated: April 2025</p>
</div>
{% endblock %}
+39 -76
View File
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html lang="{{ locale }}">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}LeagueLedger - Pub Quiz Tracking{% endblock %}</title>
<title>LeagueLedger - Pub Quiz Tracking</title>
<!-- Favicon -->
@@ -65,26 +65,10 @@
<!-- Desktop Navigation -->
<div class="hidden md:flex space-x-6 items-center">
<a href="/" class="hover:text-golden-ale transition">{{ _("Home") }}</a>
<a href="/teams" class="hover:text-golden-ale transition">{{ _("Teams") }}</a>
<a href="/leaderboard" class="hover:text-golden-ale transition">{{ _("Leaderboard") }}</a>
<a href="/scan" class="hover:text-golden-ale transition">{{ _("Scan QR Code") }}</a>
<!-- Language Selector -->
<div class="relative dropdown">
<button class="dropdown-toggle flex items-center space-x-1 hover:text-golden-ale transition">
<i class="fas fa-globe text-lg"></i>
<span>{{ SUPPORTED_LANGUAGES[locale] }}</span>
<i class="fas fa-chevron-down text-xs"></i>
</button>
<div class="dropdown-menu hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50">
{% for code, name in SUPPORTED_LANGUAGES.items() %}
<a href="/set-language/{{ code }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {% if locale == code %}font-bold{% endif %}">
{{ name }}
</a>
{% endfor %}
</div>
</div>
<a href="/" class="hover:text-golden-ale transition">Home</a>
<a href="/teams" class="hover:text-golden-ale transition">Teams</a>
<a href="/leaderboard" class="hover:text-golden-ale transition">Leaderboard</a>
<a href="/scan" class="hover:text-golden-ale transition">Scan QR Code</a>
{% if user %}
<div class="relative dropdown">
@@ -95,43 +79,29 @@
</button>
<div class="dropdown-menu hidden absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-50">
<a href="/profile" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
<i class="fas fa-user mr-2"></i> {{ _("Profile") }}
<i class="fas fa-user mr-2"></i> Profile
</a>
<a href="/dashboard" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
<i class="fas fa-tachometer-alt mr-2"></i> {{ _("Dashboard") }}
<i class="fas fa-tachometer-alt mr-2"></i> Dashboard
</a>
{% if user.is_admin %}
<a href="/admin" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
<i class="fas fa-cog mr-2"></i> {{ _("Admin") }}
<i class="fas fa-cog mr-2"></i> Admin
</a>
{% endif %}
<div class="border-t border-gray-100 my-1"></div>
<a href="/logout" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">
<i class="fas fa-sign-out-alt mr-2"></i> {{ _("Logout") }}
<i class="fas fa-sign-out-alt mr-2"></i> Logout
</a>
</div>
</div>
{% else %}
<a href="/login" class="bg-golden-ale hover:bg-opacity-90 text-black-stout px-4 py-2 rounded-md transition">{{ _("Sign In") }}</a>
<a href="/login" class="bg-golden-ale hover:bg-opacity-90 text-black-stout px-4 py-2 rounded-md transition">Sign In</a>
{% endif %}
</div>
<!-- Mobile menu button -->
<div class="md:hidden flex items-center space-x-4">
<!-- Mobile Language Selector -->
<div class="relative dropdown">
<button class="dropdown-toggle flex items-center hover:text-golden-ale transition">
<i class="fas fa-globe text-lg"></i>
</button>
<div class="dropdown-menu hidden absolute right-0 mt-2 w-32 bg-white rounded-md shadow-lg py-1 z-50">
{% for code, name in SUPPORTED_LANGUAGES.items() %}
<a href="/set-language/{{ code }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 {% if locale == code %}font-bold{% endif %}">
{{ name }}
</a>
{% endfor %}
</div>
</div>
<button id="mobile-menu-button" class="text-white hover:text-golden-ale transition">
<i class="fas fa-bars text-2xl"></i>
</button>
@@ -141,19 +111,19 @@
<!-- Mobile Navigation -->
<div id="mobile-menu" class="hidden md:hidden mt-3 pb-3 border-t border-irish-green border-opacity-30">
<div class="flex flex-col space-y-2 mt-3">
<a href="/" class="hover:text-golden-ale transition py-2">{{ _("Home") }}</a>
<a href="/teams" class="hover:text-golden-ale transition py-2">{{ _("Teams") }}</a>
<a href="/leaderboard" class="hover:text-golden-ale transition py-2">{{ _("Leaderboard") }}</a>
<a href="/scan" class="hover:text-golden-ale transition py-2">{{ _("Scan QR Code") }}</a>
<a href="/" class="hover:text-golden-ale transition py-2">Home</a>
<a href="/teams" class="hover:text-golden-ale transition py-2">Teams</a>
<a href="/leaderboard" class="hover:text-golden-ale transition py-2">Leaderboard</a>
<a href="/scan" class="hover:text-golden-ale transition py-2">Scan QR Code</a>
{% if user %}
<a href="/profile" class="hover:text-golden-ale transition py-2">{{ _("Profile") }}</a>
<a href="/dashboard" class="hover:text-golden-ale transition py-2">{{ _("Dashboard") }}</a>
<a href="/profile" class="hover:text-golden-ale transition py-2">Profile</a>
<a href="/dashboard" class="hover:text-golden-ale transition py-2">Dashboard</a>
{% if user.is_admin %}
<a href="/admin" class="hover:text-golden-ale transition py-2">{{ _("Admin") }}</a>
<a href="/admin" class="hover:text-golden-ale transition py-2">Admin</a>
{% endif %}
<a href="/logout" class="hover:text-golden-ale transition py-2">{{ _("Logout") }}</a>
<a href="/logout" class="hover:text-golden-ale transition py-2">Logout</a>
{% else %}
<a href="/login" class="bg-golden-ale hover:bg-opacity-90 text-black-stout px-4 py-2 rounded-md transition text-center">{{ _("Sign In") }}</a>
<a href="/login" class="bg-golden-ale hover:bg-opacity-90 text-black-stout px-4 py-2 rounded-md transition text-center">Sign In</a>
{% endif %}
</div>
</div>
@@ -174,53 +144,46 @@
<img src="{{ url_for('static', path='images/logos/monogram.png') }}" alt="LeagueLedger Logo" class="h-12">
<span class="ml-2 text-xl font-bold">LeagueLedger</span>
</div>
<p class="text-sm">{{ _("Track your pub quiz team's progress.") }}<br>{{ _("Scan QR codes to earn points.") }}</p>
<p class="text-sm">Track your pub quiz team's progress.<br>Scan QR codes to earn points.</p>
</div>
<div class="grid grid-cols-2 md:grid-cols-3 gap-8">
<div>
<h3 class="text-golden-ale font-bold mb-4">{{ _("Navigation") }}</h3>
<h3 class="text-golden-ale font-bold mb-4">Navigation</h3>
<ul class="space-y-2">
<li><a href="/" class="hover:text-golden-ale transition">{{ _("Home") }}</a></li>
<li><a href="/teams" class="hover:text-golden-ale transition">{{ _("Teams") }}</a></li>
<li><a href="/leaderboard" class="hover:text-golden-ale transition">{{ _("Leaderboard") }}</a></li>
<li><a href="/scan" class="hover:text-golden-ale transition">{{ _("Scan QR Code") }}</a></li>
<li><a href="/" class="hover:text-golden-ale transition">Home</a></li>
<li><a href="/teams" class="hover:text-golden-ale transition">Teams</a></li>
<li><a href="/leaderboard" class="hover:text-golden-ale transition">Leaderboard</a></li>
<li><a href="/scan" class="hover:text-golden-ale transition">Scan QR Code</a></li>
</ul>
</div>
<div>
<h3 class="text-golden-ale font-bold mb-4">{{ _("Account") }}</h3>
<h3 class="text-golden-ale font-bold mb-4">Account</h3>
<ul class="space-y-2">
<li><a href="/login" class="hover:text-golden-ale transition">{{ _("Sign In") }}</a></li>
<li><a href="/register" class="hover:text-golden-ale transition">{{ _("Register") }}</a></li>
<li><a href="/profile" class="hover:text-golden-ale transition">{{ _("Profile") }}</a></li>
<li><a href="/dashboard" class="hover:text-golden-ale transition">{{ _("Dashboard") }}</a></li>
<li><a href="/login" class="hover:text-golden-ale transition">Sign In</a></li>
<li><a href="/register" class="hover:text-golden-ale transition">Register</a></li>
<li><a href="/profile" class="hover:text-golden-ale transition">Profile</a></li>
<li><a href="/dashboard" class="hover:text-golden-ale transition">Dashboard</a></li>
</ul>
</div>
<div>
<h3 class="text-golden-ale font-bold mb-4">{{ _("Legal") }}</h3>
<h3 class="text-golden-ale font-bold mb-4">Legal</h3>
<ul class="space-y-2">
<li><a href="/about" class="hover:text-golden-ale transition">{{ _("About") }}</a></li>
<li><a href="/contact" class="hover:text-golden-ale transition">{{ _("Contact") }}</a></li>
<li><a href="/terms" class="hover:text-golden-ale transition">{{ _("Terms of Service") }}</a></li>
<li><a href="/privacy" class="hover:text-golden-ale transition">{{ _("Privacy Policy") }}</a></li>
<li><a href="/cookies" class="hover:text-golden-ale transition">{{ _("Cookie Policy") }}</a></li>
<li><a href="/impressum" class="hover:text-golden-ale transition">{{ _("Imprint") }}</a></li>
<li><a href="/about" class="hover:text-golden-ale transition">About</a></li>
<li><a href="/contact" class="hover:text-golden-ale transition">Contact</a></li>
<li><a href="/terms" class="hover:text-golden-ale transition">Terms of Service</a></li>
<li><a href="/privacy" class="hover:text-golden-ale transition">Privacy Policy</a></li>
<li><a href="/cookies" class="hover:text-golden-ale transition">Cookie Policy</a></li>
<li><a href="/impressum" class="hover:text-golden-ale transition">Imprint</a></li>
</ul>
</div>
</div>
</div>
<div class="border-t border-gray-800 mt-8 pt-8 flex flex-col md:flex-row justify-between items-center">
<div class="flex items-center space-x-4">
<p class="text-sm">&copy; 2025 LeagueLedger. {{ _("Licensed under Apache License 2.0") }}</p>
</div>
<div class="flex space-x-4 mt-4 md:mt-0">
{% for code, name in SUPPORTED_LANGUAGES.items() %}
<a href="/set-language/{{ code }}" class="hover:text-golden-ale transition {% if locale == code %}font-bold{% endif %}">
{{ name }}
</a>
{% endfor %}
<p class="text-sm">&copy; 2025 LeagueLedger. Licensed under Apache License 2.0</p>
</div>
</div>
</div>