From 167d9887a2a59552595706f7993c50f6b1062d8c Mon Sep 17 00:00:00 2001 From: Jonas Metzener Date: Tue, 18 Feb 2025 14:34:20 +0100 Subject: [PATCH] fix(i18n): add italian translations --- .gitignore | 1 - Makefile | 8 ++ alexandria/locale/de/LC_MESSAGES/django.mo | Bin 0 -> 2583 bytes alexandria/locale/de/LC_MESSAGES/django.po | 54 ++++----- alexandria/locale/en/LC_MESSAGES/django.mo | Bin 0 -> 380 bytes alexandria/locale/en/LC_MESSAGES/django.po | 54 ++++----- alexandria/locale/it/LC_MESSAGES/django.mo | Bin 0 -> 2569 bytes alexandria/locale/it/LC_MESSAGES/django.po | 132 +++++++++++++++++++++ alexandria/settings/django.py | 5 +- 9 files changed, 196 insertions(+), 58 deletions(-) create mode 100644 alexandria/locale/de/LC_MESSAGES/django.mo create mode 100644 alexandria/locale/en/LC_MESSAGES/django.mo create mode 100644 alexandria/locale/it/LC_MESSAGES/django.mo create mode 100644 alexandria/locale/it/LC_MESSAGES/django.po 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 0000000000000000000000000000000000000000..d99c58d934b95f91ee408b8ad0e46bb820f19fb2 GIT binary patch literal 2583 zcmb7_&u<$=6vqc>p_tz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C;PhB!d*r-_r(|ssdFZz&2 zM%k2+4I0E`E0bnq(erUdkmmdsn74=arFl}ei;AEJ^m}N2qTskq1xtCG@=%J?!zvaP zqBgzWV*ScuUbBaJBzbU!uX)#k&)l~fIG(!}hf&UpdR)z;;zs9kQe|!=*(SFwM?+=# z1Q==IU{=h?ymQGeVLTv{w=jy)!n#yc>U1^jHzqH8yZ7)vL6d{E@%4Bxl\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 0000000000000000000000000000000000000000..71cbdf3e9d8d54be31066ec4ad8628bc2c1f2845 GIT binary patch literal 380 zcmYL@K~KUk7=|%=+R?Lz&%}d9i{c3jGZa>EvE7z2Nc2{r&Y96JZ6W$Y{CoZuJ5A(G zp7i_Dx9RhJeDu}vIq;l#&OC>nD^HugXY4QU{MmN?lNtRkR}RH%w3NnHT4Bh@vF%H^(V-=Ii1iQ$Qo9Pt!I1Rhe%oml#`f^NEGFCKEL->Rc=KoQ6a?!10%_7(V7ey8`V`;n{war z20Z3;uifk31QV^CRQ|iq#``$=;jWunRB8aLH({)F;i8zL{=V00y-I_qTIqGAN(}v% i$^}`yHKImSZ8jEzYJOK6-VWez49^vuhS0kh1f3tbb!oc* literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..291b6d873833241e18f3e957f6519f01b1816f6e GIT binary patch literal 2569 zcmbW2OKclO7{`ZFpqO`o@)S%0QES1Pwn$awG$?NDBnEF{5<8^`QH^)U_R#UpvNP+D z9(&@zg#!{7E(i$_2aZUn2c$|I;mU~~g zhV~@-)9AmUFQ8w$4IgOjL;3vc;GGyp;88FIkAUxk7r_s~SHT~U522Gk)F{u?$X+(zS6bS64mg=`W%)=%p>QVIn`0*e6YrH-O>46&Lq1X? z$=zNoEn6AN;Id6eY{f)QM$YSCnlE5OHoQcu%9e*lS{@mPLtQZBp>#5EIEgOh#ais5 z;iZFHEC21}>_GV*OtH#DICA=b+2W`~3c9wp#|Mc?}9KD8{(j% zes1ipazi+vcSRyA`PbwgE}?)-T*VG@R1~pN5f5sG1I$?fNREW-OB|l!ae156lF&j-*mgpx}9Sk<+Nno=yHT$+-Q_q z!s1;dBC?v^Q=`4%e8uatFgWP3YJELR1Bookz!Qkt=h&~mn=Eg zYAtJ3G09+m4J`1Req-P4Q6W^kRqyQnIx?#-6R!~= zV{aYfvM2#;G&(ZVt*xgr^;tBvCdtQ7G}) zW>%w+^7H>iPyX)}`na@(uF#vG)?gX(R$N&q49pi0m^6+}t}xj|O8O`ZiMfKJkwxSr zN4!X79DK#jsl?1!n(5j>p`jpPBR!=oiiSs0Ydoi1W0bf>Z`ydL5RF8kOP=OW=|!G8 zrPY-yG^dY4VJP%d#eoQgvacfLOog>XCOTB_GIO~w6e`5Um=c9UGbzGT$g~K*ABr{M zwRIx%_@E%+7X~7RnB)Qk!wsJa-OMbaQiN~AK$>6)+%A+!a#E@y8p1g>7EV-fEd*WV zo>FNC^g{z>l9@SlvSo932xQN$;kJmzll;+B=o6$%fobIPe$D%G@^q literal 0 HcmV?d00001 diff --git a/alexandria/locale/it/LC_MESSAGES/django.po b/alexandria/locale/it/LC_MESSAGES/django.po new file mode 100644 index 00000000..300f46b1 --- /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 \"files\" 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