From 01f7dad37c3e1d9164c5518b3d59695d006afc39 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 11 Oct 2020 21:56:14 +0200 Subject: [PATCH] Translated Model fields - primarily for backend. --- .../locale/de/LC_MESSAGES/django.po | 24 +++++++++++++++---- .../lostplaces/models/abstract_models.py | 18 ++++++++++---- django_lostplaces/lostplaces/models/place.py | 2 +- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po b/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po index b1f565a..e0bc7c9 100644 --- a/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po +++ b/django_lostplaces/lostplaces/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: 2020-10-11 21:26+0200\n" +"POT-Creation-Date: 2020-10-11 21:53+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Commander1024 \n" "Language-Team: LANGUAGE \n" @@ -50,6 +50,22 @@ msgstr "Längengrad" msgid "Longitude in decimal format: e. g. 2.17403" msgstr "Breitengrad in dezimaler Form: z. B. 7.4840155" +#: models/abstract_models.py:59 +msgid "Submission date" +msgstr "Einreichungsdatum" + +#: models/abstract_models.py:67 +msgid "Submitter" +msgstr "Einreicher" + +#: models/abstract_models.py:79 +msgid "Creation date" +msgstr "Erstellungsdatum" + +#: models/abstract_models.py:82 +msgid "Expiration date" +msgstr "Ablaufdatum" + #: models/external_links.py:13 msgid "URL" msgstr "Adresse (URL)" @@ -271,8 +287,8 @@ msgstr "Lost Place löschen" #: templates/place/place_delete.html:15 #, python-format -msgid "Are you sure you want to delete \"%(place.name)s\"?" -msgstr "" +msgid "Are you sure you want to delete %(place_name)s?" +msgstr "Bist Du sicher, dass Du %(place_name)s löschen möchtest?" #: templates/place/place_delete.html:19 msgid "Delete" @@ -344,7 +360,7 @@ msgstr "Place erfolgreich erstellt" #: views/place_views.py:105 msgid "Please fill in all required fields." -msgstr "" +msgstr "Bitte füll alle benötigten Felder aus." #: views/place_views.py:112 msgid "Successfully deleted place" diff --git a/django_lostplaces/lostplaces/models/abstract_models.py b/django_lostplaces/lostplaces/models/abstract_models.py index ee7f5ce..28429ca 100644 --- a/django_lostplaces/lostplaces/models/abstract_models.py +++ b/django_lostplaces/lostplaces/models/abstract_models.py @@ -53,13 +53,18 @@ class Submittable(models.Model): class Meta: abstract = True - submitted_when = models.DateTimeField(auto_now_add=True, null=True) + submitted_when = models.DateTimeField( + auto_now_add=True, + null=True, + verbose_name=_('Submission date') + ) submitted_by = models.ForeignKey( 'Explorer', on_delete=models.SET_NULL, null=True, blank=True, - related_name='%(class)ss' + related_name='%(class)ss', + verbose_name=_('Submitter') ) class Expireable(models.Model): @@ -69,8 +74,13 @@ class Expireable(models.Model): class Meta: abstract = True - created_when = models.DateTimeField(auto_now_add=True) - expires_when = models.DateTimeField() + created_when = models.DateTimeField( + auto_now_add=True, + verbose_name=_('Creation date') + ) + expires_when = models.DateTimeField( + verbose_name=_('Expiration date') + ) @property def is_expired(self): diff --git a/django_lostplaces/lostplaces/models/place.py b/django_lostplaces/lostplaces/models/place.py index db451a2..e90c375 100644 --- a/django_lostplaces/lostplaces/models/place.py +++ b/django_lostplaces/lostplaces/models/place.py @@ -138,4 +138,4 @@ def auto_delete_file_on_change(sender, instance, **kwargs): new_file = instance.filename if not old_file == new_file: if os.path.isfile(old_file.path): - os.remove(old_file.path) \ No newline at end of file + os.remove(old_file.path)