Semi-stable version with old variable names
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>400 - Bad Request</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 400;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Ungültige Anfrage</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 400</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Ihre Anfrage ist fehlerhaft und das gesuchtes Ziel kann nicht gefunden werden.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>400 - Bad Request</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 400;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Ungültige Anfrage</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 400</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="phpContent" id="phpMessage">
|
||||
<?= htmlspecialchars($message ?? '') ?>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Ihre Anfrage ist fehlerhaft und das gesuchtes Ziel kann nicht gefunden werden.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>403 - Forbidden</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 403;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Anfrage verboten</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 403</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Sie haben keine Berechtigung diesen Inhalt anzuzeigen.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>429 - Too many Requests</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 429;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Zu viele Anfragen</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 429</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Ihr Netzwerk sendet aktuell zu viele Anfragen an diese Webseite, weshalb diese IP-Adresse temporär blockiert wurde. Versuchen Sie die Seite in wenigen Sekunden neu zu laden.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>500 - Internal Server Error</title>
|
||||
<link rel="icon" type="image/png" href="/intern/img/icon.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="/error-pages/style.css">
|
||||
<script>
|
||||
window.ERROR_CODE = 500;
|
||||
</script>
|
||||
<script src="/error-pages/translations.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h1 id="title">Kritischer Fehler beim Laden der Seite</h1>
|
||||
<p id="subtitle">HTTP Fehlercode 500</p>
|
||||
</div>
|
||||
|
||||
<div class="lang-switcher">
|
||||
<select class="lang-select" id="langSelect" onchange="translatePage(this.value)">
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="en">English</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="it">Italiano</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="content" id="message">
|
||||
Diese Seite konnte aufgrund von Problemen auf dem Server nicht geladen werden. Bitte versuchen Sie es später erneut. Die Behebung dieses Fehlers kann einige Zeit in Anspruch nehmen.
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,104 @@
|
||||
/* Modern reset and centering */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
color: #1f2937;
|
||||
min-height: 100vh;
|
||||
padding: 20vh 60px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 40px;
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
body {
|
||||
padding: 15vh 10px;
|
||||
}
|
||||
|
||||
section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 32px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Header section with warning color */
|
||||
.header h1 {
|
||||
font-size: 48px;
|
||||
letter-spacing: 2px;
|
||||
color: #36454F;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
font-size: 14px;
|
||||
letter-spacing: 0.05em;
|
||||
color: #6b7280;
|
||||
font-weight: 600;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
/* Sleek Language Dropdown Container */
|
||||
.lang-switcher {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.lang-select {
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
color: #4b5563;
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
padding: 6px 32px 6px 12px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
appearance: none;
|
||||
/* Removes native browser arrow */
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat;
|
||||
background-position: right 8px center;
|
||||
background-size: 16px;
|
||||
transition: border-color 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
|
||||
.lang-select:hover,
|
||||
.lang-select:focus {
|
||||
border-color: #01CB8E;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
/* Divider line */
|
||||
.header::after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: min(120px, 50vw);
|
||||
height: 3px;
|
||||
background-color: #01CB8E;
|
||||
margin: 0 0 24px 0;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* PHP Text */
|
||||
.phpContent {
|
||||
font-size: 24px;
|
||||
line-height: 1.6;
|
||||
color: #4b5563;
|
||||
}
|
||||
|
||||
/* Main text */
|
||||
.content {
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
color: #4b5563a2;
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
const translations = {
|
||||
429: {
|
||||
de: {
|
||||
title: "Zu viele Anfragen",
|
||||
subtitle: "HTTP Fehlercode 429",
|
||||
message: "Ihr Netzwerk sendet aktuell zu viele Anfragen an diese Webseite, weshalb diese IP-Adresse temporär blockiert wurde. Versuchen Sie die Seite in wenigen Sekunden neu zu laden."
|
||||
},
|
||||
en: {
|
||||
title: "Too Many Requests",
|
||||
subtitle: "HTTP Error Code 429",
|
||||
message: "Your network is currently sending too many requests to this website, which is why this IP address has been temporarily blocked. Please try reloading the page in a few seconds."
|
||||
},
|
||||
fr: {
|
||||
title: "Trop de requêtes",
|
||||
subtitle: "Code d'erreur HTTP 429",
|
||||
message: "Votre réseau envoie actuellement trop de requêtes à ce site web, c'est pourquoi cette adresse IP a été temporairement bloquée. Veuillez réessayer de charger la page dans quelques secondes."
|
||||
},
|
||||
it: {
|
||||
title: "Troppe richieste",
|
||||
subtitle: "Codice di errore HTTP 429",
|
||||
message: "La tua rete sta attualmente inviando troppe richieste a questo sito web, motivo per cui questo indirizzo IP è stato temporaneamente bloccato. Prova a ricaricare la pagina tra pochi secondi."
|
||||
}
|
||||
},
|
||||
403: {
|
||||
de: {
|
||||
title: "Anfrage verboten",
|
||||
subtitle: "HTTP Fehlercode 403",
|
||||
message: "Sie haben keine Berechtigung diesen Inhalt anzuzeigen."
|
||||
},
|
||||
en: {
|
||||
title: "Forbidden",
|
||||
subtitle: "HTTP Error Code 403",
|
||||
message: "You do not have permission to view this content."
|
||||
},
|
||||
fr: {
|
||||
title: "Accès interdit",
|
||||
subtitle: "Code d'erreur HTTP 403",
|
||||
message: "Vous n'avez pas l'autorisation d'afficher ce contenu."
|
||||
},
|
||||
it: {
|
||||
title: "Accesso vietato",
|
||||
subtitle: "Codice di errore HTTP 403",
|
||||
message: "Non hai il permesso di visualizzare questo contenuto."
|
||||
}
|
||||
},
|
||||
400: {
|
||||
de: {
|
||||
title: "Ungültige Anfrage",
|
||||
subtitle: "HTTP Fehlercode 400",
|
||||
message: "Ihre Anfrage ist fehlerhaft und das gesuchte Ziel kann nicht gefunden werden."
|
||||
},
|
||||
en: {
|
||||
title: "Bad Request",
|
||||
subtitle: "HTTP Error Code 400",
|
||||
message: "Your request is malformed and the destination you are looking for cannot be found."
|
||||
},
|
||||
fr: {
|
||||
title: "Requête incorrecte",
|
||||
subtitle: "Code d'erreur HTTP 400",
|
||||
message: "Votre requête est incorrecte et la destination recherchée est introuvable."
|
||||
},
|
||||
it: {
|
||||
title: "Richiesta errata",
|
||||
subtitle: "Codice di errore HTTP 400",
|
||||
message: "La tua richiesta è errata e la destinazione cercata non è rintracciabile."
|
||||
}
|
||||
},
|
||||
500: {
|
||||
de: {
|
||||
title: "Kritischer Fehler beim Laden der Seite",
|
||||
subtitle: "HTTP Fehlercode 500",
|
||||
message: "Diese Seite konnte aufgrund von Problemen auf dem Server nicht geladen werden. Bitte versuchen Sie es später erneut. Die Behebung dieses Fehlers kann einige Zeit in Anspruch nehmen."
|
||||
},
|
||||
en: {
|
||||
title: "Critical Error Loading Page",
|
||||
subtitle: "HTTP Error Code 500",
|
||||
message: "This page could not be loaded due to problems on the server. Please try again later. Resolving this error may take some time."
|
||||
},
|
||||
fr: {
|
||||
title: "Erreur critique lors du chargement de la page",
|
||||
subtitle: "Code d'erreur HTTP 500",
|
||||
message: "Cette page n'a pas pu être chargée en raison de problèmes sur le serveur. Veuillez réessayer plus tard. La résolution de cette erreur peut prendre un certain temps."
|
||||
},
|
||||
it: {
|
||||
title: "Errore critico durante il caricamento della pagina",
|
||||
subtitle: "Codice di errore HTTP 500",
|
||||
message: "Impossibile caricare la pagina a causa di problemi sul server. Si prega di riprovare più tardi. La risoluzione di questo errore potrebbe richiedere del tempo."
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const errortype = window.ERROR_CODE;
|
||||
|
||||
function translatePage(lang) {
|
||||
document.documentElement.lang = lang;
|
||||
|
||||
document.getElementById('title').textContent = translations[errortype][lang].title;
|
||||
document.getElementById('subtitle').textContent = translations[errortype][lang].subtitle;
|
||||
document.getElementById('message').textContent = translations[errortype][lang].message;
|
||||
}
|
||||
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
const browserLang = navigator.language || navigator.userLanguage;
|
||||
|
||||
const shortLang = browserLang.toLowerCase().split('-')[0];
|
||||
|
||||
const supportedLangs = ['de', 'en', 'fr', 'it'];
|
||||
|
||||
if (supportedLangs.includes(shortLang)) {
|
||||
const selectEl = document.getElementById('langSelect');
|
||||
selectEl.value = shortLang; // Changes the dropdown visual state
|
||||
translatePage(shortLang); // Runs your translation function
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user