From 52f9638d748afc16d7974fc2eb332de3972d3113 Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Sun, 11 Oct 2020 02:07:14 +0200 Subject: [PATCH] Translated model fields. --- .../locale/de/LC_MESSAGES/django.po | 36 +++++++++++++++---- .../lostplaces/models/abstract_models.py | 7 +++- django_lostplaces/lostplaces/models/place.py | 16 +++++++-- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po b/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po index 117a253..437f697 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 01:36+0200\n" +"POT-Creation-Date: 2020-10-11 02:06+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Commander1024 \n" "Language-Team: LANGUAGE \n" @@ -30,23 +30,47 @@ msgstr "Ungültiger Voucher" msgid "Expired voucher" msgstr "Abgelaufener Voucher" -#: models/abstract_models.py:32 +#: models/abstract_models.py:28 +msgid "Name" +msgstr "Name" + +#: models/abstract_models.py:35 +msgid "Latitude" +msgstr "Breitengrad" + +#: models/abstract_models.py:36 msgid "Latitude in decimal format: e. g. 41.40338" msgstr "Breitengrad in dezimaler Form: z. B. 51.95021" -#: models/abstract_models.py:39 +#: models/abstract_models.py:43 +msgid "Longitude" +msgstr "Längengrad" + +#: models/abstract_models.py:44 msgid "Longitude in decimal format: e. g. 2.17403" msgstr "Breitengrad in dezimaler Form: z. B. 7.4840155" -#: models/place.py:19 +#: models/place.py:21 msgid "Location" msgstr "Ort" -#: models/place.py:20 +#: models/place.py:24 +msgid "" +"Description of the place: e.g. how to get there, where to be careful, the " +"place's history..." +msgstr "" +"Beschreibung des Places: z. B. wie man hin kommt, wo man vorsichtig sein " +"sollte, seine Geschichte..." + +#: models/place.py:25 models/place.py:84 msgid "Description" msgstr "Beschreibung" -#: models/place.py:81 +#: models/place.py:90 +msgid "Filename(s)" +msgstr "Dateiname(n)" + +#: models/place.py:91 msgid "Optional: One or more images to upload" msgstr "Optional: Ein oder mehrere Bilder zum Hochladen" diff --git a/django_lostplaces/lostplaces/models/abstract_models.py b/django_lostplaces/lostplaces/models/abstract_models.py index a4dd3a6..d0446a7 100644 --- a/django_lostplaces/lostplaces/models/abstract_models.py +++ b/django_lostplaces/lostplaces/models/abstract_models.py @@ -23,12 +23,16 @@ class Mapable(models.Model): class Meta: abstract = True - name = models.CharField(max_length=50) + name = models.CharField( + max_length=50, + verbose_name=_('Name'), + ) latitude = models.FloatField( validators=[ MinValueValidator(-90), MaxValueValidator(90) ], + verbose_name=_('Latitude'), help_text=_('Latitude in decimal format: e. g. 41.40338') ) longitude = models.FloatField( @@ -36,6 +40,7 @@ class Mapable(models.Model): MinValueValidator(-180), MaxValueValidator(180) ], + verbose_name=_('Longitude'), help_text=_('Longitude in decimal format: e. g. 2.17403') ) diff --git a/django_lostplaces/lostplaces/models/place.py b/django_lostplaces/lostplaces/models/place.py index 84a056d..db451a2 100644 --- a/django_lostplaces/lostplaces/models/place.py +++ b/django_lostplaces/lostplaces/models/place.py @@ -16,8 +16,14 @@ class Place(Submittable, Taggable, Mapable): Place defines a lost place (location, name, description etc.). """ - location = models.CharField(max_length=50, help_text=_('Location')) - description = models.TextField(help_text=_('Description')) + location = models.CharField( + max_length=50, + verbose_name=_('Location'), + ) + description = models.TextField( + help_text=_('Description of the place: e.g. how to get there, where to be careful, the place\'s history...'), + verbose_name=_('Description'), + ) def get_absolute_url(self): return reverse('place_detail', kwargs={'pk': self.pk}) @@ -73,11 +79,15 @@ class PlaceImage (Submittable): PlaceImage references a Place to which it belongs. """ - description = models.TextField(blank=True) + description = models.TextField( + blank=True, + verbose_name=_('Description'), + ) filename = ThumbnailerImageField( upload_to=generate_image_upload_path, resize_source=dict(size=(2560, 2560), sharpen=True), + verbose_name=_('Filename(s)'), help_text=_('Optional: One or more images to upload') ) place = models.ForeignKey(