Localize error pages & update lang in html tag

This commit is contained in:
Nyymix 2025-05-04 22:03:07 +03:00
parent 232ac6193a
commit ff8328b4e3
6 changed files with 63 additions and 24 deletions

View file

@ -1,8 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> {% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE }}">
{% load static %}
<head> <head>
{% load static %}
{% load i18n %}
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{% trans "Muistox Photo Gallery" %}"> <meta name="description" content="{% trans "Muistox Photo Gallery" %}">

View file

@ -150,3 +150,24 @@ msgstr "Nyymix.net Gallery"
msgid "Page %(current)s of %(total)s" msgid "Page %(current)s of %(total)s"
msgstr "Page %(current)s of %(total)s" msgstr "Page %(current)s of %(total)s"
msgid "404 - Page not found"
msgstr "404 - Page not found"
msgid "Sorry, we couldnt find the page you were looking for."
msgstr "Sorry, we couldnt find the page you were looking for."
msgid "Youll be redirected to the homepage in a few seconds."
msgstr "Youll be redirected to the homepage in a few seconds."
msgid "Return to homepage"
msgstr "Return to homepage"
msgid "500 - Server Error"
msgstr "500 - Server Error"
msgid "Oops! Something went wrong on our end."
msgstr "HOops! Something went wrong on our end."
msgid "Were working to fix it — youll be redirected shortly."
msgstr "Were working to fix it — youll be redirected shortly."

View file

@ -150,3 +150,24 @@ msgstr "Nyymix.net kuvagalleria"
msgid "Page %(current)s of %(total)s" msgid "Page %(current)s of %(total)s"
msgstr "Sivu %(current)s / %(total)s" msgstr "Sivu %(current)s / %(total)s"
msgid "404 - Page not found"
msgstr "404 - Sivua ei löytynyt"
msgid "Sorry, we couldnt find the page you were looking for."
msgstr "Valitettavasti etsimääsi sivua ei löytynyt."
msgid "Youll be redirected to the homepage in a few seconds."
msgstr "Sinut ohjataan etusivulle muutaman sekunnin kuluttua."
msgid "Return to homepage"
msgstr "Palaa etusivulle"
msgid "500 - Server Error"
msgstr "500 Palvelinvirhe"
msgid "Oops! Something went wrong on our end."
msgstr "Hups! Jotain meni pieleen palvelimella."
msgid "Were working to fix it — youll be redirected shortly."
msgstr "Työskentelemme ongelman korjaamiseksi — sinut ohjataan pian uudelleen."

View file

@ -1,14 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> {% load i18n %}
<html lang="{% get_current_language %}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404 - Page not found</title> <title>{% trans "404 - Page not found" %}</title>
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/css/uikit.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit-icons.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit-icons.min.js"></script>
@ -21,11 +19,11 @@
<span uk-icon="icon: warning; ratio: 4" class="uk-text-danger uk-animation-fade"></span> <span uk-icon="icon: warning; ratio: 4" class="uk-text-danger uk-animation-fade"></span>
<h1 class="uk-heading-medium uk-heading-hero@s uk-text-bold uk-margin-small-top">404</h1> <h1 class="uk-heading-medium uk-heading-hero@s uk-text-bold uk-margin-small-top">404</h1>
<p class="uk-text-large uk-text-muted"> <p class="uk-text-large uk-text-muted">
Sorry, we couldnt find the page you were looking for.<br> {% trans "Sorry, we couldnt find the page you were looking for." %}<br>
Youll be redirected to the homepage in a few seconds. {% trans "Youll be redirected to the homepage in a few seconds." %}
</p> </p>
<a href="/" class="uk-button uk-button-primary uk-margin-top"> <a href="/" class="uk-button uk-button-primary uk-margin-top">
<span uk-icon="home"></span> Return to homepage <span uk-icon="home"></span> {% trans "Return to homepage" %}
</a> </a>
</div> </div>
</div> </div>

View file

@ -1,18 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> {% load i18n %}
<html lang="{% get_current_language %}">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>500 - Server Error</title> <title>{% trans "500 - Server Error" %}</title>
<!-- UIkit CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/css/uikit.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/css/uikit.min.css" />
<!-- UIkit JS -->
<script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit-icons.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/uikit@3.23.6/dist/js/uikit-icons.min.js"></script>
<!-- Redirect to homepage after 3s -->
<meta http-equiv="refresh" content="3;url=/" /> <meta http-equiv="refresh" content="3;url=/" />
</head> </head>
<body class="uk-background-muted uk-light"> <body class="uk-background-muted uk-light">
@ -22,11 +19,11 @@
<span uk-icon="icon: bolt; ratio: 4" class="uk-text-danger uk-animation-fade"></span> <span uk-icon="icon: bolt; ratio: 4" class="uk-text-danger uk-animation-fade"></span>
<h1 class="uk-heading-medium uk-heading-hero@s uk-text-bold uk-margin-small-top">500</h1> <h1 class="uk-heading-medium uk-heading-hero@s uk-text-bold uk-margin-small-top">500</h1>
<p class="uk-text-large uk-text-muted"> <p class="uk-text-large uk-text-muted">
Oops! Something went wrong on our end.<br> {% trans "Oops! Something went wrong on our end." %}<br>
Were working to fix it — youll be redirected shortly. {% trans "Were working to fix it — youll be redirected shortly." %}
</p> </p>
<a href="/" class="uk-button uk-button-primary uk-margin-top"> <a href="/" class="uk-button uk-button-primary uk-margin-top">
<span uk-icon="home"></span> Return to homepage <span uk-icon="home"></span> {% trans "Return to homepage" %}
</a> </a>
</div> </div>
</div> </div>

View file

@ -1,7 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en">
{% load static %}
{% load i18n %} {% load i18n %}
{% get_current_language as LANGUAGE_CODE %}
<html lang="{{ LANGUAGE_CODE }}">
{% load static %}
{% load top_tags %} {% load top_tags %}
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">