diff --git a/gawa/gawa/settings.py b/gawa/gawa/settings.py index d3ecb62..2f61154 100644 --- a/gawa/gawa/settings.py +++ b/gawa/gawa/settings.py @@ -53,6 +53,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.locale.LocaleMiddleware', ] ROOT_URLCONF = 'gawa.urls' @@ -115,6 +116,8 @@ AUTH_PASSWORD_VALIDATORS = [ # https://docs.djangoproject.com/en/3.2/topics/i18n/ LANGUAGE_CODE = 'de-De' +# treat this ^^^ as the default +prefix_default_language = False TIME_ZONE = 'CET' diff --git a/gawa/gawa/urls.py b/gawa/gawa/urls.py index 085ec84..bdb7d74 100644 --- a/gawa/gawa/urls.py +++ b/gawa/gawa/urls.py @@ -13,6 +13,7 @@ Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ +from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from django.urls import include, path @@ -21,3 +22,8 @@ urlpatterns = [ path("blog/", include("blog.urls")), path('admin/', admin.site.urls), ] +urlpatterns += i18n_patterns( + path("", include("start.urls")), + path("blog/", include("blog.urls")), + path('admin/', admin.site.urls), +) diff --git a/gawa/start/locale/de/LC_MESSAGES/django.mo b/gawa/start/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 0000000..b640b31 Binary files /dev/null and b/gawa/start/locale/de/LC_MESSAGES/django.mo differ diff --git a/gawa/start/locale/de/LC_MESSAGES/django.po b/gawa/start/locale/de/LC_MESSAGES/django.po index 1cd68a6..383c38f 100644 --- a/gawa/start/locale/de/LC_MESSAGES/django.po +++ b/gawa/start/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-29 22:26+0200\n" +"POT-Creation-Date: 2023-05-29 23:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,10 +17,54 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: start/templates/start/base.html:21 + +#: start/templates/start/base.html:16 start/templates/start/index.html:5 +msgid "cscherr.de" +msgstr "cscherr.de" + +#: start/templates/start/base.html:24 msgid "Start" msgstr "Start" -#: start/templates/start/base.html:24 +#: start/templates/start/base.html:27 msgid "Blog" msgstr "Blog" + +#: start/templates/start/base.html:80 +msgid "" +"\n" +" Ich habe diese Website selbst programmiert und " +"gehostet. \n" +" Falls Sie einen Fehler belibiger Art finden, " +"würde ich mich freuen, \n" +" wenn Sie mich darüber benachrichtigen.\n" +"

\n" +" Die Suche nach Schwachstellen und Fehlern auf " +"dieser Website ist für \n" +" diesen Zweck ausdrücklich erlaubt.\n" +" " +msgstr "" +"\n" +"Ich habe diese Website selbst programmiert und gehostet.\n" +"Falls Sie einen Fehler belibiger Art finden\n" +"würde ich mich freuen, wenn Sie mich darüber benachrichtigen.\n" +"

\n" +"Die Suche nach Schwachstellen und Fehlern auf\n" +"dieser Website ist für diesen Zweck ausdrücklich erlaubt.\n" +" " + +#: start/templates/start/base.html:101 +msgid "Quellcode dieser Website" +msgstr "Quellcode dieser Website" + +#: start/templates/start/base.html:110 +msgid "Contact" +msgstr "Kontakt" + +#: start/templates/start/base.html:115 +msgid "Deutschland" +msgstr "Deutschland" + +#: start/templates/start/index.html:5 +msgid "startpage" +msgstr "Startseite" diff --git a/gawa/start/locale/en/LC_MESSAGES/django.mo b/gawa/start/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000..a364405 Binary files /dev/null and b/gawa/start/locale/en/LC_MESSAGES/django.mo differ diff --git a/gawa/start/locale/en/LC_MESSAGES/django.po b/gawa/start/locale/en/LC_MESSAGES/django.po index 1cd68a6..9c9d273 100644 --- a/gawa/start/locale/en/LC_MESSAGES/django.po +++ b/gawa/start/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-29 22:26+0200\n" +"POT-Creation-Date: 2023-05-29 23:20+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,10 +17,50 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: start/templates/start/base.html:21 + +#: start/templates/start/base.html:16 start/templates/start/index.html:5 +msgid "cscherr.de" +msgstr "cscherr.de" + +#: start/templates/start/base.html:24 msgid "Start" msgstr "Start" -#: start/templates/start/base.html:24 +#: start/templates/start/base.html:27 msgid "Blog" msgstr "Blog" + +#: start/templates/start/base.html:80 +msgid "" +"\n" +" Ich habe diese Website selbst programmiert und " +"gehostet. \n" +" Falls Sie einen Fehler belibiger Art finden, " +"würde ich mich freuen, \n" +" wenn Sie mich darüber benachrichtigen.\n" +"

\n" +" Die Suche nach Schwachstellen und Fehlern auf " +"dieser Website ist für \n" +" diesen Zweck ausdrücklich erlaubt.\n" +" " +msgstr "" +"I have programmed and hosted this Website by myself. If you find any issues or bugs,\n" +"please contact me about it.\n" +"

\n" +"I specifically allow the search for any issues this website might have.\n" + +#: start/templates/start/base.html:101 +msgid "Quellcode dieser Website" +msgstr "Source code of this website" + +#: start/templates/start/base.html:110 +msgid "Contact" +msgstr "Contakt" + +#: start/templates/start/base.html:115 +msgid "Deutschland" +msgstr "Germany" + +#: start/templates/start/index.html:5 +msgid "startpage" +msgstr "startpage" diff --git a/gawa/start/templates/start/base.html b/gawa/start/templates/start/base.html index 484cee5..8f11acb 100644 --- a/gawa/start/templates/start/base.html +++ b/gawa/start/templates/start/base.html @@ -97,6 +97,9 @@

Selfhosted Git

+

+ {% trans "Quellcode dieser Website" %} +