diff --git a/photo21/settings.py b/photo21/settings.py index 14f1e34..81f3ceb 100644 --- a/photo21/settings.py +++ b/photo21/settings.py @@ -222,9 +222,9 @@ MESSAGE_TAGS = { messages.ERROR: "alert-danger", } -# Allauth configuration +# Allauth configuration ## For the django =< 5.0 ACCOUNT_EMAIL_REQUIRED = True -# ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*'] +# ACCOUNT_SIGNUP_FIELDS = ['email*', 'username*', 'password1*', 'password2*'] ## For the django =< 5.0 ACCOUNT_EMAIL_VERIFICATION = "mandatory" ACCOUNT_AUTHENTICATION_METHOD = "username_email" # ACCOUNT_LOGIN_METHODS = {'username', 'email'} diff --git a/photo21/templates/base.html b/photo21/templates/base.html index 35ce854..66ea520 100644 --- a/photo21/templates/base.html +++ b/photo21/templates/base.html @@ -132,6 +132,7 @@ SPDX-License-Identifier: GPL-3.0-or-later + {% block extrajs %}{% endblock %} diff --git a/photo21/urls.py b/photo21/urls.py index 11ad96a..b3a036e 100644 --- a/photo21/urls.py +++ b/photo21/urls.py @@ -12,6 +12,7 @@ from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import include, path, re_path +from django.views.i18n import JavaScriptCatalog if settings.DEBUG : from debug_toolbar.toolbar import debug_toolbar_urls @@ -23,6 +24,7 @@ urlpatterns = [ path("", include("photologue.urls", namespace="photologue")), path("accounts/", include("allauth.urls")), path("i18n/", include("django.conf.urls.i18n")), + path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'), path("admin/doc/", include("django.contrib.admindocs.urls")), path("admin/", admin.site.urls), ] diff --git a/photologue/locale/de/LC_MESSAGES/djangojs.po b/photologue/locale/de/LC_MESSAGES/djangojs.po new file mode 100644 index 0000000..c2c1c0a --- /dev/null +++ b/photologue/locale/de/LC_MESSAGES/djangojs.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-11-22 22:53+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \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" +#: .\photologue\static\upload.js:52 +msgid "Continious Upload" +msgstr "Kontinuierlicher Upload" + +#: .\photologue\static\upload.js:62 .\photologue\static\upload.js:113 +msgid "Please be patient" +msgstr "Please be patient" + +#: .\photologue\static\upload.js:139 +msgid "Upload Complete Please reload the page" +msgstr "Upload abgeschlossen. Bitte laden Sie die Seite neu." diff --git a/photologue/locale/es/LC_MESSAGES/djangojs.po b/photologue/locale/es/LC_MESSAGES/djangojs.po new file mode 100644 index 0000000..ad61221 --- /dev/null +++ b/photologue/locale/es/LC_MESSAGES/djangojs.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-11-22 22:53+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? " +"1 : 2;\n" +#: .\photologue\static\upload.js:52 +msgid "Continious Upload" +msgstr "Carga continua" + +#: .\photologue\static\upload.js:62 .\photologue\static\upload.js:113 +msgid "Please be patient" +msgstr "espera por favor" + +#: .\photologue\static\upload.js:139 +msgid "Upload Complete Please reload the page" +msgstr "Carga completa Por favor recarga la página" diff --git a/photologue/locale/fr/LC_MESSAGES/djangojs.po b/photologue/locale/fr/LC_MESSAGES/djangojs.po new file mode 100644 index 0000000..63b80e4 --- /dev/null +++ b/photologue/locale/fr/LC_MESSAGES/djangojs.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , 2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-11-22 22:53+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \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" +#: .\photologue\static\upload.js:52 +msgid "Continious Upload" +msgstr "Téléversement Continu" + +#: .\photologue\static\upload.js:62 .\photologue\static\upload.js:113 +msgid "Please be patient" +msgstr "Merci d'être patient" + +#: .\photologue\static\upload.js:139 +msgid "Upload Complete Please reload the page" +msgstr "Téléversement terminé Merci de recharger la page" diff --git a/photologue/static/upload.js b/photologue/static/upload.js index 23a927e..444189e 100644 --- a/photologue/static/upload.js +++ b/photologue/static/upload.js @@ -49,7 +49,7 @@ submitbtn = document.getElementById('submit-id-submit'); var ctnbtn = document.createElement("input"); ctnbtn.classList = submitbtn.classList; -ctnbtn.value="Continious Upload"; +ctnbtn.value=gettext("Continious Upload"); ctnbtn.type = "button"; async function uplaodfnc() { @@ -59,7 +59,7 @@ async function uplaodfnc() { submitbtn.disabled = true; ctnbtn.disabled = true; actual = 0; - ctnbtn.value = "Please be patient 0% (" + actual + "/" + files.length + ")"; + ctnbtn.value = gettext("Please be patient")+" 0% (" + actual + "/" + files.length + ")"; csrfvalue = document.getElementsByName("csrfmiddlewaretoken")[0].value; @@ -110,7 +110,7 @@ async function uplaodfnc() { if (!okpass) { window.alert("Error with " + file.name + "code" + await response.code); } - ctnbtn.value = "Please be patient " + Math.round(100 * actual / total) + "% (" + actual + "/" + files.length + ")"; + ctnbtn.value = gettext("Please be patient")+" " + Math.round(100 * actual / total) + "% (" + actual + "/" + files.length + ")"; } catch (e) { console.error(e); @@ -136,7 +136,7 @@ async function uplaodfnc() { }); returned = await response.json(); - ctnbtn.value = "Upload Complete Please reload the page"; + ctnbtn.value = gettext("Upload Complete Please reload the page"); }