diff --git a/.gitignore b/.gitignore index d5f5cbe7..2ea7251b 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,6 @@ coverage.xml .hypothesis/ # Translations -*.mo *.pot # Django stuff: diff --git a/Makefile b/Makefile index 9d939192..a2da4778 100644 --- a/Makefile +++ b/Makefile @@ -67,3 +67,11 @@ flush: ## Flush the database .PHONY: dump dump: ## dump alexandria data @docker compose run --rm alexandria ./manage.py dumpdata alexandria_core | jq > initial_data.json + +.PHONY: makemessages +makemessages: ## Update translation files for all languages + @docker compose run --rm --no-deps alexandria ./manage.py makemessages -a --add-location file + +.PHONY: compilemessages +compilemessages: ## Generate compiled translation files + @docker compose run --rm --no-deps alexandria ./manage.py compilemessages diff --git a/alexandria/locale/de/LC_MESSAGES/django.mo b/alexandria/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 00000000..d99c58d9 Binary files /dev/null and b/alexandria/locale/de/LC_MESSAGES/django.mo differ diff --git a/alexandria/locale/de/LC_MESSAGES/django.po b/alexandria/locale/de/LC_MESSAGES/django.po index bdbecb67..9fed32cb 100644 --- a/alexandria/locale/de/LC_MESSAGES/django.po +++ b/alexandria/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: 2025-02-18 13:29+0000\n" +"POT-Creation-Date: 2025-02-18 14:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,79 +18,77 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: alexandria/core/api.py:25 +#: alexandria/core/api.py msgid "(copy)" msgstr "(Kopie)" -#: alexandria/core/models.py:44 +#: alexandria/core/models.py msgid "Created by user" msgstr "Erstellt durch Benutzer" -#: alexandria/core/models.py:47 +#: alexandria/core/models.py msgid "Created by group" msgstr "Erstellt durch Gruppe" -#: alexandria/core/models.py:51 +#: alexandria/core/models.py msgid "Modified by user" msgstr "Bearbeitet durch Benutzer" -#: alexandria/core/models.py:54 +#: alexandria/core/models.py msgid "Modified by group" msgstr "Bearbeitet durch Gruppe" -#: alexandria/core/models.py:56 +#: alexandria/core/models.py msgid "Metainfo" msgstr "Metainformationen" -#: alexandria/core/models.py:91 +#: alexandria/core/models.py msgid "Please enter a valid HEX color code." msgstr "Bitte geben Sie einen validen HEX Farbcode ein." -#: alexandria/core/models.py:96 alexandria/core/models.py:129 -#: alexandria/core/models.py:143 alexandria/core/models.py:233 +#: alexandria/core/models.py msgid "Name" msgstr "Name" -#: alexandria/core/models.py:98 alexandria/core/models.py:131 -#: alexandria/core/models.py:145 alexandria/core/models.py:151 +#: alexandria/core/models.py msgid "Description" msgstr "Beschreibung" -#: alexandria/core/models.py:104 +#: alexandria/core/models.py msgid "Allowed mime types" msgstr "Erlaubte Dateitypen" -#: alexandria/core/models.py:150 +#: alexandria/core/models.py msgid "Title" msgstr "Titel" -#: alexandria/core/models.py:237 +#: alexandria/core/models.py msgid "Checksum" msgstr "Checksumme" -#: alexandria/core/validations.py:31 +#: alexandria/core/validations.py msgid "File is infected with malware." msgstr "Datei ist mit Malware infiziert" -#: alexandria/core/validations.py:35 +#: alexandria/core/validations.py msgid "Malware scan had an error: " msgstr "Malware-Scan hatte einen Fehler:" -#: alexandria/core/validations.py:53 +#: alexandria/core/validations.py #, python-format msgid "File type %(mime_type)s is not allowed in category %(category)s." msgstr "" "Dateityp %(mime_type)s ist in der Kategorie %(category)s nicht erlaubt." -#: alexandria/core/validations.py:71 +#: alexandria/core/validations.py msgid "Missing Content-Type header" msgstr "Fehlender Content-Type header" -#: alexandria/core/validations.py:73 +#: alexandria/core/validations.py msgid "Unknown file extension" msgstr "Unbekannte Dateiendung" -#: alexandria/core/validations.py:80 +#: alexandria/core/validations.py #, python-format msgid "" "Content-Type %(content_type)s does not match file extension %(extension)s." @@ -98,7 +96,7 @@ msgstr "" "Content-Type %(content_type) stimmt nicht mit der Dateiendung %(extension)s " "überein." -#: alexandria/core/validations.py:92 +#: alexandria/core/validations.py #, python-format msgid "" "Content-Type %(content_type)s does not match detected file content " @@ -107,29 +105,29 @@ msgstr "" "Content-Type %(content_type)s stimmt nicht mit dem erkannten Dateityp " "%(file_content_type)s überein." -#: alexandria/core/views.py:149 +#: alexandria/core/views.py msgid "PDF conversion is not enabled." msgstr "PDF-Konvertierung ist nicht aktiviert." -#: alexandria/core/views.py:246 +#: alexandria/core/views.py msgid "\"files\" filter is mandatory!" msgstr "Der Filter \"files\" ist obligatorisch!" -#: alexandria/core/views.py:258 +#: alexandria/core/views.py msgid "The \"files\" filter must consist of a comma delimited list of UUIDs!" msgstr "" "Der \"files\" Filter muss aus einer kommaseparierten Liste von UUIDs " "bestehen!" -#: alexandria/core/views.py:276 +#: alexandria/core/views.py msgid "For downloading a file use the presigned download URL." msgstr "" "Zum Herunterladen einer Datei verwenden Sie die vorgegebene Download-URL." -#: alexandria/core/views.py:301 +#: alexandria/core/views.py msgid "WebDAV is not enabled." msgstr "WebDAV ist nicht aktiviert." -#: alexandria/core/views.py:311 +#: alexandria/core/views.py msgid "WebDAV is not enabled for this mime type." msgstr "WebDAV ist für diesen Dateityp nicht aktiviert" diff --git a/alexandria/locale/en/LC_MESSAGES/django.mo b/alexandria/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 00000000..71cbdf3e Binary files /dev/null and b/alexandria/locale/en/LC_MESSAGES/django.mo differ diff --git a/alexandria/locale/en/LC_MESSAGES/django.po b/alexandria/locale/en/LC_MESSAGES/django.po index f5d5ddfc..88d6f361 100644 --- a/alexandria/locale/en/LC_MESSAGES/django.po +++ b/alexandria/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: 2025-02-18 13:29+0000\n" +"POT-Creation-Date: 2025-02-18 14:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,110 +18,108 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: alexandria/core/api.py:25 +#: alexandria/core/api.py msgid "(copy)" msgstr "" -#: alexandria/core/models.py:44 +#: alexandria/core/models.py msgid "Created by user" msgstr "" -#: alexandria/core/models.py:47 +#: alexandria/core/models.py msgid "Created by group" msgstr "" -#: alexandria/core/models.py:51 +#: alexandria/core/models.py msgid "Modified by user" msgstr "" -#: alexandria/core/models.py:54 +#: alexandria/core/models.py msgid "Modified by group" msgstr "" -#: alexandria/core/models.py:56 +#: alexandria/core/models.py msgid "Metainfo" msgstr "" -#: alexandria/core/models.py:91 +#: alexandria/core/models.py msgid "Please enter a valid HEX color code." msgstr "" -#: alexandria/core/models.py:96 alexandria/core/models.py:129 -#: alexandria/core/models.py:143 alexandria/core/models.py:233 +#: alexandria/core/models.py msgid "Name" msgstr "" -#: alexandria/core/models.py:98 alexandria/core/models.py:131 -#: alexandria/core/models.py:145 alexandria/core/models.py:151 +#: alexandria/core/models.py msgid "Description" msgstr "" -#: alexandria/core/models.py:104 +#: alexandria/core/models.py msgid "Allowed mime types" msgstr "" -#: alexandria/core/models.py:150 +#: alexandria/core/models.py msgid "Title" msgstr "" -#: alexandria/core/models.py:237 +#: alexandria/core/models.py msgid "Checksum" msgstr "" -#: alexandria/core/validations.py:31 +#: alexandria/core/validations.py msgid "File is infected with malware." msgstr "" -#: alexandria/core/validations.py:35 +#: alexandria/core/validations.py msgid "Malware scan had an error: " msgstr "" -#: alexandria/core/validations.py:53 +#: alexandria/core/validations.py #, python-format msgid "File type %(mime_type)s is not allowed in category %(category)s." msgstr "" -#: alexandria/core/validations.py:71 +#: alexandria/core/validations.py msgid "Missing Content-Type header" msgstr "" -#: alexandria/core/validations.py:73 +#: alexandria/core/validations.py msgid "Unknown file extension" msgstr "" -#: alexandria/core/validations.py:80 +#: alexandria/core/validations.py #, python-format msgid "" "Content-Type %(content_type)s does not match file extension %(extension)s." msgstr "" -#: alexandria/core/validations.py:92 +#: alexandria/core/validations.py #, python-format msgid "" "Content-Type %(content_type)s does not match detected file content " "%(file_content_type)s." msgstr "" -#: alexandria/core/views.py:149 +#: alexandria/core/views.py msgid "PDF conversion is not enabled." msgstr "" -#: alexandria/core/views.py:246 +#: alexandria/core/views.py msgid "\"files\" filter is mandatory!" msgstr "" -#: alexandria/core/views.py:258 +#: alexandria/core/views.py msgid "The \"files\" filter must consist of a comma delimited list of UUIDs!" msgstr "" -#: alexandria/core/views.py:276 +#: alexandria/core/views.py msgid "For downloading a file use the presigned download URL." msgstr "" -#: alexandria/core/views.py:301 +#: alexandria/core/views.py msgid "WebDAV is not enabled." msgstr "" -#: alexandria/core/views.py:311 +#: alexandria/core/views.py msgid "WebDAV is not enabled for this mime type." msgstr "" diff --git a/alexandria/locale/it/LC_MESSAGES/django.mo b/alexandria/locale/it/LC_MESSAGES/django.mo new file mode 100644 index 00000000..863e87d5 Binary files /dev/null and b/alexandria/locale/it/LC_MESSAGES/django.mo differ diff --git a/alexandria/locale/it/LC_MESSAGES/django.po b/alexandria/locale/it/LC_MESSAGES/django.po new file mode 100644 index 00000000..b44d6eb0 --- /dev/null +++ b/alexandria/locale/it/LC_MESSAGES/django.po @@ -0,0 +1,132 @@ +# 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-02-18 14:03+0000\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" + +#: alexandria/core/api.py +msgid "(copy)" +msgstr "(copia)" + +#: alexandria/core/models.py +msgid "Created by user" +msgstr "Creato da utente" + +#: alexandria/core/models.py +msgid "Created by group" +msgstr "Creato da gruppo" + +#: alexandria/core/models.py +msgid "Modified by user" +msgstr "Modificato da utente" + +#: alexandria/core/models.py +msgid "Modified by group" +msgstr "Modificato da gruppo" + +#: alexandria/core/models.py +msgid "Metainfo" +msgstr "Metadati" + +#: alexandria/core/models.py +msgid "Please enter a valid HEX color code." +msgstr "Inserire un codice colore HEX valido." + +#: alexandria/core/models.py +msgid "Name" +msgstr "Nome" + +#: alexandria/core/models.py +msgid "Description" +msgstr "Descrizione" + +#: alexandria/core/models.py +msgid "Allowed mime types" +msgstr "Tipi di file consentiti" + +#: alexandria/core/models.py +msgid "Title" +msgstr "Titolo" + +#: alexandria/core/models.py +msgid "Checksum" +msgstr "Checksum" + +#: alexandria/core/validations.py +msgid "File is infected with malware." +msgstr "Il file è infetto da malware." + +#: alexandria/core/validations.py +msgid "Malware scan had an error: " +msgstr "La scansione del malware ha avuto un errore: " + +#: alexandria/core/validations.py +#, python-format +msgid "File type %(mime_type)s is not allowed in category %(category)s." +msgstr "" +"Il tipo di file %(mime_type)s non è consentito nella categoria %(category)s." + +#: alexandria/core/validations.py +msgid "Missing Content-Type header" +msgstr "Intestazione Content-Type mancante" + +#: alexandria/core/validations.py +msgid "Unknown file extension" +msgstr "Estensione file sconosciuta" + +#: alexandria/core/validations.py +#, python-format +msgid "" +"Content-Type %(content_type)s does not match file extension %(extension)s." +msgstr "" +"Il tipo di contenuto %(content_type)s non corrisponde all'estensione " +"%(extension)s del file." + +#: alexandria/core/validations.py +#, python-format +msgid "" +"Content-Type %(content_type)s does not match detected file content " +"%(file_content_type)s." +msgstr "" +"Il tipo di contenuto %(content_type)s non corrisponde al contenuto del file " +"%(file_content_type)s." + +#: alexandria/core/views.py +msgid "PDF conversion is not enabled." +msgstr "La conversione PDF non è attivata." + +#: alexandria/core/views.py +msgid "\"files\" filter is mandatory!" +msgstr "Il filtro \"files\" è obbligatorio!" + +#: alexandria/core/views.py +msgid "The \"files\" filter must consist of a comma delimited list of UUIDs!" +msgstr "" +"Il filtro \"file\" deve essere costituito da un elenco di UUID delimitato da " +"virgole!" + +#: alexandria/core/views.py +msgid "For downloading a file use the presigned download URL." +msgstr "Per scaricare un file, utilizzare l'URL di download predefinito." + +#: alexandria/core/views.py +msgid "WebDAV is not enabled." +msgstr "WebDAV non è attivato." + +#: alexandria/core/views.py +msgid "WebDAV is not enabled for this mime type." +msgstr "WebDAV non è abilitato per questo tipo di file." diff --git a/alexandria/settings/django.py b/alexandria/settings/django.py index 85e82a58..8d1d76d7 100644 --- a/alexandria/settings/django.py +++ b/alexandria/settings/django.py @@ -1,4 +1,5 @@ import re +from pathlib import Path from django.conf import global_settings @@ -74,9 +75,11 @@ def parse_languages(languages): LANGUAGE_CODE = env.str("LANGUAGE_CODE", "en") LANGUAGES = ( - parse_languages(env.list("LANGUAGES", default=["en", "de"])) + parse_languages(env.list("LANGUAGES", default=["en", "de", "it"])) or global_settings.LANGUAGES ) +PROJECT_ROOT = (Path(__file__) / Path("../..")).resolve() +LOCALE_PATHS = [str(PROJECT_ROOT / Path("locale"))] TIME_ZONE = env.str("TIME_ZONE", "UTC") USE_I18N = True