Compare commits
61 Commits
Author | SHA1 | Date | |
---|---|---|---|
1c9fc93314 | |||
510f039a2b | |||
1967cef7fc | |||
0c0997c1bd | |||
118c7c1516 | |||
773696d6be | |||
f53a2661da | |||
53b40ca91d | |||
43eb609b4a | |||
53d5309d65 | |||
a131fc8077 | |||
deec62fec0 | |||
9e5906943d | |||
cabe628875 | |||
35ecba348b | |||
31b1c12dcb | |||
95ed606796 | |||
52eac7530a | |||
2f6138b1d6 | |||
f5a39e80b4 | |||
f9f73e24c9 | |||
d697928241 | |||
f998f7fff8 | |||
1a5aa003a2 | |||
eecc2b8b73 | |||
0b13a408cd | |||
c4a65bba48 | |||
e4b37d9261 | |||
45cc02b4b0 | |||
05766d9a97 | |||
e5fbc14a34 | |||
9e025bd4c7 | |||
f4ffd14624 | |||
4740288c45 | |||
512898b34b | |||
872d0f9e23 | |||
28fda213ba | |||
bdf4e134e4 | |||
601f993ccb | |||
8fdf764a7b | |||
b40bb666b8 | |||
7dbe91b32e | |||
c7d95e5c4c | |||
d88581a663 | |||
00e961a6bd | |||
d9ecdbb86e | |||
a3753e3f4e | |||
af5ff2c094 | |||
200a46fdaa | |||
524f44b6f0 | |||
3f3cb3ed01 | |||
74d9c18bd9 | |||
1b91f8e54d | |||
a594d37cf1 | |||
b95b05e54f | |||
2271934228 | |||
dc73e49da0 | |||
030e4adab9 | |||
bd895e356f | |||
046271343d | |||
d0d8e0aeb1 |
434
README.md
434
README.md
@@ -1,441 +1,25 @@
|
|||||||
# Elpatrons Datumsrechner
|
# Elpatrons Date Calculator
|
||||||
|
|
||||||
Diese moderne Python-Webanwendung (Flask) ermöglicht verschiedene Datumsberechnungen über eine übersichtliche Weboberfläche:
|
A modern Python web application (Flask) that enables various date calculations through a clear, accessible web interface. Features include calculating days between dates, working days with state-specific holidays, calendar weeks, date arithmetic, and more. The application supports German and English languages, includes a REST API, and is designed with accessibility in mind.
|
||||||
|
|
||||||
## Inhaltsverzeichnis
|
## Documentation
|
||||||
|
|
||||||
- [Demo](#demo)
|
- **[English Documentation](README_en.md)** - Complete documentation in English
|
||||||
- [Funktionen](#funktionen)
|
- **[Deutsche Dokumentation](README_de.md)** - Vollständige Dokumentation auf Deutsch
|
||||||
- [Installation (lokal)](#installation-lokal)
|
|
||||||
- [Starten der App](#starten-der-app)
|
|
||||||
- [Statistik-Dashboard & Passwortschutz](#statistik-dashboard-stats--passwortschutz)
|
|
||||||
- [Docker (empfohlen für Produktion)](#docker-empfohlen-für-produktion)
|
|
||||||
- [Log-Verzeichnis mounten](#log-verzeichnis-mounten-logs-auf-dem-host-speichern)
|
|
||||||
- [docker-compose Beispiel](#docker-compose-beispiel)
|
|
||||||
- [REST API](#rest-api)
|
|
||||||
- [Tage/Werktage zwischen zwei Daten](#1-tagewerktage-zwischen-zwei-daten)
|
|
||||||
- [Wochentag zu einem Datum](#2-wochentag-zu-einem-datum)
|
|
||||||
- [Kalenderwoche zu Datum](#3-kalenderwoche-zu-datum)
|
|
||||||
- [Start-/Enddatum einer Kalenderwoche](#4-start-enddatum-einer-kalenderwoche)
|
|
||||||
- [Datum plus/minus Tage, Wochen, Monate](#5-datum-plusminus-tage-wochen-monate)
|
|
||||||
- [Statistik](#6-statistik)
|
|
||||||
- [Monitoring & Healthcheck](#7-monitoring--healthcheck)
|
|
||||||
- [Progressive Web App (PWA)](#progressive-web-app-pwa)
|
|
||||||
- [Monitoring & Healthcheck](#monitoring--healthcheck)
|
|
||||||
- [Entwicklung & Hinweise](#entwicklung--hinweise)
|
|
||||||
- [Automatisierte Tests](#automatisierte-tests)
|
|
||||||
- [Hinweise](#hinweise)
|
|
||||||
- [Motivation](#motivation)
|
|
||||||
- [Vibe Coding](#vibe-coding)
|
|
||||||
- [Statistik-Erfassung, Logging](#statistik-erfassung-logging)
|
|
||||||
- [Barrierefreiheit (Accessibility)](#barrierefreiheit-accessibility)
|
|
||||||
- [Code Statistik](#code-statistik)
|
|
||||||
- [Lizenz](#lizenz)
|
|
||||||
|
|
||||||
## Demo
|
## Quick Start
|
||||||
|
|
||||||
Datumsrechner Live: [https://date.elpatron.me](https://date.elpatron.me)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Funktionen
|
|
||||||
|
|
||||||
- Anzahl der Tage zwischen zwei Daten
|
|
||||||
- Anzahl der Werktage zwischen zwei Daten (mit optionaler Berücksichtigung bundeslandspezifischer Feiertage)
|
|
||||||
- Anzeige des Wochentags eines Datums
|
|
||||||
- Datum plus/minus X Tage
|
|
||||||
- Datum plus/minus X Werktage
|
|
||||||
- Datum plus/minus X Wochen/Monate
|
|
||||||
- Kalenderwoche zu Datum
|
|
||||||
- Start-/Enddatum einer Kalenderwoche eines Jahres
|
|
||||||
- **Sprachausgabe** für alle Ergebnisse (barrierefrei)
|
|
||||||
- Statistik-Dashboard mit Passwortschutz unter `/stats`
|
|
||||||
|
|
||||||
## Bundesland-Feiertage
|
|
||||||
|
|
||||||
Die Werktagsberechnung kann optional bundeslandspezifische Feiertage berücksichtigen. Dazu wird die kostenlose API von [feiertage-api.de](https://feiertage-api.de) verwendet.
|
|
||||||
|
|
||||||
**Verfügbare Bundesländer:**
|
|
||||||
- Baden-Württemberg (BW)
|
|
||||||
- Bayern (BY)
|
|
||||||
- Berlin (BE)
|
|
||||||
- Brandenburg (BB)
|
|
||||||
- Bremen (HB)
|
|
||||||
- Hamburg (HH)
|
|
||||||
- Hessen (HE)
|
|
||||||
- Mecklenburg-Vorpommern (MV)
|
|
||||||
- Niedersachsen (NI)
|
|
||||||
- Nordrhein-Westfalen (NW)
|
|
||||||
- Rheinland-Pfalz (RP)
|
|
||||||
- Saarland (SL)
|
|
||||||
- Sachsen (SN)
|
|
||||||
- Sachsen-Anhalt (ST)
|
|
||||||
- Schleswig-Holstein (SH)
|
|
||||||
- Thüringen (TH)
|
|
||||||
|
|
||||||
Die Feiertage werden automatisch für den gewählten Zeitraum abgerufen und bei der Werktagsberechnung als arbeitsfreie Tage behandelt. Im Ergebnis werden zusätzlich die Anzahl der Wochenendtage und Feiertage angezeigt.
|
|
||||||
|
|
||||||
## Installation (lokal)
|
|
||||||
|
|
||||||
1. Python 3.8+ installieren
|
|
||||||
2. Abhängigkeiten installieren:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
|
||||||
|
|
||||||
## Starten der App
|
|
||||||
|
|
||||||
```bash
|
|
||||||
python app.py
|
python app.py
|
||||||
```
|
```
|
||||||
|
|
||||||
Die App ist dann unter http://localhost:5000 erreichbar.
|
Visit [https://date.elpatron.me](https://date.elpatron.me) for the live demo.
|
||||||
|
|
||||||
## Statistik-Dashboard (/stats) & Passwortschutz
|
## License
|
||||||
|
|
||||||
Das Dashboard ist mit einem statischen Passwort geschützt, das über die Umgebungsvariable `STATS_PASSWORD` gesetzt wird.
|
This project is licensed under the [MIT License](LICENSE).
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Beispiel (PowerShell):
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$env:STATS_PASSWORD = "meinSicheresPasswort"
|
|
||||||
python app.py
|
|
||||||
```
|
|
||||||
|
|
||||||
Für Docker:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$env:STATS_PASSWORD = "meinSicheresPasswort"
|
|
||||||
docker run -e STATS_PASSWORD=$env:STATS_PASSWORD -p 5000:5000 datumsrechner
|
|
||||||
```
|
|
||||||
|
|
||||||
## Docker (empfohlen für Produktion)
|
|
||||||
|
|
||||||
Die App läuft im Container mit dem WSGI-Server **Gunicorn**:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker build -t datumsrechner .
|
|
||||||
docker run -p 5000:5000 datumsrechner
|
|
||||||
```
|
|
||||||
|
|
||||||
- Gunicorn startet automatisch (siehe Dockerfile)
|
|
||||||
- Empfohlen für produktiven Einsatz
|
|
||||||
|
|
||||||
### Log-Verzeichnis mounten (Logs auf dem Host speichern)
|
|
||||||
|
|
||||||
Um die Logdateien außerhalb des Containers zu speichern, kannst du das log-Verzeichnis mounten:
|
|
||||||
|
|
||||||
**PowerShell-Beispiel:**
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
docker run -e STATS_PASSWORD=deinPasswort -p 5000:5000 -v ${PWD}/log:/app/log datumsrechner
|
|
||||||
```
|
|
||||||
|
|
||||||
### docker-compose Beispiel
|
|
||||||
|
|
||||||
Erstelle eine Datei `docker-compose.yml`:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
services:
|
|
||||||
datumsrechner:
|
|
||||||
build: .
|
|
||||||
ports:
|
|
||||||
- "5000:5000"
|
|
||||||
environment:
|
|
||||||
- STATS_PASSWORD=deinPasswort
|
|
||||||
volumes:
|
|
||||||
- ./log:/app/log
|
|
||||||
```
|
|
||||||
|
|
||||||
Starte mit:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose up --build
|
|
||||||
```
|
|
||||||
|
|
||||||
## REST API
|
|
||||||
|
|
||||||
Alle Datumsfunktionen stehen auch als REST-API zur Verfügung. Die API akzeptiert und liefert JSON.
|
|
||||||
**Basis-URL:** `http://localhost:5000/api/`
|
|
||||||
|
|
||||||
**Hinweis:** Die Nutzung der REST API wird im Statistik-Dashboard ausgewertet und als Diagramm angezeigt.
|
|
||||||
|
|
||||||
### Endpunkte und Beispiele
|
|
||||||
|
|
||||||
#### 1. Tage/Werktage zwischen zwei Daten
|
|
||||||
|
|
||||||
**POST** `/api/tage_werktage`
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"start": "2024-06-01",
|
|
||||||
"end": "2024-06-10",
|
|
||||||
"werktage": true,
|
|
||||||
"bundesland": "BY"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl -X POST http://localhost:5000/api/tage_werktage \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"start": "2024-06-01", "end": "2024-06-10", "werktage": true, "bundesland": "BY"}'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{ "result": 7 }
|
|
||||||
```
|
|
||||||
|
|
||||||
**Hinweis:** Der Parameter `bundesland` ist optional und wird nur bei `"werktage": true` berücksichtigt. Verfügbare Bundesland-Kürzel siehe oben.
|
|
||||||
|
|
||||||
#### 2. Wochentag zu einem Datum
|
|
||||||
|
|
||||||
**POST** `/api/wochentag`
|
|
||||||
|
|
||||||
```json
|
|
||||||
{ "datum": "2024-06-10" }
|
|
||||||
```
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl -X POST http://localhost:5000/api/wochentag \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"datum": "2024-06-10"}'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{ "result": "Montag" }
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 3. Kalenderwoche zu Datum
|
|
||||||
|
|
||||||
**POST** `/api/kw_berechnen`
|
|
||||||
|
|
||||||
```json
|
|
||||||
{ "datum": "2024-06-10" }
|
|
||||||
```
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl -X POST http://localhost:5000/api/kw_berechnen \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"datum": "2024-06-10"}'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{ "result": "KW 24 (2024)", "kw": 24, "jahr": 2024 }
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 4. Start-/Enddatum einer Kalenderwoche
|
|
||||||
|
|
||||||
**POST** `/api/kw_datum`
|
|
||||||
|
|
||||||
```json
|
|
||||||
{ "jahr": 2024, "kw": 24 }
|
|
||||||
```
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl -X POST http://localhost:5000/api/kw_datum \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"jahr": 2024, "kw": 24}'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"result": "10.06.2024 bis 16.06.2024",
|
|
||||||
"start": "2024-06-10",
|
|
||||||
"end": "2024-06-16"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 5. Datum plus/minus Tage, Wochen, Monate
|
|
||||||
|
|
||||||
**POST** `/api/plusminus`
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"datum": "2024-06-10",
|
|
||||||
"anzahl": 5,
|
|
||||||
"einheit": "tage",
|
|
||||||
"richtung": "add",
|
|
||||||
"werktage": false
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl -X POST http://localhost:5000/api/plusminus \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"datum": "2024-06-10", "anzahl": 5, "einheit": "tage", "richtung": "add", "werktage": false}'
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{ "result": "2024-06-15" }
|
|
||||||
```
|
|
||||||
|
|
||||||
**Hinweis:**
|
|
||||||
- `"einheit"`: `"tage"`, `"wochen"` oder `"monate"`
|
|
||||||
- `"richtung"`: `"add"` (plus) oder `"sub"` (minus)
|
|
||||||
- `"werktage"`: `true` für Werktage, sonst `false` (nur bei `"tage"` unterstützt)
|
|
||||||
|
|
||||||
#### 6. Statistik
|
|
||||||
|
|
||||||
**GET** `/api/stats`
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl http://localhost:5000/api/stats
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"pageviews": 42,
|
|
||||||
"func_counts": { "plusminus": 10, "tage_werktage": 5 },
|
|
||||||
"impressions_per_day": { "2024-06-10": 7 }
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 7. Monitoring & Healthcheck
|
|
||||||
|
|
||||||
**GET** `/api/monitor`
|
|
||||||
|
|
||||||
**Mit curl:**
|
|
||||||
```bash
|
|
||||||
curl http://localhost:5000/api/monitor
|
|
||||||
```
|
|
||||||
|
|
||||||
**Antwort:**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"status": "ok",
|
|
||||||
"message": "App running",
|
|
||||||
"time": "2025-07-24T13:37:00.123456",
|
|
||||||
"uptime_seconds": 12345,
|
|
||||||
"pageviews_last_7_days": 42
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Fehlerfälle** liefern immer einen HTTP-Statuscode 400 und ein JSON mit `"error"`-Feld, z.B.:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{ "error": "Ungültige Eingabe", "details": "..." }
|
|
||||||
```
|
|
||||||
|
|
||||||
## Progressive Web App (PWA)
|
|
||||||
|
|
||||||
Elpatrons Datumsrechner ist als PWA installierbar (z.B. auf Android/iOS-Homescreen oder Desktop). Die App funktioniert offline für die Startseite und statische Ressourcen, die Datumsberechnung bleibt serverseitig.
|
|
||||||
|
|
||||||
- Manifest und Service Worker sind integriert
|
|
||||||
- App-Icon und Theme-Color für Homescreen
|
|
||||||
- Installation über Browser-Menü ("Zum Startbildschirm hinzufügen")
|
|
||||||
|
|
||||||
## Monitoring & Healthcheck
|
|
||||||
|
|
||||||
Die App bietet einen Monitoring-Endpunkt unter `/monitor`, der Statusinformationen als JSON zurückgibt (z.B. für Uptime-Robot, Docker Healthcheck oder eigene Tools):
|
|
||||||
|
|
||||||
- Status (ok)
|
|
||||||
- Aktuelle Serverzeit
|
|
||||||
- Uptime (Sekunden seit Start)
|
|
||||||
- Pageviews der letzten 7 Tage
|
|
||||||
|
|
||||||
Beispiel-Aufruf:
|
|
||||||
|
|
||||||
```
|
|
||||||
GET https://date.elpatron.me/monitor
|
|
||||||
```
|
|
||||||
|
|
||||||
Antwort:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"status": "ok",
|
|
||||||
"message": "App running",
|
|
||||||
"time": "2025-07-24T13:37:00.123456",
|
|
||||||
"uptime_seconds": 12345,
|
|
||||||
"pageviews_last_7_days": 42
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Entwicklung & Hinweise
|
|
||||||
|
|
||||||
- Die HTML-Templates liegen im Ordner `templates/` (Trennung von Logik und Darstellung)
|
|
||||||
- Das Projekt ist auf Codeberg gehostet: [https://codeberg.org/elpatron/datecalc](https://codeberg.org/elpatron/datecalc)
|
|
||||||
- Modernes, responsives Design mit Akkordeon und Icons
|
|
||||||
|
|
||||||
## Automatisierte Tests
|
|
||||||
|
|
||||||
Automatisierte Tests sind mit pytest möglich:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pytest test_app.py
|
|
||||||
```
|
|
||||||
|
|
||||||
Die Tests prüfen u.a. die Erreichbarkeit der App, die wichtigsten Funktionen und den Schutz vor XSS-Angriffen.
|
|
||||||
|
|
||||||
## Hinweise
|
|
||||||
|
|
||||||
### Motivation
|
|
||||||
|
|
||||||
Finde mal eine Datumsrechner- Webapp, die nicht völlig Werbe- und Tracking verseucht ist! Da ich sowas häufiger mal brauche, hab ich mir eine eigene gemacht.
|
|
||||||
|
|
||||||
### Vibe Coding
|
|
||||||
|
|
||||||
Dieses Projekt wurde zu nahezu 100% mit Unterstützung künsticher Intelligenz (*[Vibe Coding](https://de.wikipedia.org/wiki/Vibe_Coding)*) erstellt. Das Grundgerüst war nach ca. 45 Minuten fertig gestellt, insgesamt hat die Entwicklung des Projekts ca. 4 Stunden Zeit beansprucht.
|
|
||||||
|
|
||||||
### Statistik-Erfassung, Logging
|
|
||||||
|
|
||||||
Es werden keine IP-Adressen oder sonstigen persönlichen Daten gespeichert, lediglich die Zahl der Aufrufe der Funktionen in einer kumulierten Darstellung. Die Logdatei enthält nur Einträge der letzten sieben Tage.
|
|
||||||
|
|
||||||
### Barrierefreiheit (Accessibility)
|
|
||||||
|
|
||||||
*Elpatrons Datumsrechner* ist barrierefrei gestaltet und erfüllt zentrale Anforderungen an Accessibility (a11y):
|
|
||||||
|
|
||||||
- *Semantische HTML-Struktur:* Überschriften, Labels und Formularelemente sind korrekt ausgezeichnet und verknüpft.
|
|
||||||
- *ARIA-Attribute:* Accordion und Statusmeldungen sind mit ARIA-Attributen versehen, damit Screenreader die Struktur und Zustände erkennen.
|
|
||||||
- *Tastaturbedienbarkeit:* Alle interaktiven Elemente (Accordion, Buttons, Formulare) sind vollständig per Tastatur bedienbar (inkl. Fokus-Indikator und Pfeiltasten-Navigation im Accordion).
|
|
||||||
- *Fokus-Indikatoren:* Deutliche visuelle Hervorhebung des Fokus für alle Bedienelemente.
|
|
||||||
- *Farbkontraste:* Hohe Kontraste für Texte, Buttons und Ergebnisboxen, geprüft nach WCAG-Richtlinien.
|
|
||||||
- *Status- und Fehlermeldungen:* Ergebnisse und Fehler werden mit `aria-live` für Screenreader zugänglich gemacht.
|
|
||||||
- **Sprachausgabe:** Alle Ergebnisse können über 🔊-Buttons vorgelesen werden (Web Speech API, deutsche Sprache).
|
|
||||||
- *Mobile Optimierung:* Zusätzliche Meta-Tags für bessere Bedienbarkeit auf mobilen Geräten und Unterstützung von Screenreadern.
|
|
||||||
- *SEO:* Das Thema Barrierefreiheit ist in den Meta-Tags für Suchmaschinen sichtbar.
|
|
||||||
|
|
||||||
Damit ist die App für Menschen mit unterschiedlichen Einschränkungen (z.B. Sehbehinderung, motorische Einschränkungen) gut nutzbar und entspricht modernen Webstandards.
|
|
||||||
|
|
||||||
### Code Statistik
|
|
||||||
|
|
||||||
cloc|github.com/AlDanial/cloc v 2.06 T=0.06 s (263.5 files/s, 39193.4 lines/s)
|
|
||||||
--- | ---
|
|
||||||
|
|
||||||
Language|files|blank|comment|code
|
|
||||||
:-------|-------:|-------:|-------:|-------:
|
|
||||||
HTML|4|21|6|927
|
|
||||||
Python|2|34|26|482
|
|
||||||
Markdown|2|116|0|328
|
|
||||||
JSON|2|0|0|237
|
|
||||||
JavaScript|1|0|0|20
|
|
||||||
SVG|2|0|0|14
|
|
||||||
Dockerfile|1|5|6|8
|
|
||||||
DOS Batch|1|0|0|1
|
|
||||||
--------|--------|--------|--------|--------
|
|
||||||
SUM:|15|176|38|2017
|
|
||||||
|
|
||||||
## Lizenz
|
|
||||||
|
|
||||||
Dieses Projekt steht unter der [MIT-Lizenz](LICENSE).
|
|
||||||
|
|
||||||
---
|
|
||||||
(c) 2025 [Markus Busche](https://digitalcourage.social/@elpatron)
|
(c) 2025 [Markus Busche](https://digitalcourage.social/@elpatron)
|
512
README_de.md
Normal file
512
README_de.md
Normal file
@@ -0,0 +1,512 @@
|
|||||||
|
# Elpatrons Datumsrechner
|
||||||
|
|
||||||
|
[](https://github.com/elpatron/datecalc)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
|
||||||
|
Diese moderne Python-Webanwendung (Flask) ermöglicht verschiedene Datumsberechnungen über eine übersichtliche, barrierefreie Weboberfläche.
|
||||||
|
|
||||||
|
## Inhaltsverzeichnis
|
||||||
|
|
||||||
|
- [Demo](#demo)
|
||||||
|
- [Funktionen](#funktionen)
|
||||||
|
- [Installation (lokal)](#installation-lokal)
|
||||||
|
- [Starten der App](#starten-der-app)
|
||||||
|
- [Statistik-Dashboard & Passwortschutz](#statistik-dashboard-stats--passwortschutz)
|
||||||
|
- [Docker (empfohlen für Produktion)](#docker-empfohlen-für-produktion)
|
||||||
|
- [Log-Verzeichnis mounten](#log-verzeichnis-mounten-logs-auf-dem-host-speichern)
|
||||||
|
- [docker-compose Beispiel](#docker-compose-beispiel)
|
||||||
|
- [REST API](#rest-api)
|
||||||
|
- [Tage/Werktage zwischen zwei Daten](#1-tagewerktage-zwischen-zwei-daten)
|
||||||
|
- [Wochentag zu einem Datum](#2-wochentag-zu-einem-datum)
|
||||||
|
- [Kalenderwoche zu Datum](#3-kalenderwoche-zu-datum)
|
||||||
|
- [Start-/Enddatum einer Kalenderwoche](#4-start-enddatum-einer-kalenderwoche)
|
||||||
|
- [Datum plus/minus Tage, Wochen, Monate](#5-datum-plusminus-tage-wochen-monate)
|
||||||
|
- [Statistik](#6-statistik)
|
||||||
|
- [Monitoring & Healthcheck](#7-monitoring--healthcheck)
|
||||||
|
- [Progressive Web App (PWA)](#progressive-web-app-pwa)
|
||||||
|
- [Monitoring & Healthcheck](#monitoring--healthcheck)
|
||||||
|
- [Entwicklung & Hinweise](#entwicklung--hinweise)
|
||||||
|
- [Automatisierte Tests](#automatisierte-tests)
|
||||||
|
- [Hinweise](#hinweise)
|
||||||
|
- [Motivation](#motivation)
|
||||||
|
- [Vibe Coding](#vibe-coding)
|
||||||
|
- [Statistik-Erfassung, Logging](#statistik-erfassung-logging)
|
||||||
|
- [Barrierefreiheit (Accessibility)](#barrierefreiheit-accessibility)
|
||||||
|
- [Code Statistik](#code-statistik)
|
||||||
|
- [Lizenz](#lizenz)
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
|
||||||
|
Datumsrechner Live: [https://date.elpatron.me](https://date.elpatron.me)
|
||||||
|
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
|
||||||
|
**[Lighthouse](https://en.wikipedia.org/wiki/Lighthouse_(software))-Performance-Score:**
|
||||||
|
|
||||||
|
Die Webanwendung erreicht hervorragende Performance-Werte in allen Kategorien (Performance, Accessibility, Best Practices, SEO).
|
||||||
|
|
||||||
|
[Lighthouse-Ergebnis (PDF)](./lighthouse/lighthouse-score.pdf)
|
||||||
|
|
||||||
|
## Funktionen
|
||||||
|
|
||||||
|
- Anzahl der Tage zwischen zwei Daten
|
||||||
|
- Anzahl der Werktage zwischen zwei Daten (mit optionaler Berücksichtigung bundeslandspezifischer Feiertage)
|
||||||
|
- Anzeige des Wochentags eines Datums
|
||||||
|
- Datum plus/minus X Tage
|
||||||
|
- Datum plus/minus X Werktage
|
||||||
|
- Datum plus/minus X Wochen/Monate
|
||||||
|
- Kalenderwoche zu Datum
|
||||||
|
- Start-/Enddatum einer Kalenderwoche eines Jahres
|
||||||
|
- Integrierter Taschenrechner mit History und Sprachausgabe
|
||||||
|
- Mehrsprachige Unterstützung (Deutsch/Englisch) mit automatischer Browser-Spracherkennung
|
||||||
|
- Sprachausgabe für alle Ergebnisse (barrierefrei)
|
||||||
|
- Statistik-Dashboard mit Passwortschutz unter `/stats`
|
||||||
|
|
||||||
|
## Bundesland-Feiertage
|
||||||
|
|
||||||
|
Die Werktagsberechnung kann optional bundeslandspezifische Feiertage berücksichtigen. Dazu wird die kostenlose API von [feiertage-api.de](https://feiertage-api.de) verwendet.
|
||||||
|
|
||||||
|
**Verfügbare Bundesländer:**
|
||||||
|
|
||||||
|
- Baden-Württemberg (BW)
|
||||||
|
- Bayern (BY)
|
||||||
|
- Berlin (BE)
|
||||||
|
- Brandenburg (BB)
|
||||||
|
- Bremen (HB)
|
||||||
|
- Hamburg (HH)
|
||||||
|
- Hessen (HE)
|
||||||
|
- Mecklenburg-Vorpommern (MV)
|
||||||
|
- Niedersachsen (NI)
|
||||||
|
- Nordrhein-Westfalen (NW)
|
||||||
|
- Rheinland-Pfalz (RP)
|
||||||
|
- Saarland (SL)
|
||||||
|
- Sachsen (SN)
|
||||||
|
- Sachsen-Anhalt (ST)
|
||||||
|
- Schleswig-Holstein (SH)
|
||||||
|
- Thüringen (TH)
|
||||||
|
|
||||||
|
Die Feiertage werden automatisch für den gewählten Zeitraum abgerufen und bei der Werktagsberechnung als arbeitsfreie Tage behandelt. Im Ergebnis werden zusätzlich die Anzahl der Wochenendtage und Feiertage angezeigt.
|
||||||
|
|
||||||
|
## Mehrsprachige Unterstützung (i18n)
|
||||||
|
|
||||||
|
Die Anwendung unterstützt Deutsch und Englisch mit folgenden Features:
|
||||||
|
|
||||||
|
### Automatische Spracherkennung:
|
||||||
|
|
||||||
|
- *Browser-Sprache*: Automatische Erkennung der Browser-Einstellung
|
||||||
|
- *URL-Parameter*: Sprachauswahl über `?lang=de` oder `?lang=en`
|
||||||
|
- *localStorage*: Persistente Sprachauswahl im Browser
|
||||||
|
- *Fallback*: Deutsch als Standardsprache
|
||||||
|
|
||||||
|
### *Datenschutzfreundliche Implementierung:*
|
||||||
|
|
||||||
|
- *Keine Cookies*: Sprachauswahl ohne Cookies
|
||||||
|
- *URL-Parameter*: Transparente Sprachauswahl in der URL
|
||||||
|
- *localStorage*: Lokale Speicherung im Browser
|
||||||
|
- *Teilbare URLs*: URLs mit Sprachauswahl können geteilt werden
|
||||||
|
|
||||||
|
### *Barrierefreiheit:*
|
||||||
|
|
||||||
|
- *Screenreader*: Vollständige Unterstützung
|
||||||
|
- *Tastatur-Navigation*: Vollständig bedienbar
|
||||||
|
- *ARIA-Attribute*: Korrekte Beschriftungen
|
||||||
|
- *Semantische HTML*: Korrekte Struktur
|
||||||
|
- *Taschenrechner*: Vollständig barrierefrei mit Tastatur-Bedienung und Sprachausgabe
|
||||||
|
|
||||||
|
### *Technische Details:*
|
||||||
|
|
||||||
|
- *Flask-Babel*: Professionelle i18n-Implementierung
|
||||||
|
- *Gettext*: Standard für Übersetzungen
|
||||||
|
- *Responsive Design*: Angepasst für alle Geräte
|
||||||
|
- *SEO-freundlich*: URLs sind indexierbar
|
||||||
|
|
||||||
|
## Installation (lokal)
|
||||||
|
|
||||||
|
1. Python 3.8+ installieren
|
||||||
|
2. Abhängigkeiten installieren:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
## Starten der App
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Die App ist dann unter http://localhost:5000 erreichbar.
|
||||||
|
|
||||||
|
## Statistik-Dashboard (/stats) & Passwortschutz
|
||||||
|
|
||||||
|
Das Dashboard ist mit einem statischen Passwort geschützt, das über die Umgebungsvariable `STATS_PASSWORD` gesetzt wird.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Beispiel (PowerShell):
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:STATS_PASSWORD = "meinSicheresPasswort"
|
||||||
|
python app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Für Docker:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:STATS_PASSWORD = "meinSicheresPasswort"
|
||||||
|
docker run -e STATS_PASSWORD=$env:STATS_PASSWORD -p 5000:5000 datumsrechner
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker (empfohlen für Produktion)
|
||||||
|
|
||||||
|
Die App läuft im Container mit dem WSGI-Server **Gunicorn**:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t datumsrechner .
|
||||||
|
docker run -p 5000:5000 datumsrechner
|
||||||
|
```
|
||||||
|
|
||||||
|
- Gunicorn startet automatisch (siehe Dockerfile)
|
||||||
|
- Empfohlen für produktiven Einsatz
|
||||||
|
|
||||||
|
### Log-Verzeichnis mounten (Logs auf dem Host speichern)
|
||||||
|
|
||||||
|
Um die Logdateien außerhalb des Containers zu speichern, kannst du das log-Verzeichnis mounten:
|
||||||
|
|
||||||
|
**PowerShell-Beispiel:**
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
docker run -e STATS_PASSWORD=deinPasswort -p 5000:5000 -v ${PWD}/log:/app/log datumsrechner
|
||||||
|
```
|
||||||
|
|
||||||
|
### docker-compose Beispiel
|
||||||
|
|
||||||
|
Erstelle eine Datei `docker-compose.yml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
datumsrechner:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
environment:
|
||||||
|
- STATS_PASSWORD=deinPasswort
|
||||||
|
volumes:
|
||||||
|
- ./log:/app/log
|
||||||
|
```
|
||||||
|
|
||||||
|
Starte mit:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## REST API
|
||||||
|
|
||||||
|
Alle Datumsfunktionen stehen auch als REST-API zur Verfügung. Die API akzeptiert und liefert JSON.
|
||||||
|
|
||||||
|
**Basis-URL:** `http://localhost:5000/api/`
|
||||||
|
|
||||||
|
**Swagger Dokumentation:** [https://date.elpatron.me/api-docs](https://date.elpatron.me/api-docs)
|
||||||
|
|
||||||
|
**Hinweis:** Die Nutzung der REST API wird im Statistik-Dashboard ausgewertet und als Diagramm angezeigt.
|
||||||
|
|
||||||
|
### Endpunkte und Beispiele
|
||||||
|
|
||||||
|
#### 1. Tage/Werktage zwischen zwei Daten
|
||||||
|
|
||||||
|
**POST** `/api/tage_werktage`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"start": "2024-06-01",
|
||||||
|
"end": "2024-06-10",
|
||||||
|
"werktage": true,
|
||||||
|
"bundesland": "BY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/tage_werktage \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"start": "2024-06-01", "end": "2024-06-10", "werktage": true, "bundesland": "BY"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": 7 }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Hinweis:** Der Parameter `bundesland` ist optional und wird nur bei `"werktage": true` berücksichtigt. Verfügbare Bundesland-Kürzel siehe oben.
|
||||||
|
|
||||||
|
#### 2. Wochentag zu einem Datum
|
||||||
|
|
||||||
|
**POST** `/api/wochentag`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "datum": "2024-06-10" }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/wochentag \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"datum": "2024-06-10"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": "Montag" }
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. Kalenderwoche zu Datum
|
||||||
|
|
||||||
|
**POST** `/api/kw_berechnen`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "datum": "2024-06-10" }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/kw_berechnen \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"datum": "2024-06-10"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": "KW 24 (2024)", "kw": 24, "jahr": 2024 }
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 4. Start-/Enddatum einer Kalenderwoche
|
||||||
|
|
||||||
|
**POST** `/api/kw_datum`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "jahr": 2024, "kw": 24 }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/kw_datum \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"jahr": 2024, "kw": 24}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": "10.06.2024 bis 16.06.2024",
|
||||||
|
"start": "2024-06-10",
|
||||||
|
"end": "2024-06-16"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 5. Datum plus/minus Tage, Wochen, Monate
|
||||||
|
|
||||||
|
**POST** `/api/plusminus`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"datum": "2024-06-10",
|
||||||
|
"anzahl": 5,
|
||||||
|
"einheit": "tage",
|
||||||
|
"richtung": "add",
|
||||||
|
"werktage": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/plusminus \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"datum": "2024-06-10", "anzahl": 5, "einheit": "tage", "richtung": "add", "werktage": false}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": "2024-06-15" }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Hinweis:**
|
||||||
|
|
||||||
|
- `"einheit"`: `"tage"`, `"wochen"` oder `"monate"`
|
||||||
|
- `"richtung"`: `"add"` (plus) oder `"sub"` (minus)
|
||||||
|
- `"werktage"`: `true` für Werktage, sonst `false` (nur bei `"tage"` unterstützt)
|
||||||
|
|
||||||
|
#### 6. Statistik
|
||||||
|
|
||||||
|
**GET** `/api/stats`
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl http://localhost:5000/api/stats
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"pageviews": 42,
|
||||||
|
"func_counts": { "plusminus": 10, "tage_werktage": 5 },
|
||||||
|
"impressions_per_day": { "2024-06-10": 7 }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 7. Monitoring & Healthcheck
|
||||||
|
|
||||||
|
**GET** `/api/monitor`
|
||||||
|
|
||||||
|
**Mit curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl http://localhost:5000/api/monitor
|
||||||
|
```
|
||||||
|
|
||||||
|
**Antwort:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "ok",
|
||||||
|
"message": "App running",
|
||||||
|
"time": "2025-07-24T13:37:00.123456",
|
||||||
|
"uptime_seconds": 12345,
|
||||||
|
"pageviews_last_7_days": 42
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Fehlerfälle** liefern immer einen HTTP-Statuscode 400 und ein JSON mit `"error"`-Feld, z.B.:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "error": "Ungültige Eingabe", "details": "..." }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Progressive Web App (PWA)
|
||||||
|
|
||||||
|
Elpatrons Datumsrechner ist als PWA installierbar (z.B. auf Android/iOS-Homescreen oder Desktop). Die App funktioniert offline für die Startseite und statische Ressourcen, die Datumsberechnung bleibt serverseitig.
|
||||||
|
|
||||||
|
- Manifest und Service Worker sind integriert
|
||||||
|
- App-Icon und Theme-Color für Homescreen
|
||||||
|
- Installation über Browser-Menü ("Zum Startbildschirm hinzufügen")
|
||||||
|
- Taschenrechner funktioniert vollständig clientseitig (offline verfügbar)
|
||||||
|
|
||||||
|
## Monitoring & Healthcheck
|
||||||
|
|
||||||
|
Die App bietet einen Monitoring-Endpunkt unter `/monitor`, der Statusinformationen als JSON zurückgibt (z.B. für Uptime-Robot, Docker Healthcheck oder eigene Tools):
|
||||||
|
|
||||||
|
- Status (ok)
|
||||||
|
- Aktuelle Serverzeit
|
||||||
|
- Uptime (Sekunden seit Start)
|
||||||
|
- Pageviews der letzten 7 Tage
|
||||||
|
|
||||||
|
Beispiel-Aufruf:
|
||||||
|
|
||||||
|
`GET https://date.elpatron.me/monitor`
|
||||||
|
|
||||||
|
Antwort:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "ok",
|
||||||
|
"message": "App running",
|
||||||
|
"time": "2025-07-24T13:37:00.123456",
|
||||||
|
"uptime_seconds": 12345,
|
||||||
|
"pageviews_last_7_days": 42
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Entwicklung & Hinweise
|
||||||
|
|
||||||
|
- Die HTML-Templates liegen im Ordner `templates/` (Trennung von Logik und Darstellung)
|
||||||
|
- Das Projekt ist auf Codeberg gehostet: [https://codeberg.org/elpatron/datecalc](https://codeberg.org/elpatron/datecalc)
|
||||||
|
- Modernes, responsives Design mit Akkordeon und Icons
|
||||||
|
|
||||||
|
## Automatisierte Tests
|
||||||
|
|
||||||
|
Automatisierte Tests sind mit pytest möglich:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pytest test_app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Die Tests prüfen u.a. die Erreichbarkeit der App, die wichtigsten Funktionen und den Schutz vor XSS-Angriffen.
|
||||||
|
|
||||||
|
## Hinweise
|
||||||
|
|
||||||
|
### Motivation
|
||||||
|
|
||||||
|
Finde mal eine Datumsrechner- Webapp, die nicht völlig Werbe- und Tracking verseucht ist! Da ich sowas häufiger mal brauche, hab ich mir eine eigene gemacht.
|
||||||
|
|
||||||
|
### Vibe Coding
|
||||||
|
|
||||||
|
Dieses Projekt wurde zu nahezu 100% mit Unterstützung künsticher Intelligenz (*[Vibe Coding](https://de.wikipedia.org/wiki/Vibe_Coding)*) erstellt. Das Grundgerüst war nach ca. 45 Minuten fertig gestellt, insgesamt hat die Entwicklung des Projekts ca. 12 Stunden Zeit beansprucht.
|
||||||
|
|
||||||
|
### Statistik-Erfassung, Logging
|
||||||
|
|
||||||
|
Es werden keine IP-Adressen oder sonstigen persönlichen Daten gespeichert, lediglich die Zahl der Aufrufe der Funktionen in einer kumulierten Darstellung. Die Logdatei enthält nur Einträge der letzten sieben Tage.
|
||||||
|
|
||||||
|
### Barrierefreiheit (Accessibility)
|
||||||
|
|
||||||
|
*Elpatrons Datumsrechner* ist barrierefrei gestaltet und erfüllt zentrale Anforderungen an Accessibility (a11y):
|
||||||
|
|
||||||
|
- *Semantische HTML-Struktur:* Überschriften, Labels und Formularelemente sind korrekt ausgezeichnet und verknüpft.
|
||||||
|
- *ARIA-Attribute:* Accordion und Statusmeldungen sind mit ARIA-Attributen versehen, damit Screenreader die Struktur und Zustände erkennen.
|
||||||
|
- *Tastaturbedienbarkeit:* Alle interaktiven Elemente (Accordion, Buttons, Formulare) sind vollständig per Tastatur bedienbar (inkl. Fokus-Indikator und Pfeiltasten-Navigation im Accordion).
|
||||||
|
- *Fokus-Indikatoren:* Deutliche visuelle Hervorhebung des Fokus für alle Bedienelemente.
|
||||||
|
- *Farbkontraste:* Hohe Kontraste für Texte, Buttons und Ergebnisboxen, geprüft nach WCAG-Richtlinien.
|
||||||
|
- *Status- und Fehlermeldungen:* Ergebnisse und Fehler werden mit `aria-live` für Screenreader zugänglich gemacht.
|
||||||
|
- *Sprachausgabe:* Alle Ergebnisse können über 🔊-Buttons vorgelesen werden (Web Speech API, deutsche Sprache).
|
||||||
|
- *Taschenrechner:* Vollständig barrierefrei mit Tastatur-Bedienung, Sprachausgabe und History-Funktion.
|
||||||
|
- *Mobile Optimierung:* Zusätzliche Meta-Tags für bessere Bedienbarkeit auf mobilen Geräten und Unterstützung von Screenreadern.
|
||||||
|
- *SEO:* Das Thema Barrierefreiheit ist in den Meta-Tags für Suchmaschinen sichtbar.
|
||||||
|
|
||||||
|
Damit ist die App für Menschen mit unterschiedlichen Einschränkungen (z.B. Sehbehinderung, motorische Einschränkungen) gut nutzbar und entspricht modernen Webstandards.
|
||||||
|
|
||||||
|
### Code Statistik
|
||||||
|
|
||||||
|
cloc|github.com/AlDanial/cloc v 2.06 T=0.22 s (124.7 files/s, 34058.5 lines/s)
|
||||||
|
--- | ---
|
||||||
|
|
||||||
|
Language|files|blank|comment|code
|
||||||
|
:-------|-------:|-------:|-------:|-------:
|
||||||
|
HTML|8|159|8|2806
|
||||||
|
Markdown|5|340|0|876
|
||||||
|
Python|2|68|76|744
|
||||||
|
JavaScript|2|95|88|580
|
||||||
|
PO File|2|260|266|544
|
||||||
|
JSON|3|0|0|243
|
||||||
|
CSS|1|186|3|188
|
||||||
|
XML|1|10|4|69
|
||||||
|
SVG|2|0|0|14
|
||||||
|
Dockerfile|1|5|6|8
|
||||||
|
DOS Batch|1|0|0|1
|
||||||
|
--------|--------|--------|--------|--------
|
||||||
|
SUM:|28|1123|451|6073
|
||||||
|
|
||||||
|
## Lizenz
|
||||||
|
|
||||||
|
Dieses Projekt steht unter der [MIT-Lizenz](LICENSE).
|
||||||
|
|
||||||
|
---
|
||||||
|
(c) 2025 [Markus Busche](https://digitalcourage.social/@elpatron)
|
||||||
|
|
||||||
|
**Version 1.4.12** - Integrierter Taschenrechner mit History und Sprachausgabe hinzugefügt
|
512
README_en.md
Normal file
512
README_en.md
Normal file
@@ -0,0 +1,512 @@
|
|||||||
|
# Elpatrons Date Calculator
|
||||||
|
|
||||||
|
[](https://github.com/elpatron/datecalc)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
|
||||||
|
This modern Python web application (Flask) enables various date calculations through a clear, accessible web interface.
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
|
||||||
|
- [Demo](#demo)
|
||||||
|
- [Features](#features)
|
||||||
|
- [Installation (local)](#installation-local)
|
||||||
|
- [Starting the App](#starting-the-app)
|
||||||
|
- [Statistics Dashboard & Password Protection](#statistics-dashboard--password-protection)
|
||||||
|
- [Docker (recommended for production)](#docker-recommended-for-production)
|
||||||
|
- [Mounting log directory](#mounting-log-directory-logs-stored-on-host)
|
||||||
|
- [docker-compose example](#docker-compose-example)
|
||||||
|
- [REST API](#rest-api)
|
||||||
|
- [Days/Working days between two dates](#1-daysworking-days-between-two-dates)
|
||||||
|
- [Weekday for a date](#2-weekday-for-a-date)
|
||||||
|
- [Calendar week for date](#3-calendar-week-for-date)
|
||||||
|
- [Start/End date of a calendar week](#4-startend-date-of-a-calendar-week)
|
||||||
|
- [Date plus/minus days, weeks, months](#5-date-plusminus-days-weeks-months)
|
||||||
|
- [Statistics](#6-statistics)
|
||||||
|
- [Monitoring & Healthcheck](#7-monitoring--healthcheck)
|
||||||
|
- [Progressive Web App (PWA)](#progressive-web-app-pwa)
|
||||||
|
- [Monitoring & Healthcheck](#monitoring--healthcheck)
|
||||||
|
- [Development & Notes](#development--notes)
|
||||||
|
- [Automated Tests](#automated-tests)
|
||||||
|
- [Notes](#notes)
|
||||||
|
- [Motivation](#motivation)
|
||||||
|
- [Vibe Coding](#vibe-coding)
|
||||||
|
- [Statistics collection, Logging](#statistics-collection-logging)
|
||||||
|
- [Accessibility](#accessibility)
|
||||||
|
- [Code Statistics](#code-statistics)
|
||||||
|
- [License](#license)
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
|
||||||
|
Date Calculator Live: [https://date.elpatron.me](https://date.elpatron.me)
|
||||||
|
|
||||||
|
[](https://date.elpatron.me)
|
||||||
|
|
||||||
|
**[Lighthouse](https://en.wikipedia.org/wiki/Lighthouse_(software)) Performance Score:**
|
||||||
|
|
||||||
|
The web application achieves excellent performance values in all categories (Performance, Accessibility, Best Practices, SEO).
|
||||||
|
|
||||||
|
[Lighthouse Result (PDF)](./lighthouse/lighthouse-score.pdf)
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Number of days between two dates
|
||||||
|
- Number of working days between two dates (with optional consideration of state-specific holidays)
|
||||||
|
- Display of the weekday of a date
|
||||||
|
- Date plus/minus X days
|
||||||
|
- Date plus/minus X working days
|
||||||
|
- Date plus/minus X weeks/months
|
||||||
|
- Calendar week for date
|
||||||
|
- Start/End date of a calendar week of a year
|
||||||
|
- Integrated calculator with history and speech output
|
||||||
|
- Multilingual support (German/English) with automatic browser language detection
|
||||||
|
- Speech output for all results (accessible)
|
||||||
|
- Statistics dashboard with password protection under `/stats`
|
||||||
|
|
||||||
|
## State Holidays
|
||||||
|
|
||||||
|
The working day calculation can optionally consider state-specific holidays. The free API from [feiertage-api.de](https://feiertage-api.de) is used for this purpose.
|
||||||
|
|
||||||
|
**Available States:**
|
||||||
|
|
||||||
|
- Baden-Württemberg (BW)
|
||||||
|
- Bavaria (BY)
|
||||||
|
- Berlin (BE)
|
||||||
|
- Brandenburg (BB)
|
||||||
|
- Bremen (HB)
|
||||||
|
- Hamburg (HH)
|
||||||
|
- Hesse (HE)
|
||||||
|
- Mecklenburg-Vorpommern (MV)
|
||||||
|
- Lower Saxony (NI)
|
||||||
|
- North Rhine-Westphalia (NW)
|
||||||
|
- Rhineland-Palatinate (RP)
|
||||||
|
- Saarland (SL)
|
||||||
|
- Saxony (SN)
|
||||||
|
- Saxony-Anhalt (ST)
|
||||||
|
- Schleswig-Holstein (SH)
|
||||||
|
- Thuringia (TH)
|
||||||
|
|
||||||
|
Holidays are automatically retrieved for the selected time period and treated as non-working days in the working day calculation. The result also shows the number of weekend days and holidays.
|
||||||
|
|
||||||
|
## Multilingual Support (i18n)
|
||||||
|
|
||||||
|
The application supports German and English with the following features:
|
||||||
|
|
||||||
|
### Automatic Language Detection:
|
||||||
|
|
||||||
|
- *Browser Language*: Automatic detection of browser settings
|
||||||
|
- *URL Parameter*: Language selection via `?lang=de` or `?lang=en`
|
||||||
|
- *localStorage*: Persistent language selection in browser
|
||||||
|
- *Fallback*: German as default language
|
||||||
|
|
||||||
|
### *Privacy-friendly Implementation:*
|
||||||
|
|
||||||
|
- *No Cookies*: Language selection without cookies
|
||||||
|
- *URL Parameters*: Transparent language selection in URL
|
||||||
|
- *localStorage*: Local storage in browser
|
||||||
|
- *Shareable URLs*: URLs with language selection can be shared
|
||||||
|
|
||||||
|
### *Accessibility:*
|
||||||
|
|
||||||
|
- *Screen Reader*: Full support
|
||||||
|
- *Keyboard Navigation*: Fully operable
|
||||||
|
- *ARIA Attributes*: Correct labels
|
||||||
|
- *Semantic HTML*: Correct structure
|
||||||
|
- *Calculator*: Fully accessible with keyboard operation and speech output
|
||||||
|
|
||||||
|
### *Technical Details:*
|
||||||
|
|
||||||
|
- *Flask-Babel*: Professional i18n implementation
|
||||||
|
- *Gettext*: Standard for translations
|
||||||
|
- *Responsive Design*: Adapted for all devices
|
||||||
|
- *SEO-friendly*: URLs are indexable
|
||||||
|
|
||||||
|
## Installation (local)
|
||||||
|
|
||||||
|
1. Install Python 3.8+
|
||||||
|
2. Install dependencies:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
## Starting the App
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The app is then accessible at http://localhost:5000.
|
||||||
|
|
||||||
|
## Statistics Dashboard (/stats) & Password Protection
|
||||||
|
|
||||||
|
The dashboard is protected with a static password that is set via the environment variable `STATS_PASSWORD`.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Example (PowerShell):
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:STATS_PASSWORD = "mySecurePassword"
|
||||||
|
python app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
For Docker:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:STATS_PASSWORD = "mySecurePassword"
|
||||||
|
docker run -e STATS_PASSWORD=$env:STATS_PASSWORD -p 5000:5000 datumsrechner
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker (recommended for production)
|
||||||
|
|
||||||
|
The app runs in a container with the **Gunicorn** WSGI server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t datumsrechner .
|
||||||
|
docker run -p 5000:5000 datumsrechner
|
||||||
|
```
|
||||||
|
|
||||||
|
- Gunicorn starts automatically (see Dockerfile)
|
||||||
|
- Recommended for production use
|
||||||
|
|
||||||
|
### Mounting log directory (Logs stored on host)
|
||||||
|
|
||||||
|
To store log files outside the container, you can mount the log directory:
|
||||||
|
|
||||||
|
**PowerShell Example:**
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
docker run -e STATS_PASSWORD=yourPassword -p 5000:5000 -v ${PWD}/log:/app/log datumsrechner
|
||||||
|
```
|
||||||
|
|
||||||
|
### docker-compose example
|
||||||
|
|
||||||
|
Create a `docker-compose.yml` file:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
datumsrechner:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
environment:
|
||||||
|
- STATS_PASSWORD=yourPassword
|
||||||
|
volumes:
|
||||||
|
- ./log:/app/log
|
||||||
|
```
|
||||||
|
|
||||||
|
Start with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## REST API
|
||||||
|
|
||||||
|
All date functions are also available as a REST API. The API accepts and returns JSON.
|
||||||
|
|
||||||
|
**Base URL:** `http://localhost:5000/api/`
|
||||||
|
|
||||||
|
**Swagger Documentation:** [https://date.elpatron.me/api-docs](https://date.elpatron.me/api-docs)
|
||||||
|
|
||||||
|
**Note:** The use of the REST API is evaluated in the statistics dashboard and displayed as a chart.
|
||||||
|
|
||||||
|
### Endpoints and Examples
|
||||||
|
|
||||||
|
#### 1. Days/Working days between two dates
|
||||||
|
|
||||||
|
**POST** `/api/tage_werktage`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"start": "2024-06-01",
|
||||||
|
"end": "2024-06-10",
|
||||||
|
"werktage": true,
|
||||||
|
"bundesland": "BY"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/tage_werktage \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"start": "2024-06-01", "end": "2024-06-10", "werktage": true, "bundesland": "BY"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": 7 }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** The `bundesland` parameter is optional and is only considered when `"werktage": true`. Available state abbreviations see above.
|
||||||
|
|
||||||
|
#### 2. Weekday for a date
|
||||||
|
|
||||||
|
**POST** `/api/wochentag`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "datum": "2024-06-10" }
|
||||||
|
```
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/wochentag \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"datum": "2024-06-10"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": "Monday" }
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 3. Calendar week for date
|
||||||
|
|
||||||
|
**POST** `/api/kw_berechnen`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "datum": "2024-06-10" }
|
||||||
|
```
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/kw_berechnen \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"datum": "2024-06-10"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": "CW 24 (2024)", "kw": 24, "jahr": 2024 }
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 4. Start/End date of a calendar week
|
||||||
|
|
||||||
|
**POST** `/api/kw_datum`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "jahr": 2024, "kw": 24 }
|
||||||
|
```
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/kw_datum \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"jahr": 2024, "kw": 24}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": "10.06.2024 to 16.06.2024",
|
||||||
|
"start": "2024-06-10",
|
||||||
|
"end": "2024-06-16"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 5. Date plus/minus days, weeks, months
|
||||||
|
|
||||||
|
**POST** `/api/plusminus`
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"datum": "2024-06-10",
|
||||||
|
"anzahl": 5,
|
||||||
|
"einheit": "tage",
|
||||||
|
"richtung": "add",
|
||||||
|
"werktage": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -X POST http://localhost:5000/api/plusminus \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{"datum": "2024-06-10", "anzahl": 5, "einheit": "tage", "richtung": "add", "werktage": false}'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "result": "2024-06-15" }
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:**
|
||||||
|
|
||||||
|
- `"einheit"`: `"tage"`, `"wochen"` or `"monate"`
|
||||||
|
- `"richtung"`: `"add"` (plus) or `"sub"` (minus)
|
||||||
|
- `"werktage"`: `true` for working days, otherwise `false` (only supported for `"tage"`)
|
||||||
|
|
||||||
|
#### 6. Statistics
|
||||||
|
|
||||||
|
**GET** `/api/stats`
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl http://localhost:5000/api/stats
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"pageviews": 42,
|
||||||
|
"func_counts": { "plusminus": 10, "tage_werktage": 5 },
|
||||||
|
"impressions_per_day": { "2024-06-10": 7 }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 7. Monitoring & Healthcheck
|
||||||
|
|
||||||
|
**GET** `/api/monitor`
|
||||||
|
|
||||||
|
**With curl:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl http://localhost:5000/api/monitor
|
||||||
|
```
|
||||||
|
|
||||||
|
**Response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "ok",
|
||||||
|
"message": "App running",
|
||||||
|
"time": "2025-07-24T13:37:00.123456",
|
||||||
|
"uptime_seconds": 12345,
|
||||||
|
"pageviews_last_7_days": 42
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Error cases** always return an HTTP status code 400 and JSON with an `"error"` field, e.g.:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{ "error": "Invalid input", "details": "..." }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Progressive Web App (PWA)
|
||||||
|
|
||||||
|
Elpatron's Date Calculator is installable as a PWA (e.g., on Android/iOS home screen or desktop). The app works offline for the homepage and static resources, date calculation remains server-side.
|
||||||
|
|
||||||
|
- Manifest and Service Worker are integrated
|
||||||
|
- App icon and theme color for home screen
|
||||||
|
- Installation via browser menu ("Add to home screen")
|
||||||
|
- Calculator works completely client-side (available offline)
|
||||||
|
|
||||||
|
## Monitoring & Healthcheck
|
||||||
|
|
||||||
|
The app provides a monitoring endpoint at `/monitor` that returns status information as JSON (e.g., for Uptime Robot, Docker Healthcheck or own tools):
|
||||||
|
|
||||||
|
- Status (ok)
|
||||||
|
- Current server time
|
||||||
|
- Uptime (seconds since start)
|
||||||
|
- Pageviews of the last 7 days
|
||||||
|
|
||||||
|
Example call:
|
||||||
|
|
||||||
|
`GET https://date.elpatron.me/monitor`
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"status": "ok",
|
||||||
|
"message": "App running",
|
||||||
|
"time": "2025-07-24T13:37:00.123456",
|
||||||
|
"uptime_seconds": 12345,
|
||||||
|
"pageviews_last_7_days": 42
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development & Notes
|
||||||
|
|
||||||
|
- HTML templates are in the `templates/` folder (separation of logic and presentation)
|
||||||
|
- The project is hosted on Codeberg: [https://codeberg.org/elpatron/datecalc](https://codeberg.org/elpatron/datecalc)
|
||||||
|
- Modern, responsive design with accordion and icons
|
||||||
|
|
||||||
|
## Automated Tests
|
||||||
|
|
||||||
|
Automated tests are possible with pytest:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pytest test_app.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The tests check, among other things, the accessibility of the app, the most important functions, and protection against XSS attacks.
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
### Motivation
|
||||||
|
|
||||||
|
Try to find a date calculator web app that isn't completely riddled with ads and tracking! Since I need something like this more often, I made my own.
|
||||||
|
|
||||||
|
### Vibe Coding
|
||||||
|
|
||||||
|
This project was created almost 100% with the support of artificial intelligence (*[Vibe Coding](https://en.wikipedia.org/wiki/Vibe_Coding)*). The basic framework was completed after about 45 minutes, and the total development of the project took about 12 hours.
|
||||||
|
|
||||||
|
### Statistics collection, Logging
|
||||||
|
|
||||||
|
No IP addresses or other personal data are stored, only the number of function calls in a cumulative representation. The log file only contains entries from the last seven days.
|
||||||
|
|
||||||
|
### Accessibility
|
||||||
|
|
||||||
|
*Elpatron's Date Calculator* is designed to be accessible and meets central accessibility (a11y) requirements:
|
||||||
|
|
||||||
|
- *Semantic HTML Structure:* Headings, labels, and form elements are correctly marked and linked.
|
||||||
|
- *ARIA Attributes:* Accordion and status messages are equipped with ARIA attributes so that screen readers can recognize the structure and states.
|
||||||
|
- *Keyboard Operability:* All interactive elements (accordion, buttons, forms) are fully operable by keyboard (including focus indicator and arrow key navigation in accordion).
|
||||||
|
- *Focus Indicators:* Clear visual highlighting of focus for all control elements.
|
||||||
|
- *Color Contrasts:* High contrasts for texts, buttons, and result boxes, tested according to WCAG guidelines.
|
||||||
|
- *Status and Error Messages:* Results and errors are made accessible to screen readers with `aria-live`.
|
||||||
|
- *Speech Output:* All results can be read aloud via 🔊 buttons (Web Speech API, German language).
|
||||||
|
- *Calculator:* Fully accessible with keyboard operation, speech output, and history function.
|
||||||
|
- *Mobile Optimization:* Additional meta tags for better usability on mobile devices and support for screen readers.
|
||||||
|
- *SEO:* The accessibility topic is visible in meta tags for search engines.
|
||||||
|
|
||||||
|
This makes the app well usable for people with different disabilities (e.g., visual impairment, motor limitations) and meets modern web standards.
|
||||||
|
|
||||||
|
### Code Statistics
|
||||||
|
|
||||||
|
cloc|github.com/AlDanial/cloc v 2.06 T=0.22 s (124.7 files/s, 34058.5 lines/s)
|
||||||
|
--- | ---
|
||||||
|
|
||||||
|
Language|files|blank|comment|code
|
||||||
|
:-------|-------:|-------:|-------:|-------:
|
||||||
|
HTML|8|159|8|2806
|
||||||
|
Markdown|5|340|0|876
|
||||||
|
Python|2|68|76|744
|
||||||
|
JavaScript|2|95|88|580
|
||||||
|
PO File|2|260|266|544
|
||||||
|
JSON|3|0|0|243
|
||||||
|
CSS|1|186|3|188
|
||||||
|
XML|1|10|4|69
|
||||||
|
SVG|2|0|0|14
|
||||||
|
Dockerfile|1|5|6|8
|
||||||
|
DOS Batch|1|0|0|1
|
||||||
|
--------|--------|--------|--------|--------
|
||||||
|
SUM:|28|1123|451|6073
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the [MIT License](LICENSE).
|
||||||
|
|
||||||
|
---
|
||||||
|
(c) 2025 [Markus Busche](https://digitalcourage.social/@elpatron)
|
||||||
|
|
||||||
|
**Version 1.4.12** - Integrated calculator with history and speech output added
|
229
app.py
229
app.py
@@ -1,4 +1,5 @@
|
|||||||
from flask import Flask, render_template, request, redirect, url_for, session, abort, jsonify
|
from flask import Flask, render_template, request, redirect, url_for, session, jsonify, make_response
|
||||||
|
from flask_babel import Babel, gettext, get_locale
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from dateutil.relativedelta import relativedelta
|
from dateutil.relativedelta import relativedelta
|
||||||
@@ -11,12 +12,56 @@ app_start_time = time.time()
|
|||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.secret_key = os.environ.get('SECRET_KEY', 'dev-key')
|
app.secret_key = os.environ.get('SECRET_KEY', 'dev-key')
|
||||||
|
|
||||||
|
# Babel Konfiguration
|
||||||
|
app.config['BABEL_DEFAULT_LOCALE'] = 'de'
|
||||||
|
app.config['BABEL_SUPPORTED_LOCALES'] = ['de', 'en']
|
||||||
|
app.config['BABEL_TRANSLATION_DIRECTORIES'] = 'translations'
|
||||||
|
|
||||||
|
babel = Babel()
|
||||||
|
|
||||||
# Version der App
|
# Version der App
|
||||||
APP_VERSION = "1.3.12"
|
APP_VERSION = "1.4.18"
|
||||||
|
|
||||||
|
def add_cache_headers(response):
|
||||||
|
"""Fügt Cache-Control-Header hinzu, die den Back-Forward-Cache ermöglichen"""
|
||||||
|
# Cache-Control für statische Inhalte und API-Endpunkte
|
||||||
|
if request.path.startswith('/static/') or request.path.startswith('/api/'):
|
||||||
|
response.headers['Cache-Control'] = 'public, max-age=3600, s-maxage=3600'
|
||||||
|
else:
|
||||||
|
# Für HTML-Seiten: kurze Cache-Zeit, aber Back-Forward-Cache erlauben
|
||||||
|
response.headers['Cache-Control'] = 'public, max-age=60, s-maxage=300'
|
||||||
|
|
||||||
|
# Wichtig: Keine Vary-Header für User-Agent oder andere dynamische Werte
|
||||||
|
# Dies verhindert den Back-Forward-Cache
|
||||||
|
if 'Vary' in response.headers:
|
||||||
|
del response.headers['Vary']
|
||||||
|
|
||||||
|
return response
|
||||||
|
|
||||||
# HTML-Template wird jetzt aus templates/index.html geladen
|
# HTML-Template wird jetzt aus templates/index.html geladen
|
||||||
|
|
||||||
WOCHENTAGE = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"]
|
WOCHENTAGE = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"]
|
||||||
|
WOCHENTAGE_EN = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
|
||||||
|
|
||||||
|
def get_locale():
|
||||||
|
# Prüfe URL-Parameter für Sprachauswahl (datenschutzfreundlich)
|
||||||
|
if request.args.get('lang') in ['de', 'en']:
|
||||||
|
return request.args.get('lang')
|
||||||
|
# Prüfe Session für Sprachauswahl (Fallback für ältere Browser)
|
||||||
|
if 'language' in session:
|
||||||
|
return session['language']
|
||||||
|
# Fallback auf Browser-Sprache
|
||||||
|
return request.accept_languages.best_match(['de', 'en'], default='de')
|
||||||
|
|
||||||
|
# Registriere die Locale-Funktion mit Babel
|
||||||
|
babel.init_app(app, locale_selector=get_locale)
|
||||||
|
|
||||||
|
def get_wochentage():
|
||||||
|
"""Gibt die Wochentage in der aktuellen Sprache zurück"""
|
||||||
|
locale = get_locale()
|
||||||
|
if locale == 'en':
|
||||||
|
return WOCHENTAGE_EN
|
||||||
|
return WOCHENTAGE
|
||||||
|
|
||||||
def get_feiertage(year, bundesland):
|
def get_feiertage(year, bundesland):
|
||||||
"""Holt die Feiertage für ein Jahr und Bundesland von feiertage-api.de."""
|
"""Holt die Feiertage für ein Jahr und Bundesland von feiertage-api.de."""
|
||||||
@@ -30,6 +75,24 @@ def get_feiertage(year, bundesland):
|
|||||||
print(f"Fehler beim Abrufen der Feiertage: {e}")
|
print(f"Fehler beim Abrufen der Feiertage: {e}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@app.route('/set_language/<language>')
|
||||||
|
def set_language(language):
|
||||||
|
"""Setzt die Sprache über URL-Parameter (datenschutzfreundlich)"""
|
||||||
|
if language in ['de', 'en']:
|
||||||
|
# URL-Parameter verwenden statt Session
|
||||||
|
referrer = request.referrer or url_for('index')
|
||||||
|
if '?' in referrer:
|
||||||
|
# URL hat bereits Parameter
|
||||||
|
if 'lang=' in referrer:
|
||||||
|
# Ersetze bestehenden lang-Parameter
|
||||||
|
import re
|
||||||
|
referrer = re.sub(r'[?&]lang=[^&]*', '', referrer)
|
||||||
|
return redirect(f"{referrer}&lang={language}")
|
||||||
|
else:
|
||||||
|
# URL hat keine Parameter
|
||||||
|
return redirect(f"{referrer}?lang={language}")
|
||||||
|
return redirect(request.referrer or url_for('index'))
|
||||||
|
|
||||||
@app.route('/', methods=['GET', 'POST'])
|
@app.route('/', methods=['GET', 'POST'])
|
||||||
def index():
|
def index():
|
||||||
# Rudimentäres Logging für Page Impressions
|
# Rudimentäres Logging für Page Impressions
|
||||||
@@ -55,7 +118,7 @@ def index():
|
|||||||
with open(log_path, 'a', encoding='utf-8') as f:
|
with open(log_path, 'a', encoding='utf-8') as f:
|
||||||
from datetime import datetime as dt
|
from datetime import datetime as dt
|
||||||
f.write(f"{dt.now().isoformat()} PAGEVIEW\n")
|
f.write(f"{dt.now().isoformat()} PAGEVIEW\n")
|
||||||
tage = werktage = wochentag = datumsrechnung = werktagsrechnung = kw_berechnen = kw_datum = wochen_monate = None
|
tage = wochentag = kw_berechnen = kw_datum = None
|
||||||
feiertage_anzahl = wochenendtage_anzahl = None
|
feiertage_anzahl = wochenendtage_anzahl = None
|
||||||
active_idx = 0
|
active_idx = 0
|
||||||
plusminus_result = None
|
plusminus_result = None
|
||||||
@@ -94,24 +157,29 @@ def index():
|
|||||||
else:
|
else:
|
||||||
tage = abs((d2 - d1).days)
|
tage = abs((d2 - d1).days)
|
||||||
except Exception:
|
except Exception:
|
||||||
tage = 'Ungültige Eingabe'
|
tage = gettext('Ungültige Eingabe')
|
||||||
elif action == 'wochentag':
|
elif action == 'wochentag':
|
||||||
active_idx = 1
|
active_idx = 1
|
||||||
datum = request.form.get('datum3')
|
datum = request.form.get('datum3')
|
||||||
try:
|
try:
|
||||||
d = datetime.strptime(datum, '%Y-%m-%d')
|
d = datetime.strptime(datum, '%Y-%m-%d')
|
||||||
wochentag = WOCHENTAGE[d.weekday()]
|
wochentage = get_wochentage()
|
||||||
|
wochentag = wochentage[d.weekday()]
|
||||||
except Exception:
|
except Exception:
|
||||||
wochentag = 'Ungültige Eingabe'
|
wochentag = gettext('Ungültige Eingabe')
|
||||||
elif action == 'kw_berechnen':
|
elif action == 'kw_berechnen':
|
||||||
active_idx = 2
|
active_idx = 2
|
||||||
datum = request.form.get('datum6')
|
datum = request.form.get('datum6')
|
||||||
try:
|
try:
|
||||||
d = datetime.strptime(datum, '%Y-%m-%d')
|
d = datetime.strptime(datum, '%Y-%m-%d')
|
||||||
kw = d.isocalendar().week
|
kw = d.isocalendar().week
|
||||||
|
locale = get_locale()
|
||||||
|
if locale == 'en':
|
||||||
|
kw_berechnen = f"Week {kw} ({d.year})"
|
||||||
|
else:
|
||||||
kw_berechnen = f"KW {kw} ({d.year})"
|
kw_berechnen = f"KW {kw} ({d.year})"
|
||||||
except Exception:
|
except Exception:
|
||||||
kw_berechnen = 'Ungültige Eingabe'
|
kw_berechnen = gettext('Ungültige Eingabe')
|
||||||
elif action == 'kw_datum':
|
elif action == 'kw_datum':
|
||||||
active_idx = 3
|
active_idx = 3
|
||||||
jahr = request.form.get('jahr7')
|
jahr = request.form.get('jahr7')
|
||||||
@@ -122,9 +190,13 @@ def index():
|
|||||||
# Montag der KW
|
# Montag der KW
|
||||||
start = datetime.fromisocalendar(jahr, kw, 1)
|
start = datetime.fromisocalendar(jahr, kw, 1)
|
||||||
end = datetime.fromisocalendar(jahr, kw, 7)
|
end = datetime.fromisocalendar(jahr, kw, 7)
|
||||||
|
locale = get_locale()
|
||||||
|
if locale == 'en':
|
||||||
|
kw_datum = f"{start.strftime('%m/%d/%Y')} to {end.strftime('%m/%d/%Y')}"
|
||||||
|
else:
|
||||||
kw_datum = f"{start.strftime('%d.%m.%Y')} bis {end.strftime('%d.%m.%Y')}"
|
kw_datum = f"{start.strftime('%d.%m.%Y')} bis {end.strftime('%d.%m.%Y')}"
|
||||||
except Exception:
|
except Exception:
|
||||||
kw_datum = 'Ungültige Eingabe'
|
kw_datum = gettext('Ungültige Eingabe')
|
||||||
elif action == 'plusminus':
|
elif action == 'plusminus':
|
||||||
active_idx = 4
|
active_idx = 4
|
||||||
datum = request.form.get('datum_pm')
|
datum = request.form.get('datum_pm')
|
||||||
@@ -137,57 +209,108 @@ def index():
|
|||||||
anzahl_int = int(anzahl)
|
anzahl_int = int(anzahl)
|
||||||
if richtung == 'sub':
|
if richtung == 'sub':
|
||||||
anzahl_int = -anzahl_int
|
anzahl_int = -anzahl_int
|
||||||
|
locale = get_locale()
|
||||||
if einheit == 'tage':
|
if einheit == 'tage':
|
||||||
if is_werktage:
|
if is_werktage:
|
||||||
# Werktage: numpy busday_offset
|
# Werktage: numpy busday_offset
|
||||||
result = np.busday_offset(d.date(), anzahl_int, roll='forward')
|
result = np.busday_offset(d.date(), anzahl_int, roll='forward')
|
||||||
result_dt = datetime.strptime(str(result), '%Y-%m-%d')
|
result_dt = datetime.strptime(str(result), '%Y-%m-%d')
|
||||||
|
if locale == 'en':
|
||||||
|
plusminus_result = f"Date {d.strftime('%m/%d/%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} workdays: {result_dt.strftime('%m/%d/%Y')}"
|
||||||
|
else:
|
||||||
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Werktage: {result_dt.strftime('%d.%m.%Y')}"
|
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Werktage: {result_dt.strftime('%d.%m.%Y')}"
|
||||||
else:
|
else:
|
||||||
result = d + timedelta(days=anzahl_int)
|
result = d + timedelta(days=anzahl_int)
|
||||||
|
if locale == 'en':
|
||||||
|
plusminus_result = f"Date {d.strftime('%m/%d/%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} days: {result.strftime('%m/%d/%Y')}"
|
||||||
|
else:
|
||||||
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Tage: {result.strftime('%d.%m.%Y')}"
|
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Tage: {result.strftime('%d.%m.%Y')}"
|
||||||
elif einheit == 'wochen':
|
elif einheit == 'wochen':
|
||||||
if is_werktage:
|
if is_werktage:
|
||||||
plusminus_result = 'Nicht unterstützt: Werktage + Wochen.'
|
plusminus_result = gettext('Nicht unterstützt: Werktage + Wochen.')
|
||||||
else:
|
else:
|
||||||
result = d + timedelta(weeks=anzahl_int)
|
result = d + timedelta(weeks=anzahl_int)
|
||||||
|
if locale == 'en':
|
||||||
|
plusminus_result = f"Date {d.strftime('%m/%d/%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} weeks: {result.strftime('%m/%d/%Y')}"
|
||||||
|
else:
|
||||||
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Wochen: {result.strftime('%d.%m.%Y')}"
|
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Wochen: {result.strftime('%d.%m.%Y')}"
|
||||||
elif einheit == 'monate':
|
elif einheit == 'monate':
|
||||||
if is_werktage:
|
if is_werktage:
|
||||||
plusminus_result = 'Nicht unterstützt: Werktage + Monate.'
|
plusminus_result = gettext('Nicht unterstützt: Werktage + Monate.')
|
||||||
else:
|
else:
|
||||||
result = d + relativedelta(months=anzahl_int)
|
result = d + relativedelta(months=anzahl_int)
|
||||||
|
if locale == 'en':
|
||||||
|
plusminus_result = f"Date {d.strftime('%m/%d/%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} months: {result.strftime('%m/%d/%Y')}"
|
||||||
|
else:
|
||||||
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Monate: {result.strftime('%d.%m.%Y')}"
|
plusminus_result = f"Datum {d.strftime('%d.%m.%Y')} {'plus' if anzahl_int>=0 else 'minus'} {abs(anzahl_int)} Monate: {result.strftime('%d.%m.%Y')}"
|
||||||
except Exception:
|
except Exception:
|
||||||
plusminus_result = 'Ungültige Eingabe'
|
plusminus_result = gettext('Ungültige Eingabe')
|
||||||
return render_template('index.html', tage=tage, werktage=werktage, wochentag=wochentag, plusminus_result=plusminus_result, kw_berechnen=kw_berechnen, kw_datum=kw_datum, active_idx=active_idx
|
response = make_response(render_template('index.html', tage=tage, wochentag=wochentag, plusminus_result=plusminus_result, kw_berechnen=kw_berechnen, kw_datum=kw_datum, active_idx=active_idx
|
||||||
, feiertage_anzahl=feiertage_anzahl, wochenendtage_anzahl=wochenendtage_anzahl, app_version=APP_VERSION
|
, feiertage_anzahl=feiertage_anzahl, wochenendtage_anzahl=wochenendtage_anzahl, app_version=APP_VERSION, get_locale=get_locale
|
||||||
)
|
))
|
||||||
|
return add_cache_headers(response)
|
||||||
|
|
||||||
|
|
||||||
def parse_log_stats(log_path):
|
def parse_log_stats(log_path):
|
||||||
pageviews = 0
|
pageviews = 0
|
||||||
func_counts = {}
|
func_counts = {}
|
||||||
|
func_counts_hourly = {}
|
||||||
impressions_per_day = {}
|
impressions_per_day = {}
|
||||||
|
impressions_per_hour = {}
|
||||||
api_counts = {}
|
api_counts = {}
|
||||||
|
api_counts_hourly = {}
|
||||||
if os.path.exists(log_path):
|
if os.path.exists(log_path):
|
||||||
with open(log_path, encoding='utf-8') as f:
|
with open(log_path, encoding='utf-8') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if 'PAGEVIEW' in line:
|
if 'PAGEVIEW' in line:
|
||||||
pageviews += 1
|
pageviews += 1
|
||||||
try:
|
try:
|
||||||
date = line[:10]
|
# Parse timestamp (format: YYYY-MM-DDTHH:MM:SS)
|
||||||
|
timestamp = line[:19] # First 19 chars for YYYY-MM-DDTHH:MM:SS
|
||||||
|
date = timestamp[:10] # YYYY-MM-DD
|
||||||
|
hour = timestamp[11:13] # HH
|
||||||
|
|
||||||
if len(date) == 10 and date[4] == '-' and date[7] == '-':
|
if len(date) == 10 and date[4] == '-' and date[7] == '-':
|
||||||
impressions_per_day[date] = impressions_per_day.get(date, 0) + 1
|
impressions_per_day[date] = impressions_per_day.get(date, 0) + 1
|
||||||
|
|
||||||
|
if len(hour) == 2 and hour.isdigit():
|
||||||
|
hour_key = f"{date} {hour}:00"
|
||||||
|
impressions_per_hour[hour_key] = impressions_per_hour.get(hour_key, 0) + 1
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
elif 'FUNC:' in line:
|
elif 'FUNC:' in line:
|
||||||
func = line.split('FUNC:')[1].strip()
|
func = line.split('FUNC:')[1].strip()
|
||||||
func_counts[func] = func_counts.get(func, 0) + 1
|
func_counts[func] = func_counts.get(func, 0) + 1
|
||||||
|
|
||||||
|
# Stündliche Funktionsaufrufe
|
||||||
|
try:
|
||||||
|
timestamp = line[:19]
|
||||||
|
date = timestamp[:10]
|
||||||
|
hour = timestamp[11:13]
|
||||||
|
if len(hour) == 2 and hour.isdigit():
|
||||||
|
hour_key = f"{date} {hour}:00"
|
||||||
|
if hour_key not in func_counts_hourly:
|
||||||
|
func_counts_hourly[hour_key] = {}
|
||||||
|
func_counts_hourly[hour_key][func] = func_counts_hourly[hour_key].get(func, 0) + 1
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
elif 'FUNC_API:' in line:
|
elif 'FUNC_API:' in line:
|
||||||
api = line.split('FUNC_API:')[1].strip()
|
api = line.split('FUNC_API:')[1].strip()
|
||||||
api_counts[api] = api_counts.get(api, 0) + 1
|
api_counts[api] = api_counts.get(api, 0) + 1
|
||||||
return pageviews, func_counts, impressions_per_day, api_counts
|
|
||||||
|
# Stündliche API-Aufrufe
|
||||||
|
try:
|
||||||
|
timestamp = line[:19]
|
||||||
|
date = timestamp[:10]
|
||||||
|
hour = timestamp[11:13]
|
||||||
|
if len(hour) == 2 and hour.isdigit():
|
||||||
|
hour_key = f"{date} {hour}:00"
|
||||||
|
if hour_key not in api_counts_hourly:
|
||||||
|
api_counts_hourly[hour_key] = {}
|
||||||
|
api_counts_hourly[hour_key][api] = api_counts_hourly[hour_key].get(api, 0) + 1
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return pageviews, func_counts, func_counts_hourly, impressions_per_day, impressions_per_hour, api_counts, api_counts_hourly
|
||||||
|
|
||||||
@app.route('/stats', methods=['GET', 'POST'])
|
@app.route('/stats', methods=['GET', 'POST'])
|
||||||
def stats():
|
def stats():
|
||||||
@@ -198,11 +321,17 @@ def stats():
|
|||||||
session['stats_auth'] = True
|
session['stats_auth'] = True
|
||||||
return redirect(url_for('stats'))
|
return redirect(url_for('stats'))
|
||||||
else:
|
else:
|
||||||
return render_template('stats_login.html', error='Falsches Passwort!')
|
response = make_response(render_template('stats_login.html', error='Falsches Passwort!'))
|
||||||
return render_template('stats_login.html', error=None)
|
return add_cache_headers(response)
|
||||||
|
else:
|
||||||
|
response = make_response(render_template('stats_login.html', error=None))
|
||||||
|
return add_cache_headers(response)
|
||||||
|
|
||||||
|
# Wenn authentifiziert, zeige Dashboard
|
||||||
log_path = os.path.join('log', 'pageviews.log')
|
log_path = os.path.join('log', 'pageviews.log')
|
||||||
pageviews, func_counts, impressions_per_day, api_counts = parse_log_stats(log_path)
|
pageviews, func_counts, func_counts_hourly, impressions_per_day, impressions_per_hour, api_counts, api_counts_hourly = parse_log_stats(log_path)
|
||||||
return render_template('stats_dashboard.html', pageviews=pageviews, func_counts=func_counts, impressions_per_day=impressions_per_day, api_counts=api_counts)
|
response = make_response(render_template('stats_dashboard.html', pageviews=pageviews, func_counts=func_counts, func_counts_hourly=func_counts_hourly, impressions_per_day=impressions_per_day, impressions_per_hour=impressions_per_hour, api_counts=api_counts, api_counts_hourly=api_counts_hourly))
|
||||||
|
return add_cache_headers(response)
|
||||||
|
|
||||||
# --- REST API ---
|
# --- REST API ---
|
||||||
def log_api_usage(api_name):
|
def log_api_usage(api_name):
|
||||||
@@ -236,7 +365,8 @@ def api_tage_werktage():
|
|||||||
tage = int(np.busday_count(d1.date(), (d2 + timedelta(days=1)).date(), holidays=holidays))
|
tage = int(np.busday_count(d1.date(), (d2 + timedelta(days=1)).date(), holidays=holidays))
|
||||||
else:
|
else:
|
||||||
tage = abs((d2 - d1).days)
|
tage = abs((d2 - d1).days)
|
||||||
return jsonify({'result': tage})
|
response = jsonify({'result': tage})
|
||||||
|
return add_cache_headers(response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
||||||
|
|
||||||
@@ -247,8 +377,10 @@ def api_wochentag():
|
|||||||
datum = data.get('datum')
|
datum = data.get('datum')
|
||||||
try:
|
try:
|
||||||
d = datetime.strptime(datum, '%Y-%m-%d')
|
d = datetime.strptime(datum, '%Y-%m-%d')
|
||||||
wochentag = WOCHENTAGE[d.weekday()]
|
wochentage = get_wochentage()
|
||||||
return jsonify({'result': wochentag})
|
wochentag = wochentage[d.weekday()]
|
||||||
|
response = jsonify({'result': wochentag})
|
||||||
|
return add_cache_headers(response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
||||||
|
|
||||||
@@ -260,7 +392,13 @@ def api_kw_berechnen():
|
|||||||
try:
|
try:
|
||||||
d = datetime.strptime(datum, '%Y-%m-%d')
|
d = datetime.strptime(datum, '%Y-%m-%d')
|
||||||
kw = d.isocalendar().week
|
kw = d.isocalendar().week
|
||||||
return jsonify({'result': f"KW {kw} ({d.year})", 'kw': kw, 'jahr': d.year})
|
locale = get_locale()
|
||||||
|
if locale == 'en':
|
||||||
|
kw_berechnen = f"Week {kw} ({d.year})"
|
||||||
|
else:
|
||||||
|
kw_berechnen = f"KW {kw} ({d.year})"
|
||||||
|
response = jsonify({'result': kw_berechnen, 'kw': kw, 'jahr': d.year})
|
||||||
|
return add_cache_headers(response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
||||||
|
|
||||||
@@ -275,7 +413,13 @@ def api_kw_datum():
|
|||||||
kw = int(kw)
|
kw = int(kw)
|
||||||
start = datetime.fromisocalendar(jahr, kw, 1)
|
start = datetime.fromisocalendar(jahr, kw, 1)
|
||||||
end = datetime.fromisocalendar(jahr, kw, 7)
|
end = datetime.fromisocalendar(jahr, kw, 7)
|
||||||
return jsonify({'result': f"{start.strftime('%d.%m.%Y')} bis {end.strftime('%d.%m.%Y')}", 'start': start.strftime('%Y-%m-%d'), 'end': end.strftime('%Y-%m-%d')})
|
locale = get_locale()
|
||||||
|
if locale == 'en':
|
||||||
|
kw_datum = f"{start.strftime('%m/%d/%Y')} to {end.strftime('%m/%d/%Y')}"
|
||||||
|
else:
|
||||||
|
kw_datum = f"{start.strftime('%d.%m.%Y')} bis {end.strftime('%d.%m.%Y')}"
|
||||||
|
response = jsonify({'result': kw_datum, 'start': start.strftime('%Y-%m-%d'), 'end': end.strftime('%Y-%m-%d')})
|
||||||
|
return add_cache_headers(response)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
return jsonify({'error': 'Ungültige Eingabe', 'details': str(e)}), 400
|
||||||
|
|
||||||
@@ -293,26 +437,31 @@ def api_plusminus():
|
|||||||
anzahl_int = int(anzahl)
|
anzahl_int = int(anzahl)
|
||||||
if richtung == 'sub':
|
if richtung == 'sub':
|
||||||
anzahl_int = -anzahl_int
|
anzahl_int = -anzahl_int
|
||||||
|
locale = get_locale()
|
||||||
if einheit == 'tage':
|
if einheit == 'tage':
|
||||||
if is_werktage:
|
if is_werktage:
|
||||||
result = np.busday_offset(d.date(), anzahl_int, roll='forward')
|
result = np.busday_offset(d.date(), anzahl_int, roll='forward')
|
||||||
result_dt = datetime.strptime(str(result), '%Y-%m-%d')
|
result_dt = datetime.strptime(str(result), '%Y-%m-%d')
|
||||||
return jsonify({'result': result_dt.strftime('%Y-%m-%d')})
|
response = jsonify({'result': result_dt.strftime('%Y-%m-%d')})
|
||||||
|
return add_cache_headers(response)
|
||||||
else:
|
else:
|
||||||
result = d + timedelta(days=anzahl_int)
|
result = d + timedelta(days=anzahl_int)
|
||||||
return jsonify({'result': result.strftime('%Y-%m-%d')})
|
response = jsonify({'result': result.strftime('%Y-%m-%d')})
|
||||||
|
return add_cache_headers(response)
|
||||||
elif einheit == 'wochen':
|
elif einheit == 'wochen':
|
||||||
if is_werktage:
|
if is_werktage:
|
||||||
return jsonify({'error': 'Nicht unterstützt: Werktage + Wochen.'}), 400
|
return jsonify({'error': 'Nicht unterstützt: Werktage + Wochen.'}), 400
|
||||||
else:
|
else:
|
||||||
result = d + timedelta(weeks=anzahl_int)
|
result = d + timedelta(weeks=anzahl_int)
|
||||||
return jsonify({'result': result.strftime('%Y-%m-%d')})
|
response = jsonify({'result': result.strftime('%Y-%m-%d')})
|
||||||
|
return add_cache_headers(response)
|
||||||
elif einheit == 'monate':
|
elif einheit == 'monate':
|
||||||
if is_werktage:
|
if is_werktage:
|
||||||
return jsonify({'error': 'Nicht unterstützt: Werktage + Monate.'}), 400
|
return jsonify({'error': 'Nicht unterstützt: Werktage + Monate.'}), 400
|
||||||
else:
|
else:
|
||||||
result = d + relativedelta(months=anzahl_int)
|
result = d + relativedelta(months=anzahl_int)
|
||||||
return jsonify({'result': result.strftime('%Y-%m-%d')})
|
response = jsonify({'result': result.strftime('%Y-%m-%d')})
|
||||||
|
return add_cache_headers(response)
|
||||||
else:
|
else:
|
||||||
return jsonify({'error': 'Ungültige Einheit'}), 400
|
return jsonify({'error': 'Ungültige Einheit'}), 400
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -321,8 +470,14 @@ def api_plusminus():
|
|||||||
@app.route('/api/stats', methods=['GET'])
|
@app.route('/api/stats', methods=['GET'])
|
||||||
def api_stats():
|
def api_stats():
|
||||||
log_path = os.path.join('log', 'pageviews.log')
|
log_path = os.path.join('log', 'pageviews.log')
|
||||||
pageviews, func_counts, impressions_per_day, api_counts = parse_log_stats(log_path)
|
pageviews, func_counts, func_counts_hourly, impressions_per_day, impressions_per_hour, api_counts, api_counts_hourly = parse_log_stats(log_path)
|
||||||
return render_template('stats_dashboard.html', pageviews=pageviews, func_counts=func_counts, impressions_per_day=impressions_per_day, api_counts=api_counts)
|
response = jsonify({
|
||||||
|
"pageviews": pageviews,
|
||||||
|
"func_counts": func_counts,
|
||||||
|
"impressions_per_day": impressions_per_day,
|
||||||
|
"api_counts": api_counts
|
||||||
|
})
|
||||||
|
return add_cache_headers(response)
|
||||||
|
|
||||||
@app.route('/api/monitor', methods=['GET'])
|
@app.route('/api/monitor', methods=['GET'])
|
||||||
def api_monitor():
|
def api_monitor():
|
||||||
@@ -334,17 +489,25 @@ def api_monitor():
|
|||||||
if 'PAGEVIEW' in line:
|
if 'PAGEVIEW' in line:
|
||||||
pageviews += 1
|
pageviews += 1
|
||||||
uptime = int(time.time() - app_start_time)
|
uptime = int(time.time() - app_start_time)
|
||||||
return jsonify({
|
response = jsonify({
|
||||||
"status": "ok",
|
"status": "ok",
|
||||||
"message": "App running",
|
"message": "App running",
|
||||||
"time": datetime.now().isoformat(),
|
"time": datetime.now().isoformat(),
|
||||||
"uptime_seconds": uptime,
|
"uptime_seconds": uptime,
|
||||||
"pageviews_last_7_days": pageviews
|
"pageviews_last_7_days": pageviews
|
||||||
})
|
})
|
||||||
|
return add_cache_headers(response)
|
||||||
|
|
||||||
@app.route('/api-docs')
|
@app.route('/api-docs')
|
||||||
def api_docs():
|
def api_docs():
|
||||||
return render_template('swagger.html')
|
response = make_response(render_template('swagger.html'))
|
||||||
|
return add_cache_headers(response)
|
||||||
|
|
||||||
|
@app.route('/sitemap.xml')
|
||||||
|
def sitemap():
|
||||||
|
"""Serviert die Sitemap für Suchmaschinen"""
|
||||||
|
from flask import send_file
|
||||||
|
return send_file('sitemap.xml', mimetype='application/xml')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 57 KiB |
3
babel.cfg
Normal file
3
babel.cfg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[python: **.py]
|
||||||
|
[jinja2: **/templates/**.html]
|
||||||
|
extensions=jinja2.ext.autoescape,jinja2.ext.with_
|
426
bruno/Datecalc.json
Normal file
426
bruno/Datecalc.json
Normal file
@@ -0,0 +1,426 @@
|
|||||||
|
{
|
||||||
|
"name": "Datecalc",
|
||||||
|
"version": "1",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "folder",
|
||||||
|
"name": "localhost",
|
||||||
|
"filename": "localhost",
|
||||||
|
"seq": 2,
|
||||||
|
"root": {
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"name": "localhost",
|
||||||
|
"seq": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "wochentag",
|
||||||
|
"filename": "wochentag.bru",
|
||||||
|
"seq": 5,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "http://localhost:5000/api/wochentag",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"datum\": \"2024-06-10\"\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "kw_berechnen",
|
||||||
|
"filename": "kw_berechnen.bru",
|
||||||
|
"seq": 1,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "http://localhost:5000/api/kw_berechnen",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"datum\": \"2024-06-10\"\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "kw_datum",
|
||||||
|
"filename": "kw_datum.bru",
|
||||||
|
"seq": 3,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "http://localhost:5000/api/kw_datum",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"jahr\": 2024,\n \"kw\": 24\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "plusminus",
|
||||||
|
"filename": "plusminus.bru",
|
||||||
|
"seq": 4,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "http://localhost:5000/api/plusminus",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"datum\": \"2024-06-10\",\n \"anzahl\": 5,\n \"einheit\": \"tage\",\n \"richtung\": \"add\",\n \"werktage\": false\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "tage_werktage",
|
||||||
|
"filename": "tage_werktage.bru",
|
||||||
|
"seq": 2,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "http://localhost:5000/api/tage_werktage",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"start\": \"2024-06-01\",\n \"end\": \"2024-06-10\",\n \"werktage\": true,\n \"bundesland\": \"BY\"\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "folder",
|
||||||
|
"name": "public",
|
||||||
|
"filename": "public",
|
||||||
|
"seq": 2,
|
||||||
|
"root": {
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"name": "public",
|
||||||
|
"seq": 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "kw_berechnen",
|
||||||
|
"filename": "kw_berechnen.bru",
|
||||||
|
"seq": 6,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "https://date.elpatron.me/api/kw_berechnen",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"datum\": \"2024-06-10\"\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "tage_werktage",
|
||||||
|
"filename": "tage_werktage.bru",
|
||||||
|
"seq": 6,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "https://date.elpatron.me/api/tage_werktage",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"start\": \"2024-06-01\",\n \"end\": \"2025-06-10\",\n \"werktage\": true,\n \"bundesland\": \"SH\"\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "kw_datum",
|
||||||
|
"filename": "kw_datum.bru",
|
||||||
|
"seq": 6,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "https://date.elpatron.me/api/kw_datum",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"jahr\": 2024,\n \"kw\": 24\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "plusminus",
|
||||||
|
"filename": "plusminus.bru",
|
||||||
|
"seq": 6,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "https://date.elpatron.me/api/plusminus",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"datum\": \"2024-06-10\",\n \"anzahl\": 5,\n \"einheit\": \"tage\",\n \"richtung\": \"add\",\n \"werktage\": false\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "http",
|
||||||
|
"name": "wochentag",
|
||||||
|
"filename": "wochentag.bru",
|
||||||
|
"seq": 6,
|
||||||
|
"settings": {
|
||||||
|
"encodeUrl": false
|
||||||
|
},
|
||||||
|
"tags": [],
|
||||||
|
"request": {
|
||||||
|
"url": "https://date.elpatron.me/api/wochentag",
|
||||||
|
"method": "POST",
|
||||||
|
"headers": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"params": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "json",
|
||||||
|
"json": "{\n \"datum\": \"2024-06-10\"\n}",
|
||||||
|
"formUrlEncoded": [],
|
||||||
|
"multipartForm": [],
|
||||||
|
"file": []
|
||||||
|
},
|
||||||
|
"script": {},
|
||||||
|
"vars": {},
|
||||||
|
"assertions": [],
|
||||||
|
"tests": "",
|
||||||
|
"docs": "",
|
||||||
|
"auth": {
|
||||||
|
"mode": "inherit"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"environments": [],
|
||||||
|
"brunoConfig": {
|
||||||
|
"version": "1",
|
||||||
|
"name": "Datecalc",
|
||||||
|
"type": "collection",
|
||||||
|
"ignore": [
|
||||||
|
"node_modules",
|
||||||
|
".git"
|
||||||
|
],
|
||||||
|
"size": 0.0014009475708007812,
|
||||||
|
"filesCount": 5
|
||||||
|
}
|
||||||
|
}
|
@@ -1 +1 @@
|
|||||||
@cloc . .\templates\ .\static\ --exclude-dir=.venv,.git,log,__pycache__,.pytest_cache --exclude-ext=txt,bak --md
|
@cloc . .\templates\ .\static\ --exclude-dir=.venv,.git,log,__pycache__,.pytest_cache,lighthouse --exclude-ext=txt,bak --md
|
@@ -1,324 +0,0 @@
|
|||||||
|
|
||||||
SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
|
|
||||||
|
|
||||||
Commands marked with * may be preceded by a number, _N.
|
|
||||||
Notes in parentheses indicate the behavior if _N is given.
|
|
||||||
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
|
|
||||||
|
|
||||||
h H Display this help.
|
|
||||||
q :q Q :Q ZZ Exit.
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
MMOOVVIINNGG
|
|
||||||
|
|
||||||
e ^E j ^N CR * Forward one line (or _N lines).
|
|
||||||
y ^Y k ^K ^P * Backward one line (or _N lines).
|
|
||||||
ESC-j * Forward one file line (or _N file lines).
|
|
||||||
ESC-k * Backward one file line (or _N file lines).
|
|
||||||
f ^F ^V SPACE * Forward one window (or _N lines).
|
|
||||||
b ^B ESC-v * Backward one window (or _N lines).
|
|
||||||
z * Forward one window (and set window to _N).
|
|
||||||
w * Backward one window (and set window to _N).
|
|
||||||
ESC-SPACE * Forward one window, but don't stop at end-of-file.
|
|
||||||
ESC-b * Backward one window, but don't stop at beginning-of-file.
|
|
||||||
d ^D * Forward one half-window (and set half-window to _N).
|
|
||||||
u ^U * Backward one half-window (and set half-window to _N).
|
|
||||||
ESC-) RightArrow * Right one half screen width (or _N positions).
|
|
||||||
ESC-( LeftArrow * Left one half screen width (or _N positions).
|
|
||||||
ESC-} ^RightArrow Right to last column displayed.
|
|
||||||
ESC-{ ^LeftArrow Left to first column.
|
|
||||||
F Forward forever; like "tail -f".
|
|
||||||
ESC-F Like F but stop when search pattern is found.
|
|
||||||
r ^R ^L Repaint screen.
|
|
||||||
R Repaint screen, discarding buffered input.
|
|
||||||
---------------------------------------------------
|
|
||||||
Default "window" is the screen height.
|
|
||||||
Default "half-window" is half of the screen height.
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
SSEEAARRCCHHIINNGG
|
|
||||||
|
|
||||||
/_p_a_t_t_e_r_n * Search forward for (_N-th) matching line.
|
|
||||||
?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line.
|
|
||||||
n * Repeat previous search (for _N-th occurrence).
|
|
||||||
N * Repeat previous search in reverse direction.
|
|
||||||
ESC-n * Repeat previous search, spanning files.
|
|
||||||
ESC-N * Repeat previous search, reverse dir. & spanning files.
|
|
||||||
^O^N ^On * Search forward for (_N-th) OSC8 hyperlink.
|
|
||||||
^O^P ^Op * Search backward for (_N-th) OSC8 hyperlink.
|
|
||||||
^O^L ^Ol Jump to the currently selected OSC8 hyperlink.
|
|
||||||
ESC-u Undo (toggle) search highlighting.
|
|
||||||
ESC-U Clear search highlighting.
|
|
||||||
&_p_a_t_t_e_r_n * Display only matching lines.
|
|
||||||
---------------------------------------------------
|
|
||||||
Search is case-sensitive unless changed with -i or -I.
|
|
||||||
A search pattern may begin with one or more of:
|
|
||||||
^N or ! Search for NON-matching lines.
|
|
||||||
^E or * Search multiple files (pass thru END OF FILE).
|
|
||||||
^F or @ Start search at FIRST file (for /) or last file (for ?).
|
|
||||||
^K Highlight matches, but don't move (KEEP position).
|
|
||||||
^R Don't use REGULAR EXPRESSIONS.
|
|
||||||
^S _n Search for match in _n-th parenthesized subpattern.
|
|
||||||
^W WRAP search if no match found.
|
|
||||||
^L Enter next character literally into pattern.
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
JJUUMMPPIINNGG
|
|
||||||
|
|
||||||
g < ESC-< * Go to first line in file (or line _N).
|
|
||||||
G > ESC-> * Go to last line in file (or line _N).
|
|
||||||
p % * Go to beginning of file (or _N percent into file).
|
|
||||||
t * Go to the (_N-th) next tag.
|
|
||||||
T * Go to the (_N-th) previous tag.
|
|
||||||
{ ( [ * Find close bracket } ) ].
|
|
||||||
} ) ] * Find open bracket { ( [.
|
|
||||||
ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>.
|
|
||||||
ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>.
|
|
||||||
---------------------------------------------------
|
|
||||||
Each "find close bracket" command goes forward to the close bracket
|
|
||||||
matching the (_N-th) open bracket in the top line.
|
|
||||||
Each "find open bracket" command goes backward to the open bracket
|
|
||||||
matching the (_N-th) close bracket in the bottom line.
|
|
||||||
|
|
||||||
m_<_l_e_t_t_e_r_> Mark the current top line with <letter>.
|
|
||||||
M_<_l_e_t_t_e_r_> Mark the current bottom line with <letter>.
|
|
||||||
'_<_l_e_t_t_e_r_> Go to a previously marked position.
|
|
||||||
'' Go to the previous position.
|
|
||||||
^X^X Same as '.
|
|
||||||
ESC-m_<_l_e_t_t_e_r_> Clear a mark.
|
|
||||||
---------------------------------------------------
|
|
||||||
A mark is any upper-case or lower-case letter.
|
|
||||||
Certain marks are predefined:
|
|
||||||
^ means beginning of the file
|
|
||||||
$ means end of the file
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
CCHHAANNGGIINNGG FFIILLEESS
|
|
||||||
|
|
||||||
:e [_f_i_l_e] Examine a new file.
|
|
||||||
^X^V Same as :e.
|
|
||||||
:n * Examine the (_N-th) next file from the command line.
|
|
||||||
:p * Examine the (_N-th) previous file from the command line.
|
|
||||||
:x * Examine the first (or _N-th) file from the command line.
|
|
||||||
^O^O Open the currently selected OSC8 hyperlink.
|
|
||||||
:d Delete the current file from the command line list.
|
|
||||||
= ^G :f Print current file name.
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS
|
|
||||||
|
|
||||||
-_<_f_l_a_g_> Toggle a command line option [see OPTIONS below].
|
|
||||||
--_<_n_a_m_e_> Toggle a command line option, by name.
|
|
||||||
__<_f_l_a_g_> Display the setting of a command line option.
|
|
||||||
___<_n_a_m_e_> Display the setting of an option, by name.
|
|
||||||
+_c_m_d Execute the less cmd each time a new file is examined.
|
|
||||||
|
|
||||||
!_c_o_m_m_a_n_d Execute the shell command with $SHELL.
|
|
||||||
#_c_o_m_m_a_n_d Execute the shell command, expanded like a prompt.
|
|
||||||
|XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command.
|
|
||||||
s _f_i_l_e Save input to a file.
|
|
||||||
v Edit the current file with $VISUAL or $EDITOR.
|
|
||||||
V Print version number of "less".
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
OOPPTTIIOONNSS
|
|
||||||
|
|
||||||
Most options may be changed either on the command line,
|
|
||||||
or from within less by using the - or -- command.
|
|
||||||
Options may be given in one of two forms: either a single
|
|
||||||
character preceded by a -, or a name preceded by --.
|
|
||||||
|
|
||||||
-? ........ --help
|
|
||||||
Display help (from command line).
|
|
||||||
-a ........ --search-skip-screen
|
|
||||||
Search skips current screen.
|
|
||||||
-A ........ --SEARCH-SKIP-SCREEN
|
|
||||||
Search starts just after target line.
|
|
||||||
-b [_N] .... --buffers=[_N]
|
|
||||||
Number of buffers.
|
|
||||||
-B ........ --auto-buffers
|
|
||||||
Don't automatically allocate buffers for pipes.
|
|
||||||
-c ........ --clear-screen
|
|
||||||
Repaint by clearing rather than scrolling.
|
|
||||||
-d ........ --dumb
|
|
||||||
Dumb terminal.
|
|
||||||
-D xx_c_o_l_o_r . --color=xx_c_o_l_o_r
|
|
||||||
Set screen colors.
|
|
||||||
-e -E .... --quit-at-eof --QUIT-AT-EOF
|
|
||||||
Quit at end of file.
|
|
||||||
-f ........ --force
|
|
||||||
Force open non-regular files.
|
|
||||||
-F ........ --quit-if-one-screen
|
|
||||||
Quit if entire file fits on first screen.
|
|
||||||
-g ........ --hilite-search
|
|
||||||
Highlight only last match for searches.
|
|
||||||
-G ........ --HILITE-SEARCH
|
|
||||||
Don't highlight any matches for searches.
|
|
||||||
-h [_N] .... --max-back-scroll=[_N]
|
|
||||||
Backward scroll limit.
|
|
||||||
-i ........ --ignore-case
|
|
||||||
Ignore case in searches that do not contain uppercase.
|
|
||||||
-I ........ --IGNORE-CASE
|
|
||||||
Ignore case in all searches.
|
|
||||||
-j [_N] .... --jump-target=[_N]
|
|
||||||
Screen position of target lines.
|
|
||||||
-J ........ --status-column
|
|
||||||
Display a status column at left edge of screen.
|
|
||||||
-k _f_i_l_e ... --lesskey-file=_f_i_l_e
|
|
||||||
Use a compiled lesskey file.
|
|
||||||
-K ........ --quit-on-intr
|
|
||||||
Exit less in response to ctrl-C.
|
|
||||||
-L ........ --no-lessopen
|
|
||||||
Ignore the LESSOPEN environment variable.
|
|
||||||
-m -M .... --long-prompt --LONG-PROMPT
|
|
||||||
Set prompt style.
|
|
||||||
-n ......... --line-numbers
|
|
||||||
Suppress line numbers in prompts and messages.
|
|
||||||
-N ......... --LINE-NUMBERS
|
|
||||||
Display line number at start of each line.
|
|
||||||
-o [_f_i_l_e] .. --log-file=[_f_i_l_e]
|
|
||||||
Copy to log file (standard input only).
|
|
||||||
-O [_f_i_l_e] .. --LOG-FILE=[_f_i_l_e]
|
|
||||||
Copy to log file (unconditionally overwrite).
|
|
||||||
-p _p_a_t_t_e_r_n . --pattern=[_p_a_t_t_e_r_n]
|
|
||||||
Start at pattern (from command line).
|
|
||||||
-P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t]
|
|
||||||
Define new prompt.
|
|
||||||
-q -Q .... --quiet --QUIET --silent --SILENT
|
|
||||||
Quiet the terminal bell.
|
|
||||||
-r -R .... --raw-control-chars --RAW-CONTROL-CHARS
|
|
||||||
Output "raw" control characters.
|
|
||||||
-s ........ --squeeze-blank-lines
|
|
||||||
Squeeze multiple blank lines.
|
|
||||||
-S ........ --chop-long-lines
|
|
||||||
Chop (truncate) long lines rather than wrapping.
|
|
||||||
-t _t_a_g .... --tag=[_t_a_g]
|
|
||||||
Find a tag.
|
|
||||||
-T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e]
|
|
||||||
Use an alternate tags file.
|
|
||||||
-u -U .... --underline-special --UNDERLINE-SPECIAL
|
|
||||||
Change handling of backspaces, tabs and carriage returns.
|
|
||||||
-V ........ --version
|
|
||||||
Display the version number of "less".
|
|
||||||
-w ........ --hilite-unread
|
|
||||||
Highlight first new line after forward-screen.
|
|
||||||
-W ........ --HILITE-UNREAD
|
|
||||||
Highlight first new line after any forward movement.
|
|
||||||
-x [_N[,...]] --tabs=[_N[,...]]
|
|
||||||
Set tab stops.
|
|
||||||
-X ........ --no-init
|
|
||||||
Don't use termcap init/deinit strings.
|
|
||||||
-y [_N] .... --max-forw-scroll=[_N]
|
|
||||||
Forward scroll limit.
|
|
||||||
-z [_N] .... --window=[_N]
|
|
||||||
Set size of window.
|
|
||||||
-" [_c[_c]] . --quotes=[_c[_c]]
|
|
||||||
Set shell quote characters.
|
|
||||||
-~ ........ --tilde
|
|
||||||
Don't display tildes after end of file.
|
|
||||||
-# [_N] .... --shift=[_N]
|
|
||||||
Set horizontal scroll amount (0 = one half screen width).
|
|
||||||
|
|
||||||
--exit-follow-on-close
|
|
||||||
Exit F command on a pipe when writer closes pipe.
|
|
||||||
--file-size
|
|
||||||
Automatically determine the size of the input file.
|
|
||||||
--follow-name
|
|
||||||
The F command changes files if the input file is renamed.
|
|
||||||
--form-feed
|
|
||||||
Stop scrolling when a form feed character is reached.
|
|
||||||
--header=[_L[,_C[,_N]]]
|
|
||||||
Use _L lines (starting at line _N) and _C columns as headers.
|
|
||||||
--incsearch
|
|
||||||
Search file as each pattern character is typed in.
|
|
||||||
--intr=[_C]
|
|
||||||
Use _C instead of ^X to interrupt a read.
|
|
||||||
--lesskey-context=_t_e_x_t
|
|
||||||
Use lesskey source file contents.
|
|
||||||
--lesskey-src=_f_i_l_e
|
|
||||||
Use a lesskey source file.
|
|
||||||
--line-num-width=[_N]
|
|
||||||
Set the width of the -N line number field to _N characters.
|
|
||||||
--match-shift=[_N]
|
|
||||||
Show at least _N characters to the left of a search match.
|
|
||||||
--modelines=[_N]
|
|
||||||
Read _N lines from the input file and look for vim modelines.
|
|
||||||
--mouse
|
|
||||||
Enable mouse input.
|
|
||||||
--no-edit-warn
|
|
||||||
Don't warn when using v command on a file opened via LESSOPEN.
|
|
||||||
--no-keypad
|
|
||||||
Don't send termcap keypad init/deinit strings.
|
|
||||||
--no-histdups
|
|
||||||
Remove duplicates from command history.
|
|
||||||
--no-number-headers
|
|
||||||
Don't give line numbers to header lines.
|
|
||||||
--no-paste
|
|
||||||
Ignore pasted input.
|
|
||||||
--no-search-header-lines
|
|
||||||
Searches do not include header lines.
|
|
||||||
--no-search-header-columns
|
|
||||||
Searches do not include header columns.
|
|
||||||
--no-search-headers
|
|
||||||
Searches do not include header lines or columns.
|
|
||||||
--no-vbell
|
|
||||||
Disable the terminal's visual bell.
|
|
||||||
--redraw-on-quit
|
|
||||||
Redraw final screen when quitting.
|
|
||||||
--rscroll=[_C]
|
|
||||||
Set the character used to mark truncated lines.
|
|
||||||
--save-marks
|
|
||||||
Retain marks across invocations of less.
|
|
||||||
--search-options=[EFKNRW-]
|
|
||||||
Set default options for every search.
|
|
||||||
--show-preproc-errors
|
|
||||||
Display a message if preprocessor exits with an error status.
|
|
||||||
--proc-backspace
|
|
||||||
Process backspaces for bold/underline.
|
|
||||||
--PROC-BACKSPACE
|
|
||||||
Treat backspaces as control characters.
|
|
||||||
--proc-return
|
|
||||||
Delete carriage returns before newline.
|
|
||||||
--PROC-RETURN
|
|
||||||
Treat carriage returns as control characters.
|
|
||||||
--proc-tab
|
|
||||||
Expand tabs to spaces.
|
|
||||||
--PROC-TAB
|
|
||||||
Treat tabs as control characters.
|
|
||||||
--status-col-width=[_N]
|
|
||||||
Set the width of the -J status column to _N characters.
|
|
||||||
--status-line
|
|
||||||
Highlight or color the entire line containing a mark.
|
|
||||||
--use-backslash
|
|
||||||
Subsequent options use backslash as escape char.
|
|
||||||
--use-color
|
|
||||||
Enables colored text.
|
|
||||||
--wheel-lines=[_N]
|
|
||||||
Each click of the mouse wheel moves _N lines.
|
|
||||||
--wordwrap
|
|
||||||
Wrap lines at spaces.
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
LLIINNEE EEDDIITTIINNGG
|
|
||||||
|
|
||||||
These keys can be used to edit text being entered
|
|
||||||
on the "command line" at the bottom of the screen.
|
|
||||||
|
|
||||||
RightArrow ..................... ESC-l ... Move cursor right one character.
|
|
||||||
LeftArrow ...................... ESC-h ... Move cursor left one character.
|
|
||||||
ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word.
|
|
||||||
ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word.
|
|
||||||
HOME ........................... ESC-0 ... Move cursor to start of line.
|
|
||||||
END ............................ ESC-$ ... Move cursor to end of line.
|
|
||||||
BACKSPACE ................................ Delete char to left of cursor.
|
|
||||||
DELETE ......................... ESC-x ... Delete char under cursor.
|
|
||||||
ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor.
|
|
||||||
ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor.
|
|
||||||
ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line.
|
|
||||||
UpArrow ........................ ESC-k ... Retrieve previous command line.
|
|
||||||
DownArrow ...................... ESC-j ... Retrieve next command line.
|
|
||||||
TAB ...................................... Complete filename & cycle.
|
|
||||||
SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle.
|
|
||||||
ctrl-L ................................... Complete filename, list all.
|
|
138
i18n_implementation.md
Normal file
138
i18n_implementation.md
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
# Internationalisierung (i18n) Implementierung
|
||||||
|
|
||||||
|
## Übersicht
|
||||||
|
|
||||||
|
Die Internationalisierung wurde erfolgreich in Elpatrons Datumsrechner implementiert. Das System unterstützt derzeit Deutsch (Standard) und Englisch.
|
||||||
|
|
||||||
|
## Implementierte Funktionen
|
||||||
|
|
||||||
|
### 1. Flask-Babel Integration
|
||||||
|
- **Flask-Babel 4.0.0** für Übersetzungsverwaltung
|
||||||
|
- **Babel 2.17.0** für Übersetzungskompilierung
|
||||||
|
- **Automatische Spracherkennung** basierend auf Browser-Einstellungen
|
||||||
|
- **Session-basierte Sprachauswahl** für Benutzer
|
||||||
|
|
||||||
|
### 2. Sprachauswahl
|
||||||
|
- **DE/EN Toggle** in der oberen linken Ecke
|
||||||
|
- **Visueller Indikator** für aktive Sprache
|
||||||
|
- **Persistente Sprachauswahl** über Session
|
||||||
|
|
||||||
|
### 3. Übersetzungsdateien
|
||||||
|
- **Deutsche Übersetzungen**: `translations/de/LC_MESSAGES/messages.po`
|
||||||
|
- **Englische Übersetzungen**: `translations/en/LC_MESSAGES/messages.po`
|
||||||
|
- **Kompilierte .mo Dateien** für optimale Performance
|
||||||
|
|
||||||
|
### 4. Übersetzte Inhalte
|
||||||
|
|
||||||
|
#### Meta-Tags
|
||||||
|
- Titel und Beschreibung
|
||||||
|
- Open Graph Tags
|
||||||
|
- Keywords
|
||||||
|
|
||||||
|
#### UI-Elemente
|
||||||
|
- Haupttitel und Untertitel
|
||||||
|
- Formular-Labels
|
||||||
|
- Button-Texte
|
||||||
|
- Hilfe-Texte
|
||||||
|
- Footer-Links
|
||||||
|
|
||||||
|
#### Dynamische Inhalte
|
||||||
|
- Wochentage (Deutsch/Englisch)
|
||||||
|
- Kalenderwochen-Format
|
||||||
|
- Datumsformate (DD.MM.YYYY vs MM/DD/YYYY)
|
||||||
|
- Fehlermeldungen
|
||||||
|
|
||||||
|
### 5. Technische Details
|
||||||
|
|
||||||
|
#### App-Konfiguration
|
||||||
|
```python
|
||||||
|
app.config['BABEL_DEFAULT_LOCALE'] = 'de'
|
||||||
|
app.config['BABEL_SUPPORTED_LOCALES'] = ['de', 'en']
|
||||||
|
app.config['BABEL_TRANSLATION_DIRECTORIES'] = 'translations'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Sprachauswahl-Funktion
|
||||||
|
```python
|
||||||
|
@app.route('/set_language/<language>')
|
||||||
|
def set_language(language):
|
||||||
|
if language in ['de', 'en']:
|
||||||
|
session['language'] = language
|
||||||
|
return redirect(request.referrer or url_for('index'))
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Locale-Selector
|
||||||
|
```python
|
||||||
|
@babel.localeselector
|
||||||
|
def get_locale():
|
||||||
|
if 'language' in session:
|
||||||
|
return session['language']
|
||||||
|
return request.accept_languages.best_match(['de', 'en'], default='de')
|
||||||
|
```
|
||||||
|
|
||||||
|
## Verzeichnisstruktur
|
||||||
|
|
||||||
|
```
|
||||||
|
translations/
|
||||||
|
├── de/
|
||||||
|
│ └── LC_MESSAGES/
|
||||||
|
│ ├── messages.po
|
||||||
|
│ └── messages.mo
|
||||||
|
└── en/
|
||||||
|
└── LC_MESSAGES/
|
||||||
|
├── messages.po
|
||||||
|
└── messages.mo
|
||||||
|
```
|
||||||
|
|
||||||
|
## Verwendung
|
||||||
|
|
||||||
|
### Für Entwickler
|
||||||
|
|
||||||
|
1. **Neue Texte hinzufügen**:
|
||||||
|
```html
|
||||||
|
{{ _('Neuer Text') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Übersetzungen extrahieren**:
|
||||||
|
```bash
|
||||||
|
pybabel extract -F babel.cfg -k _l -o messages.pot .
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Neue Übersetzungsdatei erstellen**:
|
||||||
|
```bash
|
||||||
|
pybabel init -i messages.pot -d translations -l en
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Übersetzungen kompilieren**:
|
||||||
|
```bash
|
||||||
|
pybabel compile -d translations
|
||||||
|
```
|
||||||
|
|
||||||
|
### Für Benutzer
|
||||||
|
|
||||||
|
- **Sprachauswahl**: Klick auf DE/EN in der oberen linken Ecke
|
||||||
|
- **Automatische Erkennung**: Browser-Sprache wird automatisch erkannt
|
||||||
|
- **Persistenz**: Sprachauswahl bleibt über Session erhalten
|
||||||
|
|
||||||
|
## Nächste Schritte
|
||||||
|
|
||||||
|
1. **Weitere Sprachen hinzufügen** (z.B. Französisch, Spanisch)
|
||||||
|
2. **Pluralisierung** für verschiedene Sprachen implementieren
|
||||||
|
3. **Dynamische Übersetzungen** für API-Responses
|
||||||
|
4. **RTL-Sprachen** unterstützen (Arabisch, Hebräisch)
|
||||||
|
|
||||||
|
## Dateien
|
||||||
|
|
||||||
|
- `app.py`: Hauptanwendung mit i18n-Integration
|
||||||
|
- `babel.cfg`: Babel-Konfiguration
|
||||||
|
- `requirements.txt`: Flask-Babel Abhängigkeit
|
||||||
|
- `templates/index.html`: Übersetzte UI-Templates
|
||||||
|
- `translations/`: Übersetzungsdateien
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
✅ **Vollständig implementiert und funktionsfähig**
|
||||||
|
- Deutsche und englische Übersetzungen
|
||||||
|
- Sprachauswahl-UI
|
||||||
|
- Automatische Spracherkennung
|
||||||
|
- Session-basierte Persistenz
|
||||||
|
- Kompilierte Übersetzungen für Performance
|
8
idea.txt
8
idea.txt
@@ -1,8 +0,0 @@
|
|||||||
erstelle eine python web app, die verschiedene datumsberechnungen durchführt:
|
|
||||||
- Berechnung der Anzahl der Tage zwischen zwei Daten
|
|
||||||
- Berechnung der Anzahl der Werktage zwischen zwei Daten
|
|
||||||
- Anzeige des Wochentags eines Datums
|
|
||||||
|
|
||||||
Beachte:
|
|
||||||
- Virtual Environment unter ./.venv
|
|
||||||
- Wir entwickeln unter Windows
|
|
Binary file not shown.
8681
lighthouse/127.0.0.1_5000-20250801T164519.json
Normal file
8681
lighthouse/127.0.0.1_5000-20250801T164519.json
Normal file
File diff suppressed because one or more lines are too long
8813
lighthouse/date.elpatron.me-20250801T144830.json
Normal file
8813
lighthouse/date.elpatron.me-20250801T144830.json
Normal file
File diff suppressed because one or more lines are too long
BIN
lighthouse/lighthouse-score.pdf
Normal file
BIN
lighthouse/lighthouse-score.pdf
Normal file
Binary file not shown.
@@ -1,5 +1,6 @@
|
|||||||
Flask==3.0.3
|
Flask==3.1.1
|
||||||
numpy==1.26.4
|
numpy==2.3.2
|
||||||
python-dateutil==2.9.0.post0
|
python-dateutil==2.9.0.post0
|
||||||
pytest==8.2.2
|
requests==2.32.4
|
||||||
requests
|
Flask-Babel==4.0.0
|
||||||
|
pytest==8.4.1
|
12
robots.txt
12
robots.txt
@@ -1,2 +1,14 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
Allow: /
|
Allow: /
|
||||||
|
|
||||||
|
# Sitemap
|
||||||
|
Sitemap: https://date.elpatron.me/sitemap.xml
|
||||||
|
|
||||||
|
# Disallow private areas
|
||||||
|
Disallow: /stats
|
||||||
|
Disallow: /log/
|
||||||
|
Disallow: /htmlcov/
|
||||||
|
|
||||||
|
# Allow API endpoints for documentation
|
||||||
|
Allow: /api-docs
|
||||||
|
Allow: /static/swagger.json
|
83
sitemap.xml
Normal file
83
sitemap.xml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<!-- Hauptseite -->
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<!-- API-Dokumentation -->
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/api-docs</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<!-- Statische Ressourcen -->
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/favicon.ico</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>yearly</changefreq>
|
||||||
|
<priority>0.1</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/favicon.png</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>yearly</changefreq>
|
||||||
|
<priority>0.1</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/favicon.svg</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>yearly</changefreq>
|
||||||
|
<priority>0.1</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/logo.svg</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>yearly</changefreq>
|
||||||
|
<priority>0.1</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/manifest.json</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.3</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/service-worker.js</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.3</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/static/swagger.json</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>monthly</changefreq>
|
||||||
|
<priority>0.5</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<!-- Sprachversionen der Hauptseite -->
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/?lang=de</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.9</priority>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
<url>
|
||||||
|
<loc>https://date.elpatron.me/?lang=en</loc>
|
||||||
|
<lastmod>2025-08-03</lastmod>
|
||||||
|
<changefreq>weekly</changefreq>
|
||||||
|
<priority>0.9</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
@@ -1,15 +1,25 @@
|
|||||||
const CACHE_NAME = 'datumsrechner-cache-v1';
|
const CACHE_NAME = 'datumsrechner-cache-v1';
|
||||||
const urlsToCache = [
|
const urlsToCache = [
|
||||||
'/',
|
'/',
|
||||||
'/static/style.css',
|
|
||||||
'/static/favicon.ico',
|
'/static/favicon.ico',
|
||||||
'/static/favicon.png',
|
'/static/favicon.png',
|
||||||
|
'/static/favicon.svg',
|
||||||
'/static/logo.svg',
|
'/static/logo.svg',
|
||||||
|
'/static/manifest.json',
|
||||||
];
|
];
|
||||||
self.addEventListener('install', event => {
|
self.addEventListener('install', event => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(CACHE_NAME)
|
caches.open(CACHE_NAME)
|
||||||
.then(cache => cache.addAll(urlsToCache))
|
.then(cache => {
|
||||||
|
// Füge nur existierende Dateien zum Cache hinzu
|
||||||
|
return Promise.allSettled(
|
||||||
|
urlsToCache.map(url =>
|
||||||
|
cache.add(url).catch(err => {
|
||||||
|
console.log('Failed to cache:', url, err);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
self.addEventListener('fetch', event => {
|
self.addEventListener('fetch', event => {
|
||||||
|
1060
templates/index.html
1060
templates/index.html
File diff suppressed because it is too large
Load Diff
@@ -19,6 +19,32 @@
|
|||||||
.stats-label { color: #64748b; }
|
.stats-label { color: #64748b; }
|
||||||
.stats-value { font-size: 1.5em; font-weight: bold; }
|
.stats-value { font-size: 1.5em; font-weight: bold; }
|
||||||
.chart-container { margin: 2em 0; }
|
.chart-container { margin: 2em 0; }
|
||||||
|
.toggle-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 1.5em;
|
||||||
|
gap: 0.5em;
|
||||||
|
}
|
||||||
|
.toggle-btn {
|
||||||
|
padding: 0.5em 1em;
|
||||||
|
border: 1px solid #d1d5db;
|
||||||
|
background: #f9fafb;
|
||||||
|
color: #6b7280;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s;
|
||||||
|
}
|
||||||
|
.toggle-btn.active {
|
||||||
|
background: #2563eb;
|
||||||
|
color: white;
|
||||||
|
border-color: #2563eb;
|
||||||
|
}
|
||||||
|
.toggle-btn:hover {
|
||||||
|
background: #e5e7eb;
|
||||||
|
}
|
||||||
|
.toggle-btn.active:hover {
|
||||||
|
background: #1d4ed8;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -28,6 +54,12 @@
|
|||||||
<div class="stats-label">Gesamt-Pageviews (7 Tage):</div>
|
<div class="stats-label">Gesamt-Pageviews (7 Tage):</div>
|
||||||
<div class="stats-value">{{ pageviews }}</div>
|
<div class="stats-value">{{ pageviews }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="toggle-container">
|
||||||
|
<button class="toggle-btn active" data-period="week">Wochenverlauf</button>
|
||||||
|
<button class="toggle-btn" data-period="day">24-Stunden-Verlauf</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="chart-container">
|
<div class="chart-container">
|
||||||
<canvas id="imprChart" width="400" height="180"></canvas>
|
<canvas id="imprChart" width="400" height="180"></canvas>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,18 +75,59 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
// Impressions pro Tag
|
// Daten für verschiedene Zeiträume
|
||||||
// eslint-disable-next-line
|
const weekData = {{ impressions_per_day|tojson }};
|
||||||
const imprData = {{ impressions_per_day|tojson }};
|
const dayData = {{ impressions_per_hour|tojson }};
|
||||||
const imprLabels = Object.keys(imprData);
|
const weekFuncData = {{ func_counts|tojson }};
|
||||||
const imprCounts = Object.values(imprData);
|
const dayFuncData = {{ func_counts_hourly|tojson }};
|
||||||
new Chart(document.getElementById('imprChart').getContext('2d'), {
|
const weekApiData = {{ api_counts|tojson }};
|
||||||
|
const dayApiData = {{ api_counts_hourly|tojson }};
|
||||||
|
|
||||||
|
let currentPeriod = 'week';
|
||||||
|
let currentImprChart = null;
|
||||||
|
let currentFuncChart = null;
|
||||||
|
let currentApiChart = null;
|
||||||
|
|
||||||
|
// Toggle-Buttons Event Listener
|
||||||
|
document.querySelectorAll('.toggle-btn').forEach(btn => {
|
||||||
|
btn.addEventListener('click', function() {
|
||||||
|
// Aktiven Button aktualisieren
|
||||||
|
document.querySelectorAll('.toggle-btn').forEach(b => b.classList.remove('active'));
|
||||||
|
this.classList.add('active');
|
||||||
|
|
||||||
|
// Zeitraum wechseln
|
||||||
|
currentPeriod = this.dataset.period;
|
||||||
|
updateAllCharts();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function updateImpressionsChart() {
|
||||||
|
const ctx = document.getElementById('imprChart').getContext('2d');
|
||||||
|
|
||||||
|
// Bestehenden Chart zerstören
|
||||||
|
if (currentImprChart) {
|
||||||
|
currentImprChart.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
let data, labels, counts;
|
||||||
|
|
||||||
|
if (currentPeriod === 'week') {
|
||||||
|
data = weekData;
|
||||||
|
labels = Object.keys(data);
|
||||||
|
counts = Object.values(data);
|
||||||
|
} else {
|
||||||
|
data = dayData;
|
||||||
|
labels = Object.keys(data);
|
||||||
|
counts = Object.values(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentImprChart = new Chart(ctx, {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
labels: imprLabels,
|
labels: labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Impressions/Tag',
|
label: currentPeriod === 'week' ? 'Impressions/Tag' : 'Impressions/Stunde',
|
||||||
data: imprCounts,
|
data: counts,
|
||||||
borderColor: '#059669',
|
borderColor: '#059669',
|
||||||
backgroundColor: 'rgba(5,150,105,0.1)',
|
backgroundColor: 'rgba(5,150,105,0.1)',
|
||||||
tension: 0.2,
|
tension: 0.2,
|
||||||
@@ -62,56 +135,136 @@
|
|||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
plugins: { legend: { display: true } },
|
plugins: {
|
||||||
|
legend: { display: true },
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: currentPeriod === 'week' ? 'Wochenverlauf' : '24-Stunden-Verlauf'
|
||||||
|
}
|
||||||
|
},
|
||||||
scales: {
|
scales: {
|
||||||
y: { beginAtZero: true, ticks: { stepSize: 1 } }
|
y: { beginAtZero: true, ticks: { stepSize: 1 } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Funktionsaufrufe
|
}
|
||||||
// eslint-disable-next-line
|
|
||||||
const funcCounts = {{ func_counts|tojson }};
|
function updateFunctionChart() {
|
||||||
const labels = Object.keys(funcCounts);
|
const ctx = document.getElementById('funcChart').getContext('2d');
|
||||||
const data = Object.values(funcCounts);
|
|
||||||
new Chart(document.getElementById('funcChart').getContext('2d'), {
|
// Bestehenden Chart zerstören
|
||||||
|
if (currentFuncChart) {
|
||||||
|
currentFuncChart.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
let data, labels, counts;
|
||||||
|
|
||||||
|
if (currentPeriod === 'week') {
|
||||||
|
data = weekFuncData;
|
||||||
|
labels = Object.keys(data);
|
||||||
|
counts = Object.values(data);
|
||||||
|
} else {
|
||||||
|
// Für stündliche Daten: Summe aller Stunden für jede Funktion
|
||||||
|
const aggregatedData = {};
|
||||||
|
Object.values(dayFuncData).forEach(hourData => {
|
||||||
|
Object.keys(hourData).forEach(func => {
|
||||||
|
aggregatedData[func] = (aggregatedData[func] || 0) + hourData[func];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
data = aggregatedData;
|
||||||
|
labels = Object.keys(data);
|
||||||
|
counts = Object.values(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
currentFuncChart = new Chart(ctx, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
labels: labels,
|
labels: labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'Funktionsaufrufe',
|
label: 'Funktionsaufrufe',
|
||||||
data: data,
|
data: counts,
|
||||||
backgroundColor: '#2563eb',
|
backgroundColor: '#2563eb',
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
plugins: { legend: { display: false } },
|
plugins: {
|
||||||
|
legend: { display: false },
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: currentPeriod === 'week' ? 'Funktionsaufrufe (Woche)' : 'Funktionsaufrufe (24h)'
|
||||||
|
}
|
||||||
|
},
|
||||||
scales: {
|
scales: {
|
||||||
y: { beginAtZero: true, ticks: { stepSize: 1 } }
|
y: { beginAtZero: true, ticks: { stepSize: 1 } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// API-Nutzung
|
}
|
||||||
// eslint-disable-next-line
|
|
||||||
const apiCounts = {{ api_counts|tojson }};
|
function updateApiChart() {
|
||||||
if (Object.keys(apiCounts).length > 0 && document.getElementById('apiChart')) {
|
const apiChartElement = document.getElementById('apiChart');
|
||||||
new Chart(document.getElementById('apiChart').getContext('2d'), {
|
if (!apiChartElement) return;
|
||||||
|
|
||||||
|
const ctx = apiChartElement.getContext('2d');
|
||||||
|
|
||||||
|
// Bestehenden Chart zerstören
|
||||||
|
if (currentApiChart) {
|
||||||
|
currentApiChart.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
let data, labels, counts;
|
||||||
|
|
||||||
|
if (currentPeriod === 'week') {
|
||||||
|
data = weekApiData;
|
||||||
|
} else {
|
||||||
|
// Für stündliche Daten: Summe aller Stunden für jede API
|
||||||
|
const aggregatedData = {};
|
||||||
|
Object.values(dayApiData).forEach(hourData => {
|
||||||
|
Object.keys(hourData).forEach(api => {
|
||||||
|
aggregatedData[api] = (aggregatedData[api] || 0) + hourData[api];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
data = aggregatedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Object.keys(data).length === 0) return;
|
||||||
|
|
||||||
|
labels = Object.keys(data);
|
||||||
|
counts = Object.values(data);
|
||||||
|
|
||||||
|
currentApiChart = new Chart(ctx, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
labels: Object.keys(apiCounts),
|
labels: labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'API-Aufrufe nach Endpunkt',
|
label: 'API-Aufrufe nach Endpunkt',
|
||||||
data: Object.values(apiCounts),
|
data: counts,
|
||||||
backgroundColor: '#f59e42',
|
backgroundColor: '#f59e42',
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
plugins: { legend: { display: false } },
|
plugins: {
|
||||||
|
legend: { display: false },
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: currentPeriod === 'week' ? 'API-Nutzung (Woche)' : 'API-Nutzung (24h)'
|
||||||
|
}
|
||||||
|
},
|
||||||
scales: {
|
scales: {
|
||||||
y: { beginAtZero: true, ticks: { stepSize: 1 } }
|
y: { beginAtZero: true, ticks: { stepSize: 1 } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateAllCharts() {
|
||||||
|
updateImpressionsChart();
|
||||||
|
updateFunctionChart();
|
||||||
|
updateApiChart();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initial Charts erstellen
|
||||||
|
updateAllCharts();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
145
test_app.py
145
test_app.py
@@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
from app import app as flask_app
|
from app import app as flask_app
|
||||||
|
from unittest.mock import patch, MagicMock
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def client():
|
def client():
|
||||||
@@ -221,7 +222,10 @@ def test_api_stats(client):
|
|||||||
resp = client.get('/api/stats')
|
resp = client.get('/api/stats')
|
||||||
assert resp.status_code == 200
|
assert resp.status_code == 200
|
||||||
data = resp.get_json()
|
data = resp.get_json()
|
||||||
assert 'pageviews' in data and 'func_counts' in data and 'impressions_per_day' in data
|
assert "pageviews" in data
|
||||||
|
assert "func_counts" in data
|
||||||
|
assert "impressions_per_day" in data
|
||||||
|
assert "api_counts" in data
|
||||||
|
|
||||||
def test_api_monitor(client):
|
def test_api_monitor(client):
|
||||||
resp = client.get('/api/monitor')
|
resp = client.get('/api/monitor')
|
||||||
@@ -229,3 +233,142 @@ def test_api_monitor(client):
|
|||||||
data = resp.get_json()
|
data = resp.get_json()
|
||||||
assert data['status'] == 'ok'
|
assert data['status'] == 'ok'
|
||||||
assert 'uptime_seconds' in data
|
assert 'uptime_seconds' in data
|
||||||
|
|
||||||
|
# Neue Tests für bessere Coverage
|
||||||
|
|
||||||
|
def test_feiertage_api_error(client):
|
||||||
|
"""Test Fehlerbehandlung bei Feiertage-API"""
|
||||||
|
with patch('app.requests.get') as mock_get:
|
||||||
|
mock_get.side_effect = Exception("Network error")
|
||||||
|
resp = client.post('/', data={
|
||||||
|
'action': 'tage_werktage',
|
||||||
|
'start1': '2024-01-01',
|
||||||
|
'end1': '2024-01-10',
|
||||||
|
'bundesland': 'BY'
|
||||||
|
})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
|
||||||
|
def test_logging_error_handling(client):
|
||||||
|
"""Test Logging-Fehlerbehandlung"""
|
||||||
|
# Test ohne Mock, da die App das Logging-Handling bereits hat
|
||||||
|
resp = client.get('/')
|
||||||
|
assert resp.status_code == 200
|
||||||
|
|
||||||
|
def test_invalid_date_handling(client):
|
||||||
|
"""Test ungültige Datumseingaben"""
|
||||||
|
# Ungültiges Datum bei tage_werktage
|
||||||
|
resp = client.post('/', data={
|
||||||
|
'action': 'tage_werktage',
|
||||||
|
'start1': 'invalid-date',
|
||||||
|
'end1': '2024-01-10'
|
||||||
|
})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
html = resp.data.decode('utf-8')
|
||||||
|
assert 'Ungültige Eingabe' in html
|
||||||
|
|
||||||
|
def test_invalid_wochentag_input(client):
|
||||||
|
"""Test ungültige Eingaben bei Wochentag-Berechnung"""
|
||||||
|
resp = client.post('/', data={
|
||||||
|
'action': 'wochentag',
|
||||||
|
'datum3': 'invalid-date'
|
||||||
|
})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
html = resp.data.decode('utf-8')
|
||||||
|
assert 'Ungültige Eingabe' in html
|
||||||
|
|
||||||
|
def test_invalid_kw_berechnen_input(client):
|
||||||
|
"""Test ungültige Eingaben bei KW-Berechnung"""
|
||||||
|
resp = client.post('/', data={
|
||||||
|
'action': 'kw_berechnen',
|
||||||
|
'datum6': 'invalid-date'
|
||||||
|
})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
html = resp.data.decode('utf-8')
|
||||||
|
assert 'Ungültige Eingabe' in html
|
||||||
|
|
||||||
|
def test_invalid_kw_datum_input(client):
|
||||||
|
"""Test ungültige Eingaben bei KW-Datum"""
|
||||||
|
resp = client.post('/', data={
|
||||||
|
'action': 'kw_datum',
|
||||||
|
'jahr7': 'invalid',
|
||||||
|
'kw7': 'invalid'
|
||||||
|
})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
html = resp.data.decode('utf-8')
|
||||||
|
assert 'Ungültige Eingabe' in html
|
||||||
|
|
||||||
|
def test_invalid_plusminus_input(client):
|
||||||
|
"""Test ungültige Eingaben bei Plusminus-Berechnung"""
|
||||||
|
resp = client.post('/', data={
|
||||||
|
'action': 'plusminus',
|
||||||
|
'datum_pm': 'invalid-date',
|
||||||
|
'anzahl_pm': 'invalid',
|
||||||
|
'einheit_pm': 'tage',
|
||||||
|
'richtung_pm': 'add'
|
||||||
|
})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
html = resp.data.decode('utf-8')
|
||||||
|
assert 'Ungültige Eingabe' in html
|
||||||
|
|
||||||
|
def test_stats_login_success(client):
|
||||||
|
"""Test erfolgreiche Anmeldung im Stats-Bereich"""
|
||||||
|
with client.session_transaction() as sess:
|
||||||
|
sess['stats_auth'] = True
|
||||||
|
resp = client.get('/stats')
|
||||||
|
assert resp.status_code == 200
|
||||||
|
|
||||||
|
def test_stats_login_failure(client):
|
||||||
|
"""Test fehlgeschlagene Anmeldung im Stats-Bereich"""
|
||||||
|
resp = client.post('/stats', data={'password': 'wrong'})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
html = resp.data.decode('utf-8')
|
||||||
|
assert 'Falsches Passwort' in html
|
||||||
|
|
||||||
|
def test_api_error_handling(client):
|
||||||
|
"""Test API-Fehlerbehandlung"""
|
||||||
|
# Test mit korrektem Content-Type
|
||||||
|
resp = client.post('/api/tage_werktage',
|
||||||
|
data='invalid json',
|
||||||
|
content_type='application/json')
|
||||||
|
assert resp.status_code == 400
|
||||||
|
|
||||||
|
def test_api_plusminus_werktage_unsupported(client):
|
||||||
|
"""Test nicht unterstützte Werktage + Wochen/Monate"""
|
||||||
|
# Werktage + Wochen
|
||||||
|
resp = client.post('/api/plusminus', json={
|
||||||
|
'datum': '2024-06-10', 'anzahl': 5, 'einheit': 'wochen', 'werktage': True
|
||||||
|
})
|
||||||
|
assert resp.status_code == 400
|
||||||
|
assert 'Nicht unterstützt' in resp.get_json()['error']
|
||||||
|
|
||||||
|
# Werktage + Monate
|
||||||
|
resp = client.post('/api/plusminus', json={
|
||||||
|
'datum': '2024-06-10', 'anzahl': 5, 'einheit': 'monate', 'werktage': True
|
||||||
|
})
|
||||||
|
assert resp.status_code == 400
|
||||||
|
assert 'Nicht unterstützt' in resp.get_json()['error']
|
||||||
|
|
||||||
|
def test_api_logging(client):
|
||||||
|
"""Test API-Logging"""
|
||||||
|
resp = client.post('/api/wochentag', json={'datum': '2024-06-10'})
|
||||||
|
assert resp.status_code == 200
|
||||||
|
|
||||||
|
# Prüfe ob Log-Datei existiert
|
||||||
|
log_path = os.path.join('log', 'pageviews.log')
|
||||||
|
assert os.path.exists(log_path)
|
||||||
|
|
||||||
|
def test_api_docs(client):
|
||||||
|
"""Test API-Dokumentation"""
|
||||||
|
resp = client.get('/api-docs')
|
||||||
|
assert resp.status_code == 200
|
||||||
|
|
||||||
|
def test_monitor_api_details(client):
|
||||||
|
"""Test detaillierte Monitor-API"""
|
||||||
|
resp = client.get('/api/monitor')
|
||||||
|
assert resp.status_code == 200
|
||||||
|
data = resp.get_json()
|
||||||
|
assert 'status' in data
|
||||||
|
assert 'message' in data
|
||||||
|
assert 'time' in data
|
||||||
|
assert 'uptime_seconds' in data
|
||||||
|
assert 'pageviews_last_7_days' in data
|
BIN
translations/de/LC_MESSAGES/messages.mo
Normal file
BIN
translations/de/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
483
translations/de/LC_MESSAGES/messages.po
Normal file
483
translations/de/LC_MESSAGES/messages.po
Normal file
@@ -0,0 +1,483 @@
|
|||||||
|
# German translations for Elpatrons Datumsrechner.
|
||||||
|
# Copyright (C) 2025 M. Busche
|
||||||
|
# This file is distributed under the same license as the Elpatrons Datumsrechner package.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: 1.3.13\n"
|
||||||
|
"Report-Msgid-Bugs-To: elpatron@mailbox.org\n"
|
||||||
|
"POT-Creation-Date: 2025-08-01 15:58+0100\n"
|
||||||
|
"PO-Revision-Date: 2025-08-01 15:58+0100\n"
|
||||||
|
"Last-Translator: M. Busche <elpatron@mailbox.org>\n"
|
||||||
|
"Language: de\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: templates/index.html:12
|
||||||
|
msgid "Elpatrons Datumsrechner – Open Source Kalender- und Datumsberechnungen"
|
||||||
|
msgstr "Elpatrons Datumsrechner – Open Source Kalender- und Datumsberechnungen"
|
||||||
|
|
||||||
|
#: templates/index.html:13
|
||||||
|
msgid "Elpatrons Datumsrechner: Open Source Web-App für Kalender- und Datumsberechnungen. Tage, Werktage, Wochen, Monate, Kalenderwochen, Wochentage und mehr berechnen – barrierefrei, werbefrei, trackingfrei, kostenlos."
|
||||||
|
msgstr "Elpatrons Datumsrechner: Open Source Web-App für Kalender- und Datumsberechnungen. Tage, Werktage, Wochen, Monate, Kalenderwochen, Wochentage und mehr berechnen – barrierefrei, werbefrei, trackingfrei, kostenlos."
|
||||||
|
|
||||||
|
#: templates/index.html:14
|
||||||
|
msgid "Datum, Kalender, Datumsrechner, Werktage, Tage zählen, Kalenderwoche, Wochentag, Open Source, Python, Flask, barrierefreiheit, barrierefrei, kostenlos, werbefrei, trackingfrei, cookiefrei"
|
||||||
|
msgstr "Datum, Kalender, Datumsrechner, Werktage, Tage zählen, Kalenderwoche, Wochentag, Open Source, Python, Flask, barrierefreiheit, barrierefrei, kostenlos, werbefrei, trackingfrei, cookiefrei"
|
||||||
|
|
||||||
|
#: templates/index.html:15
|
||||||
|
msgid "Elpatrons Datumsrechner – Open Source Kalender- und Datumsberechnungen"
|
||||||
|
msgstr "Elpatrons Datumsrechner – Open Source Kalender- und Datumsberechnungen"
|
||||||
|
|
||||||
|
#: templates/index.html:16
|
||||||
|
msgid "Open Source Web-App für Kalender- und Datumsberechnungen. Werbefrei, trackingfrei, kostenlos."
|
||||||
|
msgstr "Open Source Web-App für Kalender- und Datumsberechnungen. Werbefrei, trackingfrei, kostenlos."
|
||||||
|
|
||||||
|
#: templates/index.html:17
|
||||||
|
msgid "website"
|
||||||
|
msgstr "website"
|
||||||
|
|
||||||
|
#: templates/index.html:18
|
||||||
|
msgid "https://codeberg.org/elpatron/datecalc"
|
||||||
|
msgstr "https://codeberg.org/elpatron/datecalc"
|
||||||
|
|
||||||
|
#: templates/index.html:19
|
||||||
|
msgid "/static/logo.svg"
|
||||||
|
msgstr "/static/logo.svg"
|
||||||
|
|
||||||
|
#: templates/index.html:20
|
||||||
|
msgid "width=device-width, initial-scale=1"
|
||||||
|
msgstr "width=device-width, initial-scale=1"
|
||||||
|
|
||||||
|
#: templates/index.html:21
|
||||||
|
msgid "true"
|
||||||
|
msgstr "true"
|
||||||
|
|
||||||
|
#: templates/index.html:22
|
||||||
|
msgid "yes"
|
||||||
|
msgstr "yes"
|
||||||
|
|
||||||
|
#: templates/index.html:23
|
||||||
|
msgid "default"
|
||||||
|
msgstr "default"
|
||||||
|
|
||||||
|
#: templates/index.html:24
|
||||||
|
msgid "telephone=no"
|
||||||
|
msgstr "telephone=no"
|
||||||
|
|
||||||
|
#: templates/index.html:25
|
||||||
|
msgid "IE=edge"
|
||||||
|
msgstr "IE=edge"
|
||||||
|
|
||||||
|
#: templates/index.html:26
|
||||||
|
msgid "Elpatrons Datumsrechner"
|
||||||
|
msgstr "Elpatrons Datumsrechner"
|
||||||
|
|
||||||
|
#: templates/index.html:27
|
||||||
|
msgid "#2563eb"
|
||||||
|
msgstr "#2563eb"
|
||||||
|
|
||||||
|
#: templates/index.html:28
|
||||||
|
msgid "/static/favicon.ico"
|
||||||
|
msgstr "/static/favicon.ico"
|
||||||
|
|
||||||
|
#: templates/index.html:29
|
||||||
|
msgid "Hilfe anzeigen"
|
||||||
|
msgstr "Hilfe anzeigen"
|
||||||
|
|
||||||
|
#: templates/index.html:30
|
||||||
|
msgid "Hilfe anzeigen"
|
||||||
|
msgstr "Hilfe anzeigen"
|
||||||
|
|
||||||
|
#: templates/index.html:31
|
||||||
|
msgid "Öffnet ein Hilfefenster mit Informationen über den Datumsrechner"
|
||||||
|
msgstr "Öffnet ein Hilfefenster mit Informationen über den Datumsrechner"
|
||||||
|
|
||||||
|
#: templates/index.html:32
|
||||||
|
msgid "Elpatrons"
|
||||||
|
msgstr "Elpatrons"
|
||||||
|
|
||||||
|
#: templates/index.html:33
|
||||||
|
msgid "Datumsrechner"
|
||||||
|
msgstr "Datumsrechner"
|
||||||
|
|
||||||
|
#: templates/index.html:34
|
||||||
|
msgid "Eine <em>freie</em> Web-App: barriere<em>frei</em>, werbe<em>frei</em>, tracking<em>frei</em>, lizenz<em>frei</em> und kosten<em>frei</em>."
|
||||||
|
msgstr "Eine <em>freie</em> Web-App: barriere<em>frei</em>, werbe<em>frei</em>, tracking<em>frei</em>, lizenz<em>frei</em> und kosten<em>frei</em>."
|
||||||
|
|
||||||
|
#: templates/index.html:35
|
||||||
|
msgid "Anzahl der Tage/Werktage zwischen zwei Daten"
|
||||||
|
msgstr "Anzahl der Tage/Werktage zwischen zwei Daten"
|
||||||
|
|
||||||
|
#: templates/index.html:36
|
||||||
|
msgid "Startdatum:"
|
||||||
|
msgstr "Startdatum:"
|
||||||
|
|
||||||
|
#: templates/index.html:37
|
||||||
|
msgid "Heute"
|
||||||
|
msgstr "Heute"
|
||||||
|
|
||||||
|
#: templates/index.html:38
|
||||||
|
msgid "Enddatum:"
|
||||||
|
msgstr "Enddatum:"
|
||||||
|
|
||||||
|
#: templates/index.html:39
|
||||||
|
msgid "Optionen"
|
||||||
|
msgstr "Optionen"
|
||||||
|
|
||||||
|
#: templates/index.html:40
|
||||||
|
msgid "Nur Werktage"
|
||||||
|
msgstr "Nur Werktage"
|
||||||
|
|
||||||
|
#: templates/index.html:41
|
||||||
|
msgid "Feiertage berücksichtigen für:"
|
||||||
|
msgstr "Feiertage berücksichtigen für:"
|
||||||
|
|
||||||
|
#: templates/index.html:42
|
||||||
|
msgid "(kein Bundesland)"
|
||||||
|
msgstr "(kein Bundesland)"
|
||||||
|
|
||||||
|
#: templates/index.html:43
|
||||||
|
msgid "Baden-Württemberg"
|
||||||
|
msgstr "Baden-Württemberg"
|
||||||
|
|
||||||
|
#: templates/index.html:44
|
||||||
|
msgid "Bayern"
|
||||||
|
msgstr "Bayern"
|
||||||
|
|
||||||
|
#: templates/index.html:45
|
||||||
|
msgid "Berlin"
|
||||||
|
msgstr "Berlin"
|
||||||
|
|
||||||
|
#: templates/index.html:46
|
||||||
|
msgid "Brandenburg"
|
||||||
|
msgstr "Brandenburg"
|
||||||
|
|
||||||
|
#: templates/index.html:47
|
||||||
|
msgid "Bremen"
|
||||||
|
msgstr "Bremen"
|
||||||
|
|
||||||
|
#: templates/index.html:48
|
||||||
|
msgid "Hamburg"
|
||||||
|
msgstr "Hamburg"
|
||||||
|
|
||||||
|
#: templates/index.html:49
|
||||||
|
msgid "Hessen"
|
||||||
|
msgstr "Hessen"
|
||||||
|
|
||||||
|
#: templates/index.html:50
|
||||||
|
msgid "Mecklenburg-Vorpommern"
|
||||||
|
msgstr "Mecklenburg-Vorpommern"
|
||||||
|
|
||||||
|
#: templates/index.html:51
|
||||||
|
msgid "Niedersachsen"
|
||||||
|
msgstr "Niedersachsen"
|
||||||
|
|
||||||
|
#: templates/index.html:52
|
||||||
|
msgid "Nordrhein-Westfalen"
|
||||||
|
msgstr "Nordrhein-Westfalen"
|
||||||
|
|
||||||
|
#: templates/index.html:53
|
||||||
|
msgid "Rheinland-Pfalz"
|
||||||
|
msgstr "Rheinland-Pfalz"
|
||||||
|
|
||||||
|
#: templates/index.html:54
|
||||||
|
msgid "Saarland"
|
||||||
|
msgstr "Saarland"
|
||||||
|
|
||||||
|
#: templates/index.html:55
|
||||||
|
msgid "Sachsen"
|
||||||
|
msgstr "Sachsen"
|
||||||
|
|
||||||
|
#: templates/index.html:56
|
||||||
|
msgid "Sachsen-Anhalt"
|
||||||
|
msgstr "Sachsen-Anhalt"
|
||||||
|
|
||||||
|
#: templates/index.html:57
|
||||||
|
msgid "Schleswig-Holstein"
|
||||||
|
msgstr "Schleswig-Holstein"
|
||||||
|
|
||||||
|
#: templates/index.html:58
|
||||||
|
msgid "Thüringen"
|
||||||
|
msgstr "Thüringen"
|
||||||
|
|
||||||
|
#: templates/index.html:59
|
||||||
|
msgid "Berechnen"
|
||||||
|
msgstr "Berechnen"
|
||||||
|
|
||||||
|
#: templates/index.html:60
|
||||||
|
msgid "Ergebnis vorlesen"
|
||||||
|
msgstr "Ergebnis vorlesen"
|
||||||
|
|
||||||
|
#: templates/index.html:61
|
||||||
|
msgid "Ergebnis vorlesen"
|
||||||
|
msgstr "Ergebnis vorlesen"
|
||||||
|
|
||||||
|
#: templates/index.html:62
|
||||||
|
msgid "Anzahl der Werktage zwischen"
|
||||||
|
msgstr "Anzahl der Werktage zwischen"
|
||||||
|
|
||||||
|
#: templates/index.html:63
|
||||||
|
msgid "und"
|
||||||
|
msgstr "und"
|
||||||
|
|
||||||
|
#: templates/index.html:64
|
||||||
|
msgid "(Feiertage:"
|
||||||
|
msgstr "(Feiertage:"
|
||||||
|
|
||||||
|
#: templates/index.html:65
|
||||||
|
msgid "Anzahl der Tage zwischen"
|
||||||
|
msgstr "Anzahl der Tage zwischen"
|
||||||
|
|
||||||
|
#: templates/index.html:66
|
||||||
|
msgid "Davon sind"
|
||||||
|
msgstr "Davon sind"
|
||||||
|
|
||||||
|
#: templates/index.html:67
|
||||||
|
msgid "Tage Wochenendtage."
|
||||||
|
msgstr "Tage Wochenendtage."
|
||||||
|
|
||||||
|
#: templates/index.html:68
|
||||||
|
msgid "Feiertage (Mo-Fr,"
|
||||||
|
msgstr "Feiertage (Mo-Fr,"
|
||||||
|
|
||||||
|
#: templates/index.html:69
|
||||||
|
msgid "Wochentag eines Datums"
|
||||||
|
msgstr "Wochentag eines Datums"
|
||||||
|
|
||||||
|
#: templates/index.html:70
|
||||||
|
msgid "Datum:"
|
||||||
|
msgstr "Datum:"
|
||||||
|
|
||||||
|
#: templates/index.html:71
|
||||||
|
msgid "Anzeigen"
|
||||||
|
msgstr "Anzeigen"
|
||||||
|
|
||||||
|
#: templates/index.html:72
|
||||||
|
msgid "Wochentag von"
|
||||||
|
msgstr "Wochentag von"
|
||||||
|
|
||||||
|
#: templates/index.html:73
|
||||||
|
msgid "Kalenderwoche eines Datums"
|
||||||
|
msgstr "Kalenderwoche eines Datums"
|
||||||
|
|
||||||
|
#: templates/index.html:74
|
||||||
|
msgid "Kalenderwoche berechnen"
|
||||||
|
msgstr "Kalenderwoche berechnen"
|
||||||
|
|
||||||
|
#: templates/index.html:75
|
||||||
|
msgid "Kalenderwoche von"
|
||||||
|
msgstr "Kalenderwoche von"
|
||||||
|
|
||||||
|
#: templates/index.html:76
|
||||||
|
msgid "Start-/Enddatum zu Kalenderwoche"
|
||||||
|
msgstr "Start-/Enddatum zu Kalenderwoche"
|
||||||
|
|
||||||
|
#: templates/index.html:77
|
||||||
|
msgid "Jahr:"
|
||||||
|
msgstr "Jahr:"
|
||||||
|
|
||||||
|
#: templates/index.html:78
|
||||||
|
msgid "Kalenderwoche:"
|
||||||
|
msgstr "Kalenderwoche:"
|
||||||
|
|
||||||
|
#: templates/index.html:79
|
||||||
|
msgid "Start-/Enddatum berechnen"
|
||||||
|
msgstr "Start-/Enddatum berechnen"
|
||||||
|
|
||||||
|
#: templates/index.html:80
|
||||||
|
msgid "Start-/Enddatum der KW"
|
||||||
|
msgstr "Start-/Enddatum der KW"
|
||||||
|
|
||||||
|
#: templates/index.html:81
|
||||||
|
msgid "im Jahr"
|
||||||
|
msgstr "im Jahr"
|
||||||
|
|
||||||
|
#: templates/index.html:82
|
||||||
|
msgid "Datum plus/minus X Tage/Wochen/Monate"
|
||||||
|
msgstr "Datum plus/minus X Tage/Wochen/Monate"
|
||||||
|
|
||||||
|
#: templates/index.html:83
|
||||||
|
msgid "Anzahl:"
|
||||||
|
msgstr "Anzahl:"
|
||||||
|
|
||||||
|
#: templates/index.html:84
|
||||||
|
msgid "Rechenrichtung"
|
||||||
|
msgstr "Rechenrichtung"
|
||||||
|
|
||||||
|
#: templates/index.html:85
|
||||||
|
msgid "addieren"
|
||||||
|
msgstr "addieren"
|
||||||
|
|
||||||
|
#: templates/index.html:86
|
||||||
|
msgid "subtrahieren"
|
||||||
|
msgstr "subtrahieren"
|
||||||
|
|
||||||
|
#: templates/index.html:87
|
||||||
|
msgid "Einheit und Werktage"
|
||||||
|
msgstr "Einheit und Werktage"
|
||||||
|
|
||||||
|
#: templates/index.html:88
|
||||||
|
msgid "Einheit:"
|
||||||
|
msgstr "Einheit:"
|
||||||
|
|
||||||
|
#: templates/index.html:89
|
||||||
|
msgid "Tage"
|
||||||
|
msgstr "Tage"
|
||||||
|
|
||||||
|
#: templates/index.html:90
|
||||||
|
msgid "Wochen"
|
||||||
|
msgstr "Wochen"
|
||||||
|
|
||||||
|
#: templates/index.html:91
|
||||||
|
msgid "Monate"
|
||||||
|
msgstr "Monate"
|
||||||
|
|
||||||
|
#: templates/index.html:92
|
||||||
|
msgid "Nur Werktage"
|
||||||
|
msgstr "Nur Werktage"
|
||||||
|
|
||||||
|
#: templates/index.html:93
|
||||||
|
msgid "Hilfe schließen"
|
||||||
|
msgstr "Hilfe schließen"
|
||||||
|
|
||||||
|
#: templates/index.html:94
|
||||||
|
msgid "Was ist Elpatrons Datumsrechner?"
|
||||||
|
msgstr "Was ist Elpatrons Datumsrechner?"
|
||||||
|
|
||||||
|
#: templates/index.html:95
|
||||||
|
msgid "Der Datumsrechner kann verschiedene Datumsberechnungen durchführen:"
|
||||||
|
msgstr "Der Datumsrechner kann verschiedene Datumsberechnungen durchführen:"
|
||||||
|
|
||||||
|
#: templates/index.html:96
|
||||||
|
msgid "Anzahl der Tage zwischen zwei Daten"
|
||||||
|
msgstr "Anzahl der Tage zwischen zwei Daten"
|
||||||
|
|
||||||
|
#: templates/index.html:97
|
||||||
|
msgid "Anzahl der Werktage zwischen zwei Daten"
|
||||||
|
msgstr "Anzahl der Werktage zwischen zwei Daten"
|
||||||
|
|
||||||
|
#: templates/index.html:98
|
||||||
|
msgid "Anzeige des Wochentags eines Datums"
|
||||||
|
msgstr "Anzeige des Wochentags eines Datums"
|
||||||
|
|
||||||
|
#: templates/index.html:99
|
||||||
|
msgid "Datum plus/minus X Tage"
|
||||||
|
msgstr "Datum plus/minus X Tage"
|
||||||
|
|
||||||
|
#: templates/index.html:100
|
||||||
|
msgid "Datum plus/minus X Werktage"
|
||||||
|
msgstr "Datum plus/minus X Werktage"
|
||||||
|
|
||||||
|
#: templates/index.html:101
|
||||||
|
msgid "Datum plus/minus X Wochen/Monate"
|
||||||
|
msgstr "Datum plus/minus X Wochen/Monate"
|
||||||
|
|
||||||
|
#: templates/index.html:102
|
||||||
|
msgid "Kalenderwoche zu Datum"
|
||||||
|
msgstr "Kalenderwoche zu Datum"
|
||||||
|
|
||||||
|
#: templates/index.html:103
|
||||||
|
msgid "Start-/Enddatum einer Kalenderwoche eines Jahres"
|
||||||
|
msgstr "Start-/Enddatum einer Kalenderwoche eines Jahres"
|
||||||
|
|
||||||
|
#: templates/index.html:104
|
||||||
|
msgid "Online Datumsrechner gibt es bereits in einer Vielzahl, warum also noch einer?"
|
||||||
|
msgstr "Online Datumsrechner gibt es bereits in einer Vielzahl, warum also noch einer?"
|
||||||
|
|
||||||
|
#: templates/index.html:105
|
||||||
|
msgid "Aus zwei Gründen:"
|
||||||
|
msgstr "Aus zwei Gründen:"
|
||||||
|
|
||||||
|
#: templates/index.html:106
|
||||||
|
msgid "Finde mal einen Datumsrechner, der nicht vollkommen verseucht mit Werbung, Tracking und Cookies ist!"
|
||||||
|
msgstr "Finde mal einen Datumsrechner, der nicht vollkommen verseucht mit Werbung, Tracking und Cookies ist!"
|
||||||
|
|
||||||
|
#: templates/index.html:107
|
||||||
|
msgid "Das hat mich so geärgert, dass ich meinen eigenen programmiert habe."
|
||||||
|
msgstr "Das hat mich so geärgert, dass ich meinen eigenen programmiert habe."
|
||||||
|
|
||||||
|
#: templates/index.html:108
|
||||||
|
msgid "Genau genommen nicht ich selbst. Diese App wurde zum überwiegenden Teil von KI nach meinen Anweisungen entwickelt (Vibe Coding)."
|
||||||
|
msgstr "Genau genommen nicht ich selbst. Diese App wurde zum überwiegenden Teil von KI nach meinen Anweisungen entwickelt (Vibe Coding)."
|
||||||
|
|
||||||
|
#: templates/index.html:109
|
||||||
|
msgid "Was du noch wissen solltest"
|
||||||
|
msgstr "Was du noch wissen solltest"
|
||||||
|
|
||||||
|
#: templates/index.html:110
|
||||||
|
msgid "Ich habe versucht, die App möglichst barrierefrei zu gestalten, um Menschen mit Einschränkungen die Benutzung zu erleichtern."
|
||||||
|
msgstr "Ich habe versucht, die App möglichst barrierefrei zu gestalten, um Menschen mit Einschränkungen die Benutzung zu erleichtern."
|
||||||
|
|
||||||
|
#: templates/index.html:111
|
||||||
|
msgid "Diese App schnüffelt dir nicht hinterher, sammelt keine persönlichen Daten und geht dir auch sonst (hoffentlich!) in keiner Weise auf die Nerven."
|
||||||
|
msgstr "Diese App schnüffelt dir nicht hinterher, sammelt keine persönlichen Daten und geht dir auch sonst (hoffentlich!) in keiner Weise auf die Nerven."
|
||||||
|
|
||||||
|
#: templates/index.html:112
|
||||||
|
msgid "Den Quellcode dieser App habe ich auf"
|
||||||
|
msgstr "Den Quellcode dieser App habe ich auf"
|
||||||
|
|
||||||
|
#: templates/index.html:113
|
||||||
|
msgid "veröffentlicht, du kannst ihn einsehen, verändern oder damit deinen eigenen kleinen Datumsrechner betreiben."
|
||||||
|
msgstr "veröffentlicht, du kannst ihn einsehen, verändern oder damit deinen eigenen kleinen Datumsrechner betreiben."
|
||||||
|
|
||||||
|
#: templates/index.html:114
|
||||||
|
msgid "Die App läuft auf meinem kleinen Home-Server und ist derzeit nicht für große Besucherzahlen ausgelegt."
|
||||||
|
msgstr "Die App läuft auf meinem kleinen Home-Server und ist derzeit nicht für große Besucherzahlen ausgelegt."
|
||||||
|
|
||||||
|
#: templates/index.html:115
|
||||||
|
msgid "Ich übernehme keine Gewähr für die Funktionalität und die Rechenergebnisse. Die KI, die das programmiert hat, übrigens auch nicht."
|
||||||
|
msgstr "Ich übernehme keine Gewähr für die Funktionalität und die Rechenergebnisse. Die KI, die das programmiert hat, übrigens auch nicht."
|
||||||
|
|
||||||
|
#: templates/index.html:116
|
||||||
|
msgid "Falls du einen Fehler findest oder eine weitere Funktion wünschst, kannst du mir eine Mail schreiben (siehe Mailto Link in der Fußzeile)"
|
||||||
|
msgstr "Falls du einen Fehler findest oder eine weitere Funktion wünschst, kannst du mir eine Mail schreiben (siehe Mailto Link in der Fußzeile)"
|
||||||
|
|
||||||
|
#: templates/index.html:117
|
||||||
|
msgid "Hab Spaß mit Elpatrons Datumsrechner! Dein M. Busche"
|
||||||
|
msgstr "Hab Spaß mit Elpatrons Datumsrechner! Dein M. Busche"
|
||||||
|
|
||||||
|
#: templates/index.html:118
|
||||||
|
msgid "Hilfe-Informationen für den Datumsrechner mit Erklärungen zu allen Funktionen"
|
||||||
|
msgstr "Hilfe-Informationen für den Datumsrechner mit Erklärungen zu allen Funktionen"
|
||||||
|
|
||||||
|
#: templates/index.html:119
|
||||||
|
msgid "Dies ist ein werbe- und trackingfreier"
|
||||||
|
msgstr "Dies ist ein werbe- und trackingfreier"
|
||||||
|
|
||||||
|
#: templates/index.html:120
|
||||||
|
msgid "Open Source Datumsrechner"
|
||||||
|
msgstr "Open Source Datumsrechner"
|
||||||
|
|
||||||
|
#: templates/index.html:121
|
||||||
|
msgid "REST API Dokumentation (Swagger)"
|
||||||
|
msgstr "REST API Dokumentation (Swagger)"
|
||||||
|
|
||||||
|
#: templates/index.html:122
|
||||||
|
msgid "M. Busche"
|
||||||
|
msgstr "M. Busche"
|
||||||
|
|
||||||
|
#: app.py:123
|
||||||
|
msgid "Ungültige Eingabe"
|
||||||
|
msgstr "Ungültige Eingabe"
|
||||||
|
|
||||||
|
#: app.py:124
|
||||||
|
msgid "Nicht unterstützt: Werktage + Wochen."
|
||||||
|
msgstr "Nicht unterstützt: Werktage + Wochen."
|
||||||
|
|
||||||
|
#: app.py:125
|
||||||
|
msgid "Nicht unterstützt: Werktage + Monate."
|
||||||
|
msgstr "Nicht unterstützt: Werktage + Monate."
|
||||||
|
|
||||||
|
#: templates/index.html:126
|
||||||
|
msgid "Sprache auswählen"
|
||||||
|
msgstr "Sprache auswählen"
|
||||||
|
|
||||||
|
#: templates/index.html:127
|
||||||
|
msgid "Deutsch auswählen"
|
||||||
|
msgstr "Deutsch auswählen"
|
||||||
|
|
||||||
|
#: templates/index.html:131
|
||||||
|
msgid "English auswählen"
|
||||||
|
msgstr "English auswählen"
|
BIN
translations/en/LC_MESSAGES/messages.mo
Normal file
BIN
translations/en/LC_MESSAGES/messages.mo
Normal file
Binary file not shown.
587
translations/en/LC_MESSAGES/messages.po
Normal file
587
translations/en/LC_MESSAGES/messages.po
Normal file
@@ -0,0 +1,587 @@
|
|||||||
|
# English translations for Elpatrons Datumsrechner.
|
||||||
|
# Copyright (C) 2025 M. Busche
|
||||||
|
# This file is distributed under the same license as the Elpatrons Datumsrechner package.
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: 1.3.13\n"
|
||||||
|
"Report-Msgid-Bugs-To: elpatron@mailbox.org\n"
|
||||||
|
"POT-Creation-Date: 2025-08-01 15:58+0100\n"
|
||||||
|
"PO-Revision-Date: 2025-08-01 15:58+0100\n"
|
||||||
|
"Last-Translator: M. Busche <elpatron@mailbox.org>\n"
|
||||||
|
"Language: en\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#: templates/index.html:12
|
||||||
|
msgid "Elpatrons Datumsrechner – Open Source Kalender- und Datumsberechnungen"
|
||||||
|
msgstr "Elpatrons Date Calculator – Open Source Calendar and Date Calculations"
|
||||||
|
|
||||||
|
#: templates/index.html:13
|
||||||
|
msgid "Elpatrons Datumsrechner: Open Source Web-App für Kalender- und Datumsberechnungen. Tage, Werktage, Wochen, Monate, Kalenderwochen, Wochentage und mehr berechnen – barrierefrei, werbefrei, trackingfrei, kostenlos."
|
||||||
|
msgstr "Elpatrons Date Calculator: Open Source web app for calendar and date calculations. Calculate days, workdays, weeks, months, calendar weeks, weekdays and more – accessible, ad-free, tracking-free, free of charge."
|
||||||
|
|
||||||
|
#: templates/index.html:14
|
||||||
|
msgid "Datum, Kalender, Datumsrechner, Werktage, Tage zählen, Kalenderwoche, Wochentag, Open Source, Python, Flask, barrierefreiheit, barrierefrei, kostenlos, werbefrei, trackingfrei, cookiefrei"
|
||||||
|
msgstr "Date, Calendar, Date Calculator, Workdays, Count Days, Calendar Week, Weekday, Open Source, Python, Flask, accessibility, accessible, free, ad-free, tracking-free, cookie-free"
|
||||||
|
|
||||||
|
#: templates/index.html:15
|
||||||
|
msgid "Elpatrons Datumsrechner – Open Source Kalender- und Datumsberechnungen"
|
||||||
|
msgstr "Elpatrons Date Calculator – Open Source Calendar and Date Calculations"
|
||||||
|
|
||||||
|
#: templates/index.html:16
|
||||||
|
msgid "Open Source Web-App für Kalender- und Datumsberechnungen. Werbefrei, trackingfrei, kostenlos."
|
||||||
|
msgstr "Open Source web app for calendar and date calculations. Ad-free, tracking-free, free of charge."
|
||||||
|
|
||||||
|
#: templates/index.html:17
|
||||||
|
msgid "website"
|
||||||
|
msgstr "website"
|
||||||
|
|
||||||
|
#: templates/index.html:18
|
||||||
|
msgid "https://codeberg.org/elpatron/datecalc"
|
||||||
|
msgstr "https://codeberg.org/elpatron/datecalc"
|
||||||
|
|
||||||
|
#: templates/index.html:19
|
||||||
|
msgid "/static/logo.svg"
|
||||||
|
msgstr "/static/logo.svg"
|
||||||
|
|
||||||
|
#: templates/index.html:20
|
||||||
|
msgid "width=device-width, initial-scale=1"
|
||||||
|
msgstr "width=device-width, initial-scale=1"
|
||||||
|
|
||||||
|
#: templates/index.html:21
|
||||||
|
msgid "true"
|
||||||
|
msgstr "true"
|
||||||
|
|
||||||
|
#: templates/index.html:22
|
||||||
|
msgid "yes"
|
||||||
|
msgstr "yes"
|
||||||
|
|
||||||
|
#: templates/index.html:23
|
||||||
|
msgid "default"
|
||||||
|
msgstr "default"
|
||||||
|
|
||||||
|
#: templates/index.html:24
|
||||||
|
msgid "telephone=no"
|
||||||
|
msgstr "telephone=no"
|
||||||
|
|
||||||
|
#: templates/index.html:25
|
||||||
|
msgid "IE=edge"
|
||||||
|
msgstr "IE=edge"
|
||||||
|
|
||||||
|
#: templates/index.html:26
|
||||||
|
msgid "Elpatrons Datumsrechner"
|
||||||
|
msgstr "Elpatrons Date Calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:27
|
||||||
|
msgid "#2563eb"
|
||||||
|
msgstr "#2563eb"
|
||||||
|
|
||||||
|
#: templates/index.html:28
|
||||||
|
msgid "/static/favicon.ico"
|
||||||
|
msgstr "/static/favicon.ico"
|
||||||
|
|
||||||
|
#: templates/index.html:29
|
||||||
|
msgid "Hilfe anzeigen"
|
||||||
|
msgstr "Show Help"
|
||||||
|
|
||||||
|
#: templates/index.html:30
|
||||||
|
msgid "Hilfe anzeigen"
|
||||||
|
msgstr "Show Help"
|
||||||
|
|
||||||
|
#: templates/index.html:31
|
||||||
|
msgid "Öffnet ein Hilfefenster mit Informationen über den Datumsrechner"
|
||||||
|
msgstr "Opens a help window with information about the date calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:32
|
||||||
|
msgid "Elpatrons"
|
||||||
|
msgstr "Elpatrons"
|
||||||
|
|
||||||
|
#: templates/index.html:33
|
||||||
|
msgid "Datumsrechner"
|
||||||
|
msgstr "Date Calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:34
|
||||||
|
msgid "Eine <em>freie</em> Web-App: barriere<em>frei</em>, werbe<em>frei</em>, tracking<em>frei</em>, lizenz<em>frei</em> und kosten<em>frei</em>."
|
||||||
|
msgstr "A <em>free</em> web app: <em>accessible</em>, <em>ad-free</em>, <em>tracking-free</em>, <em>license-free</em> and <em>cost-free</em>."
|
||||||
|
|
||||||
|
#: templates/index.html:35
|
||||||
|
msgid "Anzahl der Tage/Werktage zwischen zwei Daten"
|
||||||
|
msgstr "Number of days/workdays between two dates"
|
||||||
|
|
||||||
|
#: templates/index.html:36
|
||||||
|
msgid "Startdatum:"
|
||||||
|
msgstr "Start date:"
|
||||||
|
|
||||||
|
#: templates/index.html:37
|
||||||
|
msgid "Heute"
|
||||||
|
msgstr "Today"
|
||||||
|
|
||||||
|
#: templates/index.html:38
|
||||||
|
msgid "Enddatum:"
|
||||||
|
msgstr "End date:"
|
||||||
|
|
||||||
|
#: templates/index.html:39
|
||||||
|
msgid "Optionen"
|
||||||
|
msgstr "Options"
|
||||||
|
|
||||||
|
#: templates/index.html:40
|
||||||
|
msgid "Nur Werktage"
|
||||||
|
msgstr "Workdays only"
|
||||||
|
|
||||||
|
#: templates/index.html:41
|
||||||
|
msgid "Feiertage berücksichtigen für:"
|
||||||
|
msgstr "Consider holidays for:"
|
||||||
|
|
||||||
|
#: templates/index.html:42
|
||||||
|
msgid "(kein Bundesland)"
|
||||||
|
msgstr "(no state)"
|
||||||
|
|
||||||
|
#: templates/index.html:43
|
||||||
|
msgid "Baden-Württemberg"
|
||||||
|
msgstr "Baden-Württemberg"
|
||||||
|
|
||||||
|
#: templates/index.html:44
|
||||||
|
msgid "Bayern"
|
||||||
|
msgstr "Bavaria"
|
||||||
|
|
||||||
|
#: templates/index.html:45
|
||||||
|
msgid "Berlin"
|
||||||
|
msgstr "Berlin"
|
||||||
|
|
||||||
|
#: templates/index.html:46
|
||||||
|
msgid "Brandenburg"
|
||||||
|
msgstr "Brandenburg"
|
||||||
|
|
||||||
|
#: templates/index.html:47
|
||||||
|
msgid "Bremen"
|
||||||
|
msgstr "Bremen"
|
||||||
|
|
||||||
|
#: templates/index.html:48
|
||||||
|
msgid "Hamburg"
|
||||||
|
msgstr "Hamburg"
|
||||||
|
|
||||||
|
#: templates/index.html:49
|
||||||
|
msgid "Hessen"
|
||||||
|
msgstr "Hesse"
|
||||||
|
|
||||||
|
#: templates/index.html:50
|
||||||
|
msgid "Mecklenburg-Vorpommern"
|
||||||
|
msgstr "Mecklenburg-Vorpommern"
|
||||||
|
|
||||||
|
#: templates/index.html:51
|
||||||
|
msgid "Niedersachsen"
|
||||||
|
msgstr "Lower Saxony"
|
||||||
|
|
||||||
|
#: templates/index.html:52
|
||||||
|
msgid "Nordrhein-Westfalen"
|
||||||
|
msgstr "North Rhine-Westphalia"
|
||||||
|
|
||||||
|
#: templates/index.html:53
|
||||||
|
msgid "Rheinland-Pfalz"
|
||||||
|
msgstr "Rhineland-Palatinate"
|
||||||
|
|
||||||
|
#: templates/index.html:54
|
||||||
|
msgid "Saarland"
|
||||||
|
msgstr "Saarland"
|
||||||
|
|
||||||
|
#: templates/index.html:55
|
||||||
|
msgid "Sachsen"
|
||||||
|
msgstr "Saxony"
|
||||||
|
|
||||||
|
#: templates/index.html:56
|
||||||
|
msgid "Sachsen-Anhalt"
|
||||||
|
msgstr "Saxony-Anhalt"
|
||||||
|
|
||||||
|
#: templates/index.html:57
|
||||||
|
msgid "Schleswig-Holstein"
|
||||||
|
msgstr "Schleswig-Holstein"
|
||||||
|
|
||||||
|
#: templates/index.html:58
|
||||||
|
msgid "Thüringen"
|
||||||
|
msgstr "Thuringia"
|
||||||
|
|
||||||
|
#: templates/index.html:59
|
||||||
|
msgid "Berechnen"
|
||||||
|
msgstr "Calculate"
|
||||||
|
|
||||||
|
#: templates/index.html:60
|
||||||
|
msgid "Ergebnis vorlesen"
|
||||||
|
msgstr "Read result aloud"
|
||||||
|
|
||||||
|
#: templates/index.html:61
|
||||||
|
msgid "Ergebnis vorlesen"
|
||||||
|
msgstr "Read result aloud"
|
||||||
|
|
||||||
|
#: templates/index.html:62
|
||||||
|
msgid "Anzahl der Werktage zwischen"
|
||||||
|
msgstr "Number of workdays between"
|
||||||
|
|
||||||
|
#: templates/index.html:63
|
||||||
|
msgid "und"
|
||||||
|
msgstr "and"
|
||||||
|
|
||||||
|
#: templates/index.html:64
|
||||||
|
msgid "(Feiertage:"
|
||||||
|
msgstr "(Holidays:"
|
||||||
|
|
||||||
|
#: templates/index.html:65
|
||||||
|
msgid "Anzahl der Tage zwischen"
|
||||||
|
msgstr "Number of days between"
|
||||||
|
|
||||||
|
#: templates/index.html:66
|
||||||
|
msgid "Davon sind"
|
||||||
|
msgstr "Of which"
|
||||||
|
|
||||||
|
#: templates/index.html:67
|
||||||
|
msgid "Tage Wochenendtage."
|
||||||
|
msgstr "days are weekend days."
|
||||||
|
|
||||||
|
#: templates/index.html:68
|
||||||
|
msgid "Feiertage (Mo-Fr,"
|
||||||
|
msgstr "holidays (Mon-Fri,"
|
||||||
|
|
||||||
|
#: templates/index.html:69
|
||||||
|
msgid "Wochentag eines Datums"
|
||||||
|
msgstr "Weekday of a date"
|
||||||
|
|
||||||
|
#: templates/index.html:70
|
||||||
|
msgid "Datum:"
|
||||||
|
msgstr "Date:"
|
||||||
|
|
||||||
|
#: templates/index.html:71
|
||||||
|
msgid "Anzeigen"
|
||||||
|
msgstr "Show"
|
||||||
|
|
||||||
|
#: templates/index.html:72
|
||||||
|
msgid "Wochentag von"
|
||||||
|
msgstr "Weekday of"
|
||||||
|
|
||||||
|
#: templates/index.html:73
|
||||||
|
msgid "Kalenderwoche eines Datums"
|
||||||
|
msgstr "Calendar week of a date"
|
||||||
|
|
||||||
|
#: templates/index.html:74
|
||||||
|
msgid "Kalenderwoche berechnen"
|
||||||
|
msgstr "Calculate calendar week"
|
||||||
|
|
||||||
|
#: templates/index.html:75
|
||||||
|
msgid "Kalenderwoche von"
|
||||||
|
msgstr "Calendar week of"
|
||||||
|
|
||||||
|
#: templates/index.html:76
|
||||||
|
msgid "Start-/Enddatum zu Kalenderwoche"
|
||||||
|
msgstr "Start/end date to calendar week"
|
||||||
|
|
||||||
|
#: templates/index.html:77
|
||||||
|
msgid "Jahr:"
|
||||||
|
msgstr "Year:"
|
||||||
|
|
||||||
|
#: templates/index.html:78
|
||||||
|
msgid "Kalenderwoche:"
|
||||||
|
msgstr "Calendar week:"
|
||||||
|
|
||||||
|
#: templates/index.html:79
|
||||||
|
msgid "Start-/Enddatum berechnen"
|
||||||
|
msgstr "Calculate start/end date"
|
||||||
|
|
||||||
|
#: templates/index.html:80
|
||||||
|
msgid "Start-/Enddatum der KW"
|
||||||
|
msgstr "Start/end date of week"
|
||||||
|
|
||||||
|
#: templates/index.html:81
|
||||||
|
msgid "im Jahr"
|
||||||
|
msgstr "in year"
|
||||||
|
|
||||||
|
#: templates/index.html:82
|
||||||
|
msgid "Datum plus/minus X Tage/Wochen/Monate"
|
||||||
|
msgstr "Date plus/minus X days/weeks/months"
|
||||||
|
|
||||||
|
#: templates/index.html:83
|
||||||
|
msgid "Anzahl:"
|
||||||
|
msgstr "Amount:"
|
||||||
|
|
||||||
|
#: templates/index.html:84
|
||||||
|
msgid "Rechenrichtung"
|
||||||
|
msgstr "Calculation direction"
|
||||||
|
|
||||||
|
#: templates/index.html:85
|
||||||
|
msgid "addieren"
|
||||||
|
msgstr "add"
|
||||||
|
|
||||||
|
#: templates/index.html:86
|
||||||
|
msgid "subtrahieren"
|
||||||
|
msgstr "subtract"
|
||||||
|
|
||||||
|
#: templates/index.html:87
|
||||||
|
msgid "Einheit und Werktage"
|
||||||
|
msgstr "Unit and workdays"
|
||||||
|
|
||||||
|
#: templates/index.html:88
|
||||||
|
msgid "Einheit:"
|
||||||
|
msgstr "Unit:"
|
||||||
|
|
||||||
|
#: templates/index.html:89
|
||||||
|
msgid "Tage"
|
||||||
|
msgstr "Days"
|
||||||
|
|
||||||
|
#: templates/index.html:90
|
||||||
|
msgid "Wochen"
|
||||||
|
msgstr "Weeks"
|
||||||
|
|
||||||
|
#: templates/index.html:91
|
||||||
|
msgid "Monate"
|
||||||
|
msgstr "Months"
|
||||||
|
|
||||||
|
#: templates/index.html:92
|
||||||
|
msgid "Nur Werktage"
|
||||||
|
msgstr "Workdays only"
|
||||||
|
|
||||||
|
#: templates/index.html:93
|
||||||
|
msgid "Hilfe schließen"
|
||||||
|
msgstr "Close help"
|
||||||
|
|
||||||
|
#: templates/index.html:94
|
||||||
|
msgid "Was ist Elpatrons Datumsrechner?"
|
||||||
|
msgstr "What is Elpatrons Date Calculator?"
|
||||||
|
|
||||||
|
#: templates/index.html:95
|
||||||
|
msgid "Der Datumsrechner kann verschiedene Datumsberechnungen durchführen:"
|
||||||
|
msgstr "The date calculator can perform various date calculations:"
|
||||||
|
|
||||||
|
#: templates/index.html:96
|
||||||
|
msgid "Anzahl der Tage zwischen zwei Daten"
|
||||||
|
msgstr "Number of days between two dates"
|
||||||
|
|
||||||
|
#: templates/index.html:97
|
||||||
|
msgid "Anzahl der Werktage zwischen zwei Daten"
|
||||||
|
msgstr "Number of workdays between two dates"
|
||||||
|
|
||||||
|
#: templates/index.html:98
|
||||||
|
msgid "Anzeige des Wochentags eines Datums"
|
||||||
|
msgstr "Display of the weekday of a date"
|
||||||
|
|
||||||
|
#: templates/index.html:99
|
||||||
|
msgid "Datum plus/minus X Tage"
|
||||||
|
msgstr "Date plus/minus X days"
|
||||||
|
|
||||||
|
#: templates/index.html:100
|
||||||
|
msgid "Datum plus/minus X Werktage"
|
||||||
|
msgstr "Date plus/minus X workdays"
|
||||||
|
|
||||||
|
#: templates/index.html:101
|
||||||
|
msgid "Datum plus/minus X Wochen/Monate"
|
||||||
|
msgstr "Date plus/minus X weeks/months"
|
||||||
|
|
||||||
|
#: templates/index.html:102
|
||||||
|
msgid "Kalenderwoche zu Datum"
|
||||||
|
msgstr "Calendar week to date"
|
||||||
|
|
||||||
|
#: templates/index.html:103
|
||||||
|
msgid "Start-/Enddatum einer Kalenderwoche eines Jahres"
|
||||||
|
msgstr "Start/end date of a calendar week of a year"
|
||||||
|
|
||||||
|
#: templates/index.html:104
|
||||||
|
msgid "Online Datumsrechner gibt es bereits in einer Vielzahl, warum also noch einer?"
|
||||||
|
msgstr "Online date calculators already exist in abundance, so why another one?"
|
||||||
|
|
||||||
|
#: templates/index.html:105
|
||||||
|
msgid "Aus zwei Gründen:"
|
||||||
|
msgstr "For two reasons:"
|
||||||
|
|
||||||
|
#: templates/index.html:106
|
||||||
|
msgid "Finde mal einen Datumsrechner, der nicht vollkommen verseucht mit Werbung, Tracking und Cookies ist!"
|
||||||
|
msgstr "Try to find a date calculator that isn't completely infested with ads, tracking and cookies!"
|
||||||
|
|
||||||
|
#: templates/index.html:107
|
||||||
|
msgid "Das hat mich so geärgert, dass ich meinen eigenen programmiert habe."
|
||||||
|
msgstr "This annoyed me so much that I programmed my own."
|
||||||
|
|
||||||
|
#: templates/index.html:108
|
||||||
|
msgid "Genau genommen nicht ich selbst. Diese App wurde zum überwiegenden Teil von KI nach meinen Anweisungen entwickelt (Vibe Coding)."
|
||||||
|
msgstr "Actually not me myself. This app was developed largely by AI following my instructions (Vibe Coding)."
|
||||||
|
|
||||||
|
#: templates/index.html:109
|
||||||
|
msgid "Was du noch wissen solltest"
|
||||||
|
msgstr "What else you should know"
|
||||||
|
|
||||||
|
#: templates/index.html:110
|
||||||
|
msgid "Ich habe versucht, die App möglichst barrierefrei zu gestalten, um Menschen mit Einschränkungen die Benutzung zu erleichtern."
|
||||||
|
msgstr "I have tried to make the app as accessible as possible to make it easier for people with disabilities to use."
|
||||||
|
|
||||||
|
#: templates/index.html:111
|
||||||
|
msgid "Diese App schnüffelt dir nicht hinterher, sammelt keine persönlichen Daten und geht dir auch sonst (hoffentlich!) in keiner Weise auf die Nerven."
|
||||||
|
msgstr "This app doesn't spy on you, doesn't collect personal data and doesn't get on your nerves in any other way (hopefully!)."
|
||||||
|
|
||||||
|
#: templates/index.html:112
|
||||||
|
msgid "Den Quellcode dieser App habe ich auf"
|
||||||
|
msgstr "I have published the source code of this app on"
|
||||||
|
|
||||||
|
#: templates/index.html:113
|
||||||
|
msgid "veröffentlicht, du kannst ihn einsehen, verändern oder damit deinen eigenen kleinen Datumsrechner betreiben."
|
||||||
|
msgstr "you can view it, modify it or use it to run your own small date calculator."
|
||||||
|
|
||||||
|
#: templates/index.html:114
|
||||||
|
msgid "Die App läuft auf meinem kleinen Home-Server und ist derzeit nicht für große Besucherzahlen ausgelegt."
|
||||||
|
msgstr "The app runs on my small home server and is currently not designed for large visitor numbers."
|
||||||
|
|
||||||
|
#: templates/index.html:115
|
||||||
|
msgid "Ich übernehme keine Gewähr für die Funktionalität und die Rechenergebnisse. Die KI, die das programmiert hat, übrigens auch nicht."
|
||||||
|
msgstr "I do not guarantee the functionality and calculation results. By the way, neither does the AI that programmed this."
|
||||||
|
|
||||||
|
#: templates/index.html:116
|
||||||
|
msgid "Falls du einen Fehler findest oder eine weitere Funktion wünschst, kannst du mir eine Mail schreiben (siehe Mailto Link in der Fußzeile)"
|
||||||
|
msgstr "If you find a bug or want an additional feature, you can write me an email (see mailto link in the footer)"
|
||||||
|
|
||||||
|
#: templates/index.html:117
|
||||||
|
msgid "Hab Spaß mit Elpatrons Datumsrechner! Dein M. Busche"
|
||||||
|
msgstr "Have fun with Elpatrons Date Calculator! Yours, M. Busche"
|
||||||
|
|
||||||
|
#: templates/index.html:118
|
||||||
|
msgid "Hilfe-Informationen für den Datumsrechner mit Erklärungen zu allen Funktionen"
|
||||||
|
msgstr "Help information for the date calculator with explanations of all functions"
|
||||||
|
|
||||||
|
#: templates/index.html:119
|
||||||
|
msgid "Dies ist ein werbe- und trackingfreier"
|
||||||
|
msgstr "This is an ad- and tracking-free"
|
||||||
|
|
||||||
|
#: templates/index.html:120
|
||||||
|
msgid "Open Source Datumsrechner"
|
||||||
|
msgstr "Open Source Date Calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:121
|
||||||
|
msgid "REST API Dokumentation (Swagger)"
|
||||||
|
msgstr "REST API Documentation (Swagger)"
|
||||||
|
|
||||||
|
#: templates/index.html:122
|
||||||
|
msgid "M. Busche"
|
||||||
|
msgstr "M. Busche"
|
||||||
|
|
||||||
|
#: app.py:123
|
||||||
|
msgid "Ungültige Eingabe"
|
||||||
|
msgstr "Invalid input"
|
||||||
|
|
||||||
|
#: app.py:124
|
||||||
|
msgid "Nicht unterstützt: Werktage + Wochen."
|
||||||
|
msgstr "Not supported: Workdays + weeks."
|
||||||
|
|
||||||
|
#: app.py:125
|
||||||
|
msgid "Nicht unterstützt: Werktage + Monate."
|
||||||
|
msgstr "Not supported: Workdays + months."
|
||||||
|
|
||||||
|
#: templates/index.html:126
|
||||||
|
msgid "Sprache auswählen"
|
||||||
|
msgstr "Select language"
|
||||||
|
|
||||||
|
#: templates/index.html:127
|
||||||
|
msgid "Deutsch auswählen"
|
||||||
|
msgstr "Select German"
|
||||||
|
|
||||||
|
#: templates/index.html:131
|
||||||
|
msgid "English auswählen"
|
||||||
|
msgstr "Select English"
|
||||||
|
|
||||||
|
#: templates/index.html:132
|
||||||
|
msgid "Taschenrechner"
|
||||||
|
msgstr "Calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:133
|
||||||
|
msgid "Taschenrechner öffnen"
|
||||||
|
msgstr "Open calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:134
|
||||||
|
msgid "Taschenrechner schließen"
|
||||||
|
msgstr "Close calculator"
|
||||||
|
|
||||||
|
#: templates/index.html:135
|
||||||
|
msgid "Verwenden Sie die Tab-Taste um durch die Tasten zu navigieren. Tastatur-Kurzbefehle: Zahlen 0-9, Punkt oder Komma für Dezimal, Plus (+) oder P für Addition, Minus (-) oder M für Subtraktion, Stern (*) oder X für Multiplikation, Schrägstrich (/) oder D für Division, Enter oder Leertaste für Gleich, C für Löschen, Backspace für letzte Ziffer löschen."
|
||||||
|
msgstr "Use the Tab key to navigate through the buttons. Keyboard shortcuts: Numbers 0-9, period or comma for decimal, Plus (+) or P for addition, Minus (-) or M for subtraction, Asterisk (*) or X for multiplication, Slash (/) or D for division, Enter or Space for equals, C for clear, Backspace for delete last digit."
|
||||||
|
|
||||||
|
#: templates/index.html:136
|
||||||
|
msgid "Taschenrechner Anzeige"
|
||||||
|
msgstr "Calculator display"
|
||||||
|
|
||||||
|
#: templates/index.html:137
|
||||||
|
msgid "Berechnungsverlauf"
|
||||||
|
msgstr "Calculation history"
|
||||||
|
|
||||||
|
#: templates/index.html:138
|
||||||
|
msgid "Löschen (Taste: C)"
|
||||||
|
msgstr "Clear (key: C)"
|
||||||
|
|
||||||
|
#: templates/index.html:139
|
||||||
|
msgid "Letzte Ziffer löschen (Taste: Backspace)"
|
||||||
|
msgstr "Delete last digit (key: Backspace)"
|
||||||
|
|
||||||
|
#: templates/index.html:140
|
||||||
|
msgid "Dividieren (Taste: / oder D)"
|
||||||
|
msgstr "Divide (key: / or D)"
|
||||||
|
|
||||||
|
#: templates/index.html:141
|
||||||
|
msgid "Multiplizieren (Taste: * oder X)"
|
||||||
|
msgstr "Multiply (key: * or X)"
|
||||||
|
|
||||||
|
#: templates/index.html:142
|
||||||
|
msgid "Sieben"
|
||||||
|
msgstr "Seven"
|
||||||
|
|
||||||
|
#: templates/index.html:143
|
||||||
|
msgid "Acht"
|
||||||
|
msgstr "Eight"
|
||||||
|
|
||||||
|
#: templates/index.html:144
|
||||||
|
msgid "Neun"
|
||||||
|
msgstr "Nine"
|
||||||
|
|
||||||
|
#: templates/index.html:145
|
||||||
|
msgid "Subtrahieren (Taste: - oder M)"
|
||||||
|
msgstr "Subtract (key: - or M)"
|
||||||
|
|
||||||
|
#: templates/index.html:146
|
||||||
|
msgid "Vier"
|
||||||
|
msgstr "Four"
|
||||||
|
|
||||||
|
#: templates/index.html:147
|
||||||
|
msgid "Fünf"
|
||||||
|
msgstr "Five"
|
||||||
|
|
||||||
|
#: templates/index.html:148
|
||||||
|
msgid "Sechs"
|
||||||
|
msgstr "Six"
|
||||||
|
|
||||||
|
#: templates/index.html:149
|
||||||
|
msgid "Addieren (Taste: + oder P)"
|
||||||
|
msgstr "Add (key: + or P)"
|
||||||
|
|
||||||
|
#: templates/index.html:150
|
||||||
|
msgid "Eins"
|
||||||
|
msgstr "One"
|
||||||
|
|
||||||
|
#: templates/index.html:151
|
||||||
|
msgid "Zwei"
|
||||||
|
msgstr "Two"
|
||||||
|
|
||||||
|
#: templates/index.html:152
|
||||||
|
msgid "Drei"
|
||||||
|
msgstr "Three"
|
||||||
|
|
||||||
|
#: templates/index.html:153
|
||||||
|
msgid "Gleich (Taste: Enter oder Leertaste)"
|
||||||
|
msgstr "Equals (key: Enter or Space)"
|
||||||
|
|
||||||
|
#: templates/index.html:154
|
||||||
|
msgid "Null"
|
||||||
|
msgstr "Zero"
|
||||||
|
|
||||||
|
#: templates/index.html:155
|
||||||
|
msgid "Komma (Taste: . oder ,)"
|
||||||
|
msgstr "Decimal (key: . or ,)"
|
||||||
|
|
||||||
|
#: templates/index.html:156
|
||||||
|
msgid "Fehler"
|
||||||
|
msgstr "Error"
|
||||||
|
|
||||||
|
#: templates/index.html:157
|
||||||
|
msgid "Berechnung"
|
||||||
|
msgstr "Calculation"
|
Reference in New Issue
Block a user