diff --git a/.gitignore b/.gitignore index 8abb87e..3118dd7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,8 @@ db.sqlite3 db.sqlite3-journal db.sqlite3.bak # user uploaded files -media uploads +static_files ### Django.Python Stack ### # Byte-compiled / optimized / DLL files @@ -91,4 +91,4 @@ venv.bak/ .vscode # twine / pypi -.pypirc \ No newline at end of file +.pypirc diff --git a/django_lostplaces/django_lostplaces/settings.py b/django_lostplaces/django_lostplaces/settings.py index d89fea6..93a097c 100644 --- a/django_lostplaces/django_lostplaces/settings.py +++ b/django_lostplaces/django_lostplaces/settings.py @@ -18,6 +18,8 @@ https://docs.djangoproject.com/en/3.1/ref/settings/ import os from django.urls import reverse_lazy +from django.utils.translation import gettext_lazy as _ + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -58,6 +60,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.locale.LocaleMiddleware', ] ROOT_URLCONF = 'django_lostplaces.urls' @@ -124,6 +127,11 @@ USE_L10N = True USE_TZ = True +LANGUAGES = [ + ('de', _('German')), + ('en', _('English')), +] + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.1/howto/static-files/ diff --git a/django_lostplaces/lostplaces/forms.py b/django_lostplaces/lostplaces/forms.py index a770ef2..bc0b463 100644 --- a/django_lostplaces/lostplaces/forms.py +++ b/django_lostplaces/lostplaces/forms.py @@ -4,8 +4,10 @@ ''' (web)forms that can be used elsewhere. ''' from django import forms +from django.db import models from django.contrib.auth.forms import UserCreationForm, UserChangeForm from django.contrib.auth.models import User +from django.utils.translation import ugettext_lazy as _ from lostplaces.models import Place, PlaceImage, Voucher class ExplorerCreationForm(UserCreationForm): @@ -14,7 +16,7 @@ class ExplorerCreationForm(UserCreationForm): fields = ('username', 'email') voucher = forms.CharField( max_length=30, - help_text='The Voucher you got from an administrator' + help_text=_('The Voucher you got from an administrator') ) def is_valid(self): @@ -23,7 +25,7 @@ class ExplorerCreationForm(UserCreationForm): try: fetched_voucher = Voucher.objects.get(code=submitted_voucher) except Voucher.DoesNotExist: - self.add_error('voucher', 'Invalid voucher') + self.add_error('voucher', _('Invalid voucher')) return False if not fetched_voucher.valid: diff --git a/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po b/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po new file mode 100644 index 0000000..3d6a6c1 --- /dev/null +++ b/django_lostplaces/lostplaces/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,325 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Reverend , 2020. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-10-11 02:14+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Commander1024 \n" +"Language-Team: LANGUAGE \n" +"Language: de-DE\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" + +#: forms.py:19 +msgid "The Voucher you got from an administrator" +msgstr "Der Einladungs-Code, den Dir ein Administrator gegeben hat" + +#: forms.py:28 +msgid "Invalid voucher" +msgstr "Ungültiger Voucher" + +#: forms.py:32 +msgid "Expired voucher" +msgstr "Abgelaufener Voucher" + +#: 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: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/external_links.py:13 +msgid "URL" +msgstr "Adresse (URL)" + +#: models/external_links.py:17 +msgid "link text" +msgstr "Linktext" + +#: models/place.py:21 +msgid "Location" +msgstr "Ort" + +#: 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: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" + +#: templates/403.html:4 +msgid "Forbidden" +msgstr "Nicht Erlaubt" + +#: templates/403.html:14 +msgid "You will be redirected in 5 seconds" +msgstr "Du wirst in 5 Sekunden weitergeleitet" + +#: templates/403.html:14 +msgid "Go Back" +msgstr "Zurück" + +#: templates/global.html:32 +msgid "Logout" +msgstr "Abmelden" + +#: templates/global.html:34 +msgid "Admin" +msgstr "Admin" + +#: templates/global.html:39 templates/registration/login.html:4 +#: templates/registration/login.html:10 templates/registration/login.html:23 +msgid "Login" +msgstr "Anmelden" + +#: templates/global.html:40 templates/registration/login.html:29 +#: templates/signup.html:12 templates/signup.html:41 +msgid "Sign Up" +msgstr "Registrieren" + +#: templates/global.html:50 templates/home.html:10 +msgid "Home" +msgstr "Startseite" + +#: templates/global.html:51 +msgid "UrBex Codex" +msgstr "UrBex Codex" + +#: templates/global.html:56 templates/place/place_create.html:5 +#: templates/place/place_create.html:10 +msgid "Create Place" +msgstr "Place erstellen" + +#: templates/global.html:57 +msgid "All Places" +msgstr "Alle Places" + +#: templates/home.html:20 templates/home_unauth.html:20 +msgid "Explore the latest places" +msgstr "Neueste Places erkunden" + +#: templates/home_unauth.html:11 +msgid "" +"You can create, view and share your lost places with other members of this " +"site. You can upload photos, place links to your web galleries and " +"contribute your knowledge by tagging other places or commenting on them. You " +"will find detailed information on where these locations are, how to get " +"there and what to expect from them. This might even include detailed " +"information on the surroundings or the history of a lost place." +msgstr "" +"Du kannst Deine Lost Places erstellen, ansehen und mit anderen Mitgliedern " +"auf dieser Seite teilen. Du kannst Photos hochladen, Links zu Deinen Web-" +"Fotoalben setzen und Dein Wissen teilen indem Du andere Places mit Tags " +"versiehst oder sie kommentierst. Du wirst detaillierte Informationen dazu " +"finden, wo diese Orte sind, wie Du dorthin gelangst und was Dich dort " +"erwartet. Dies können sogar detaillierte Informationen zur Umgebung oder der " +"Geschichte eines Lost Places sein." + +#: templates/home_unauth.html:15 +#, python-format +msgid "" +"Since vandalism is a growing problem these days, no sensitive information is " +"available to the public. You have to sign up with a " +"voucher code as an invitation to join this community. Only admins can create " +"these codes. Usually you are given a code when we know you in real life in " +"person and when we trust you. A request from an unknown person will most " +"probably be denied." +msgstr "" +"Weil Vandalismus dieser Tage ein wachsendes Problem ist, sind keine " +"sensiblen Informationen öffentlich verfügbar. Du musst Dich mit einem " +"Voucher-Code als Einladung registrierenum dieser Community " +"beizutreten. Nur Administratoren können diese Codes erstellen. Üblicherweise " +"bekommst Du einen Code, wenn wir Dich im echten Leben kennen und Dir " +"vertrauen. Eine Anfrage von einer unbekannten Person wird " +"höchstwahrscheinlich abgelehnt." + +#: templates/partials/form/submit.html:3 +msgid "Submit" +msgstr "Abschicken" + +#: templates/partials/form/submit.html:7 +msgid "Cancel" +msgstr "Abbrechen" + +#: templates/partials/nav/footer.html:64 +msgid "Made by" +msgstr "Erstellt von" + +#: templates/partials/nav/footer.html:65 +msgid "and" +msgstr "und" + +#: templates/partials/nav/footer.html:68 +msgid "Privacy Policy" +msgstr "Datenschutzerklärung" + +#: templates/partials/nav/footer.html:70 +msgid "Imprint" +msgstr "Impressum" + +#: templates/partials/nav/pagination.html:11 +#: templates/partials/nav/pagination.html:24 +msgid "First" +msgstr "Erste" + +#: templates/partials/nav/pagination.html:17 +#: templates/partials/nav/pagination.html:30 +msgid "Previous" +msgstr "Vorherige" + +#: templates/partials/nav/pagination.html:50 +#: templates/partials/nav/pagination.html:63 +msgid "Next" +msgstr "Nächste" + +#: templates/partials/nav/pagination.html:56 +#: templates/partials/nav/pagination.html:68 +msgid "Last" +msgstr "Letzte" + +#: templates/partials/tagging.html:30 templates/partials/tagging.html:34 +msgid "Add tags" +msgstr "Tags hinzufügen" + +#: templates/partials/welcome.html:4 +msgid "Start" +msgstr "Start" + +#: templates/partials/welcome.html:8 +msgid "Welcome to our Urban Exploration community catalogue," +msgstr "Willkommen auf unserem Urban Exploration Community-Katalog," + +#: templates/partials/welcome.html:12 +msgid "explorer" +msgstr "Explorer" + +#: templates/partials/welcome.html:17 +msgid "We strictly follow our" +msgstr "Bitte lies unseren" + +#: templates/partials/welcome.html:18 +msgid "UrBex codex" +msgstr "UrBex Codex" + +#: templates/partials/welcome.html:19 +msgid "and expect you to do so, too." +msgstr "bevor du Places erkundest" + +#: templates/photo_album/photo_album_create.html:4 +msgid "Submit a photo album" +msgstr "Fotoalbum hinzufügen" + +#: templates/photo_album/photo_album_create.html:8 +#: templates/place/place_detail.html:18 +msgid "Edit place" +msgstr "Place bearbeiten" + +#: templates/photo_album/photo_album_create.html:10 +#: templates/place/place_delete.html:11 templates/place/place_detail.html:19 +msgid "Delete place" +msgstr "Place löschen" + +#: templates/photo_album/photo_album_create.html:16 +msgid "Submit a photo album for" +msgstr "Fotoalbum hinzufügen zu" + +#: templates/place/place_create.html:42 +msgid "Create" +msgstr "Erstellen" + +#: templates/place/place_delete.html:5 +msgid "Lost Place Deletion" +msgstr "Lost Place löschen" + +#: templates/place/place_delete.html:15 +msgid "Are you sure you want to delete" +msgstr "Willst Du den Ort wirklich löschen: " + +#: templates/place/place_delete.html:19 +msgid "Delete" +msgstr "Löschen" + +#: templates/place/place_detail.html:46 +msgid "Map links" +msgstr "Kartenlinks" + +#: templates/place/place_detail.html:58 +msgid "Photo albums" +msgstr "Fotoalben" + +#: templates/place/place_detail.html:84 +msgid "Add photo album" +msgstr "Fotoalbum hinzufügen" + +#: templates/place/place_detail.html:93 +msgid "Images" +msgstr "Bilder" + +#: templates/place/place_list.html:10 +msgid "Lost Places" +msgstr "Alle Places" + +#: templates/place/place_list.html:16 +msgid "Listing our places" +msgstr "Unsere Lost Places" + +#: templates/place/place_update.html:5 templates/place/place_update.html:10 +msgid "Update place" +msgstr "Place bearbeiten" + +#: templates/place/place_update.html:42 +msgid "Update" +msgstr "Aktualisieren" + +#: templates/place_image/place_image_create.html:7 +msgid "Submit images to a place" +msgstr "Bilder zu einem Place hinzufügen" + +#: templates/registration/login.html:29 +msgid "Have No Account Yet?" +msgstr "Noch kein Konto?" + +#: templates/signup.html:6 +msgid "Sign up" +msgstr "Registrieren" + +#: views/base_views.py:25 +msgid "Please login to proceed" +msgstr "Bitte log Dich ein um fortzufahren." diff --git a/django_lostplaces/lostplaces/models/abstract_models.py b/django_lostplaces/lostplaces/models/abstract_models.py index ba4be73..ee7f5ce 100644 --- a/django_lostplaces/lostplaces/models/abstract_models.py +++ b/django_lostplaces/lostplaces/models/abstract_models.py @@ -1,13 +1,14 @@ from django.utils import timezone from django.db import models +from django.utils.translation import ugettext_lazy as _ from django.core.validators import MaxValueValidator, MinValueValidator from taggit.managers import TaggableManager class Taggable(models.Model): ''' - This abstract model represtens an object that is taggalble + This abstract model represtens an object that is taggable using django-taggit ''' class Meta: @@ -23,18 +24,25 @@ 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( validators=[ MinValueValidator(-180), MaxValueValidator(180) - ] + ], + verbose_name=_('Longitude'), + help_text=_('Longitude in decimal format: e. g. 2.17403') ) class Submittable(models.Model): @@ -66,4 +74,4 @@ class Expireable(models.Model): @property def is_expired(self): - return timezone.now() > self.expires_when \ No newline at end of file + return timezone.now() > self.expires_when diff --git a/django_lostplaces/lostplaces/models/external_links.py b/django_lostplaces/lostplaces/models/external_links.py index b7bd5dc..e8c42b8 100644 --- a/django_lostplaces/lostplaces/models/external_links.py +++ b/django_lostplaces/lostplaces/models/external_links.py @@ -1,4 +1,5 @@ from django.db import models +from django.utils.translation import ugettext_lazy as _ from lostplaces.models.place import PlaceAsset @@ -7,8 +8,14 @@ class ExternalLink(PlaceAsset): class Meta: abstract = True - url = models.URLField(max_length=200) - label = models.CharField(max_length=100) + url = models.URLField( + max_length=200, + verbose_name=_('URL') + ) + label = models.CharField( + max_length=100, + verbose_name=_('link text') + ) class PhotoAlbum(ExternalLink): pass \ No newline at end of file diff --git a/django_lostplaces/lostplaces/models/place.py b/django_lostplaces/lostplaces/models/place.py index 402afdb..db451a2 100644 --- a/django_lostplaces/lostplaces/models/place.py +++ b/django_lostplaces/lostplaces/models/place.py @@ -4,6 +4,7 @@ from django.db import models from django.urls import reverse from django.dispatch import receiver from django.db.models.signals import post_delete, pre_save +from django.utils.translation import ugettext_lazy as _ from lostplaces.models.abstract_models import Submittable, Taggable, Mapable @@ -15,8 +16,14 @@ class Place(Submittable, Taggable, Mapable): Place defines a lost place (location, name, description etc.). """ - location = models.CharField(max_length=50) - description = models.TextField() + 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}) @@ -72,11 +79,16 @@ 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) + sharpen=True), + verbose_name=_('Filename(s)'), + help_text=_('Optional: One or more images to upload') ) place = models.ForeignKey( Place, diff --git a/django_lostplaces/lostplaces/templates/403.html b/django_lostplaces/lostplaces/templates/403.html index 3e56fb0..ef4fbb8 100644 --- a/django_lostplaces/lostplaces/templates/403.html +++ b/django_lostplaces/lostplaces/templates/403.html @@ -1,6 +1,7 @@ {% extends 'global.html'%} +{% load i18n %} -{% block title %}Forbidden{% endblock %} +{% block title %}{% trans 'Forbidden' %}{% endblock %} {% block additional_head %} {% if request.META.HTTP_REFERER %} @@ -10,6 +11,6 @@ {% block maincontent %} {% if request.META.HTTP_REFERER %} -

You will be redirected in 5 seconds

Go Back

+

{% trans 'You will be redirected in 5 seconds' %}

{% trans 'Go Back' %}

{% endif %} {% endblock maincontent %} \ No newline at end of file diff --git a/django_lostplaces/lostplaces/templates/flat/codex-de.html b/django_lostplaces/lostplaces/templates/flat/codex-de.html new file mode 100644 index 0000000..2d6c18b --- /dev/null +++ b/django_lostplaces/lostplaces/templates/flat/codex-de.html @@ -0,0 +1,52 @@ +{% extends 'global.html'%} + +# {% block title %}UrBex Codex{% endblock %} + +{% block maincontent %} + +
+

Nimm nichts mit - außer Deinen Bildern. Laß nichts da - außer Deinen Fußspuren!

+
+ +
+ +

Das sollte doch eigentlich eindeutig sein, oder? Aber wie wir alle wissen, hat jedes Schild eine Geschichte. Wir haben zu viel sinnlose Zerstörung gesehen, sodass wir uns dazu entschieden haben, einen grundlegenden Urban Exploration Codex niederzuschreiben.

+
    +
  • + Wir respektieren fremdes Eigentum, so wie wir das von anderen auch verlangen. Deswegen öffnen wir keinen Zugang gewaltsam, oder beschädigen eine Verschlusseinrichtung. Wir betreten ein Grundstück oder ein Gebäude / eine Anlage / eine Ruine nur dann, wenn wir davon ausgehen können, nicht gegen den Willen des Eigentümers dort zu sein. Eine gut erhaltene Umzäunung, oder ein ständiger Wachschutz sprechen dafür, dass der Eigentümer sich noch mit seiner Anlage befasst. Längst umgesunkene Zäune, Ruinen im letzten Stadium eines Verfalls sprecher dafür, dass dem Eigentümer das eher Wurst ist. +
  • +
  • + Wir nehmen von einer Location nichts mit, auch keine "kleinen Andenken", und lassen nichts da - auch keine Kippen, keine Verpackungen - nichts. + Wir verändern am Ort nichts, nehmen nichts weg und fügen nichts hinzu. +
  • +
  • + Wir rauchen möglichst nicht. Nicht nur, weil es stinkt und Müll verursacht. Es gibt immer die Chance, irgendwas durch Funkenflug anzuzünden. Lass es trockene Blätter an einem heißen Sommertag oder (potentielle) entflammbare Materialien in Industrieanlagen sein. +
  • +
  • + Sprayen ist ein absolutes "no-go"! +
  • +
  • + In einer Location verhalten wir uns vorsichtig. Wir werfen nichts in Löcher oder aus Fenstern und berühren auch keine elektrischen Anlagen. Nicht immer ist der Strom wirklich abgeschaltet. Deswegen öffnen wor auch keine Flaschen und andere Behälter. Wir gehen niemals ohne Licht in einen dunklen Raum, und nehmen immer eine Reservelampe mit. +
  • +
  • + Wir sagen vor einer Tour mindestens einer Person unseres Vertrauens, wo wir sind (Koordinaten!), wie lange wir uns dort aufhalten werden und was wir dort tun. Wir verabreden, daß wir uns bei einem längeren Aufenthalt dort regelmäßig melden, oder aber ein "okay" geben, wenn wir die Location wieder verlassen haben. Wenn wir uns verspäten, dann denken wir daran, eine entsprechende Nachricht abzusetzen. Unsere Kontaktperson soll nach einer gewissen Zeit, wenn sie nichts von mir hört, für Hilfe sorgen. +
  • +
  • + Wir bereiten unsere Tour sorgfältig vor. Es ist ärgerlich, wenn die Kamera-Akkus nicht geladen sind - aber gefährlich ist es keineswegs. Es ist aber lebensgefährlich, wenn ein verschmutzter Nagel durch eine Sohle getreten wird. Sicherheitsschuhe zu tragen ist eine gute Idee. Wenn wir unter Tage gehen, nehmen wir angemessenes Equipment mit um uns zu schützen — z. B. einen Gaswarner oder vllt. sogar einen Geigerzähler. +
  • +
  • + Wir parken nicht so, daß Dritte auf unser Vorhaben aufmerksam werden. Unser Hobby braucht keine öffentliche Aufmerksamkeit, die sich auf illegales Betreten von Grundstücken richtet (und illegal dürfte das Betreten ja meist sein ...). +
  • +
  • + Wir verraten unsere Locations nicht und veröffentlichen ausschließlich Fotos, bei denen Geodaten aus den Dateien (EXIF) entfernt worden sind. Deswegen posten wir unterwegs nur dann vom Smartphone, wenn wir absolut sicher sind, dass keine Koordinaten im Bild enthalten sind. +
  • +
  • + Vor allem halten wir die Klappe und geben nicht mit einer tollen, noch unberührt aussehenden Location an. Deine "Freunde" in Facebook kennst Du oft nicht mal persönlich, schon gar nicht in einer Gruppe. Nichts verbreitet sich schneller als ein "Geheimnis", das unter dem Siegel des Vertrauens weitergegeben wurde. Willst Du daran schuld sein, daß hirnbefreite Sprayer auch diesen Ort demolieren? +
  • +
  • + Wir sorgen durch Argumente und Überzeugung dafür, daß unsere Begleiter sich ebenso verhalten! In erster Linie versuchen wir durch unser eigenes Verhalten zu überzeugen. +
  • +
+
+ +{% endblock maincontent %} \ No newline at end of file diff --git a/django_lostplaces/lostplaces/templates/flat/codex.html b/django_lostplaces/lostplaces/templates/flat/codex.html index 6f8c83e..b89ef80 100644 --- a/django_lostplaces/lostplaces/templates/flat/codex.html +++ b/django_lostplaces/lostplaces/templates/flat/codex.html @@ -29,22 +29,22 @@ In a location we are careful not to endanger ourselves or others. We don't throw anything into holes or out of windows, and we don't touch electrical equipment. You can't tell from its look or sound if the power is really switched off. Therefore we do not open bottles and other containers. We never go into a dark room without light, and always have a spare lamp with us.
  • - Before my tour we tell at least one person of my trust where we are (coordinates!), how long we will be there and what we will do there. We arrange that we will contact him regularly if we stay there for a longer period of time, or give an "okay" when we have left the location again. If we am late, we will remember to send a message to that effect. Our contact person is supposed to provide help after a certain period of time if he does not hear from me. + Before our tour we tell at least one person of our trust where we are (coordinates!), how long we will be there and what we will do there. We arrange that we will contact him regularly if we stay there for a longer period of time, or give an "okay" when we have left the location again. If we am late, we will remember to send a message to that effect. Our contact person is supposed to provide help after a certain period of time if he does not hear from me.
  • - We prepare my tour carefully. It is annoying when the camera batteries are not charged — but it is not dangerous at all. But it is life-threatening if you step unto a dirty nail that perforates your shoe. It is wise to wear sturdy shoes. When we go underground, we take appropiate equipment with us to protect ourselves — e. g. a gas warner or even a geiger counter. + We prepare out tour carefully. It is annoying when the camera batteries are not charged — but it is not dangerous at all. But it is life-threatening if you step unto a dirty nail that perforates your shoe. It is wise to wear sturdy shoes. When we go underground, we take appropiate equipment with us to protect ourselves — e. g. a gas warner or even a geiger counter.
  • - We do not park in such a way that third parties become aware of my intention. Our hobby does not need public attention, which is directed to illegal entering of properties (and illegal entering is probably the most common way ...). + We do not park in such a way that third parties become aware of our intention. Our hobby does not need public attention, which is directed to illegal entering of properties (and illegal entering is probably the most common way ...).
  • - We do not disclose our locations and only publish photos where geodata has been removed from the files (EXIF). Therefore we only post from my smartphone when we am absolutely sure that no coordinates are contained in the picture. + We do not disclose our locations and only publish photos where geodata has been removed from the files (EXIF). Therefore we only post from our smartphone when we am absolutely sure that no coordinates are contained in the picture.
  • - Above all, we keep my mouth shut and don't brag about a great, still untouched looking location. You often don't even know your "friends" in Facebook personally, especially not in a group. Nothing spreads faster than a "secret" that has been passed on under the seal of trust. Do you want to be responsible for brainless sprayers destroying this place too? + Above all, we keep our mouth shut and don't brag about a great, still untouched looking location. You often don't even know your "friends" in Facebook personally, especially not in a group. Nothing spreads faster than a "secret" that has been passed on under the seal of trust. Do you want to be responsible for brainless sprayers destroying this place too?
  • - We make sure through argument and conviction that my companions behave the same way! First and foremost we try to convince through our own behavior. + We make sure through argument and conviction that our companions behave the same way! First and foremost we try to convince through our own behavior.
  • diff --git a/django_lostplaces/lostplaces/templates/flat/imprint-ger.html b/django_lostplaces/lostplaces/templates/flat/imprint-de.html similarity index 100% rename from django_lostplaces/lostplaces/templates/flat/imprint-ger.html rename to django_lostplaces/lostplaces/templates/flat/imprint-de.html diff --git a/django_lostplaces/lostplaces/templates/flat/privacy-policy-ger.html b/django_lostplaces/lostplaces/templates/flat/privacy-policy-de.html similarity index 100% rename from django_lostplaces/lostplaces/templates/flat/privacy-policy-ger.html rename to django_lostplaces/lostplaces/templates/flat/privacy-policy-de.html diff --git a/django_lostplaces/lostplaces/templates/global.html b/django_lostplaces/lostplaces/templates/global.html index bca584f..32d751f 100644 --- a/django_lostplaces/lostplaces/templates/global.html +++ b/django_lostplaces/lostplaces/templates/global.html @@ -1,4 +1,5 @@ {% load static %} +{% load i18n %} @@ -28,15 +29,15 @@ {% if user.is_authenticated %} Hi {{ user.username }}! - logout + {% trans 'Logout' %} {% if user.is_superuser %} - admin + {% trans 'Admin' %} {% endif %} {% else %} You are not logged in. - login | - signup + {% trans 'Login' %} | + {% trans 'Sign Up' %} {% endif %} @@ -46,14 +47,14 @@ diff --git a/django_lostplaces/lostplaces/templates/home.html b/django_lostplaces/lostplaces/templates/home.html index 6f36133..df98f0e 100644 --- a/django_lostplaces/lostplaces/templates/home.html +++ b/django_lostplaces/lostplaces/templates/home.html @@ -1,12 +1,13 @@ {% extends 'global.html'%} {% load static %} +{% load i18n %} {% block additional_head %} {% endblock additional_head %} -# {% block title %}Start{% endblock %} +# {% block title %}{% trans 'Home' %}{% endblock %} {% block maincontent %} @@ -16,7 +17,7 @@ {% include 'partials/osm_map.html' with config=mapping_config %}
    -

    Explore the latest locations

    +

    {% trans 'Explore the latest places' %}

      {% for place in place_list %}
    • diff --git a/django_lostplaces/lostplaces/templates/home_unauth.html b/django_lostplaces/lostplaces/templates/home_unauth.html index 753a729..bbd5cf9 100644 --- a/django_lostplaces/lostplaces/templates/home_unauth.html +++ b/django_lostplaces/lostplaces/templates/home_unauth.html @@ -1,4 +1,5 @@ {% extends 'global.html'%} +{% load i18n %} # {% block title %}Start{% endblock %} @@ -7,27 +8,16 @@ {% include 'partials/welcome.html' %}

      - You can create, view and share your favorite lost places with other - members of this site. You can upload photos, place links to your - web galleries and contribute your knowledge by tagging other places or - commenting on them. You will find detailed information on where these - locations are, how to get there and what to expect from them. This might - even include detailed information on the surroundings or the history - of a lost place. + {% blocktrans %}You can create, view and share your lost places with other members of this site. You can upload photos, place links to your web galleries and contribute your knowledge by tagging other places or commenting on them. You will find detailed information on where these locations are, how to get there and what to expect from them. This might even include detailed information on the surroundings or the history of a lost place.{% endblocktrans %}

      + {% url 'signup' as signup_url %}

      - Since vandalism is a growing problem these days, no sensitive - information is available to the public. You have to - sign up - with a voucher code as an invitation to join this community. Only admins - can create these codes. Usually you are given a code when we know you - in real life in person. A request from an unknown person will most - probably be denied. + {% blocktrans %}Since vandalism is a growing problem these days, no sensitive information is available to the public. You have to sign up with a voucher code as an invitation to join this community. Only admins can create these codes. Usually you are given a code when we know you in real life in person and when we trust you. A request from an unknown person will most probably be denied.{% endblocktrans %}

      -

      Our latest locations

      +

      {% trans 'Explore the latest places' %}

        {% for place in place_list %}
      • diff --git a/django_lostplaces/lostplaces/templates/partials/form/submit.html b/django_lostplaces/lostplaces/templates/partials/form/submit.html index a012fc7..4d1572a 100644 --- a/django_lostplaces/lostplaces/templates/partials/form/submit.html +++ b/django_lostplaces/lostplaces/templates/partials/form/submit.html @@ -1,8 +1,9 @@ +{% load i18n %}
        - +
        diff --git a/django_lostplaces/lostplaces/templates/partials/nav/footer.html b/django_lostplaces/lostplaces/templates/partials/nav/footer.html index 080e54b..1e82c6e 100644 --- a/django_lostplaces/lostplaces/templates/partials/nav/footer.html +++ b/django_lostplaces/lostplaces/templates/partials/nav/footer.html @@ -1,3 +1,4 @@ +{% load i18n %} diff --git a/django_lostplaces/lostplaces/templates/partials/nav/pagination.html b/django_lostplaces/lostplaces/templates/partials/nav/pagination.html index 04acd41..f7f4130 100644 --- a/django_lostplaces/lostplaces/templates/partials/nav/pagination.html +++ b/django_lostplaces/lostplaces/templates/partials/nav/pagination.html @@ -1,3 +1,4 @@ +{% load i18n %} {% load lostplaces %} {% if is_paginated %} @@ -7,26 +8,26 @@
      • - First + {% trans 'First' %}
      • - Previous + {% trans 'Previous' %}
      • {% else %}
      • - First + {% trans 'First' %}
      • - Previous + {% trans 'Previous' %}
      • {% endif %} @@ -46,25 +47,25 @@ {% if page_obj.has_next %}
      • - Next + {% trans 'Next' %}
      • - Last + {% trans 'Last' %}
      • {% else %}
      • - Next + {% trans 'Next' %}
      • - Last + {% trans 'Last' %}
      • diff --git a/django_lostplaces/lostplaces/templates/partials/osm_map.html b/django_lostplaces/lostplaces/templates/partials/osm_map.html index 9ed5d40..ff1a388 100644 --- a/django_lostplaces/lostplaces/templates/partials/osm_map.html +++ b/django_lostplaces/lostplaces/templates/partials/osm_map.html @@ -11,7 +11,7 @@ }), ], view: new ol.View({ - center: ol.proj.fromLonLat([{{config.map_center.longitude}}, {{config.map_center.latitude}}]), + center: ol.proj.fromLonLat([{{config.map_center.longitude|safe}}, {{config.map_center.latitude|safe}}]), zoom: 9 }) }); @@ -21,7 +21,7 @@ {% for point in config.all_points %} new ol.Feature({ geometry: new ol.geom.Point( - ol.proj.fromLonLat([{{point.longitude}},{{point.latitude}}]) + ol.proj.fromLonLat([{{point.longitude|safe}},{{point.latitude|safe}}]) ), url: '{{point.get_absolute_url}}', name: ' {{point.name}}' diff --git a/django_lostplaces/lostplaces/templates/partials/tagging.html b/django_lostplaces/lostplaces/templates/partials/tagging.html index 2f373dd..2b44cf3 100644 --- a/django_lostplaces/lostplaces/templates/partials/tagging.html +++ b/django_lostplaces/lostplaces/templates/partials/tagging.html @@ -1,3 +1,5 @@ +{% load i18n %} +
          {% for tag in config.tagged_item.tags.all %} @@ -25,11 +27,11 @@
          - Tags hinzufügen + {% trans 'Add tags' %} {% csrf_token %}
          - +
          {% include 'partials/form/inputField.html' with field=config.submit_form.tag_list classes="LP-Input--tagging" %} diff --git a/django_lostplaces/lostplaces/templates/partials/welcome.html b/django_lostplaces/lostplaces/templates/partials/welcome.html index cb45a98..e4e9f31 100644 --- a/django_lostplaces/lostplaces/templates/partials/welcome.html +++ b/django_lostplaces/lostplaces/templates/partials/welcome.html @@ -1,19 +1,21 @@ +{% load i18n %} +
          -

          Start

          +

          {% trans 'Start' %}

          -

          Welcome to our Urban Exploration community catalogue, +

          {% trans 'Welcome to our Urban Exploration community catalogue,' %} {% if user.is_authenticated %} {{ user.username }} {% else %} - explorer + {% trans 'explorer' %} {% endif %} !

          - We strictly follow our - UrBex codex - and expect you to do so, too. + {% trans 'We strictly follow our' %} + {% trans 'UrBex codex' %} + {% trans 'and expect you to do so, too.' %}'

          diff --git a/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html b/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html index 52cdb7b..3406437 100644 --- a/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html +++ b/django_lostplaces/lostplaces/templates/photo_album/photo_album_create.html @@ -1,18 +1,19 @@ {% extends 'global.html'%} +{% load i18n %} -{% block title %}Submit a photo album{% endblock %} +{% block title %}{% trans 'Submit a photo album' %}{% endblock %} {% block additional_menu_items %}
        • Edit place
        • + class="LP-Link__Text">{% trans 'Edit place' %}
        • Delete place
        • + class="LP-Link__Text">{% trans 'Delete place' %} {% endblock additional_menu_items %} {% block maincontent %}
          - Submit a photo album for {{place.name}} + {% trans 'Submit a photo album for' %} {{place.name}} {% csrf_token %}
          diff --git a/django_lostplaces/lostplaces/templates/place/place_create.html b/django_lostplaces/lostplaces/templates/place/place_create.html index 381bc9d..b4061ea 100644 --- a/django_lostplaces/lostplaces/templates/place/place_create.html +++ b/django_lostplaces/lostplaces/templates/place/place_create.html @@ -1,12 +1,13 @@ {% extends 'global.html'%} {% load static %} +{% load i18n %} -# {% block title %}Place erstellen{% endblock %} +# {% block title %}{% trans 'Create Place' %}{% endblock %} {% block maincontent %}
          - Create Place + {% trans 'Create Place' %} {% csrf_token %}
          @@ -38,8 +39,9 @@
          + {% trans 'Create' as action %}
          - {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action='Create' %} + {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
          diff --git a/django_lostplaces/lostplaces/templates/place/place_delete.html b/django_lostplaces/lostplaces/templates/place/place_delete.html index 2b644a7..7b79451 100644 --- a/django_lostplaces/lostplaces/templates/place/place_delete.html +++ b/django_lostplaces/lostplaces/templates/place/place_delete.html @@ -1,22 +1,24 @@ {% extends 'global.html'%} {% load static %} +{% load i18n %} -{% block title %}Lost Place Deletion{% endblock %} +{% block title %}{% trans 'Lost Place Deletion' %}{% endblock %} {% block maincontent %}
          - Delete place + {% trans 'Delete place' %} {% csrf_token %}
          -

          Are you sure you want to delete "{{place.name}}"?

          +

          {% trans 'Are you sure you want to delete' %} "{{place.name}}"?

          - + + {% trans 'Delete' as action %}
          - {% include 'partials/form/submit.html' with referer=request.META.HTTP_REFERER action='Delete' %} + {% include 'partials/form/submit.html' with referer=request.META.HTTP_REFERER action=action %}
          diff --git a/django_lostplaces/lostplaces/templates/place/place_detail.html b/django_lostplaces/lostplaces/templates/place/place_detail.html index fdf656a..1852d58 100644 --- a/django_lostplaces/lostplaces/templates/place/place_detail.html +++ b/django_lostplaces/lostplaces/templates/place/place_detail.html @@ -1,6 +1,7 @@ {% extends 'global.html'%} - {% load static %} +{% load i18n %} + {% load thumbnail %} {% load svg_icon %} @@ -14,8 +15,8 @@ {% block title %}{{place.name}}{% endblock %} {% block additional_menu_items %} -
        • Edit place
        • -
        • Delete place
        • +
        • {% trans 'Edit place' %}
        • +
        • {% trans 'Delete place' %}
        • {% endblock additional_menu_items %} {% block maincontent %} @@ -42,19 +43,19 @@
          -

          Map links

          +

          {% trans 'Map links' %}

          {% include 'partials/osm_map.html' with config=mapping_config%}
          -

          Photo albums

          +

          {% trans 'Photo albums' %}

          @@ -89,7 +90,7 @@
          -

          Images

          +

          {% trans 'Images' %}

            {% for place_image in place.placeimages.all %} diff --git a/django_lostplaces/lostplaces/templates/place/place_list.html b/django_lostplaces/lostplaces/templates/place/place_list.html index 5e336cf..6e4ae1e 100644 --- a/django_lostplaces/lostplaces/templates/place/place_list.html +++ b/django_lostplaces/lostplaces/templates/place/place_list.html @@ -1,18 +1,19 @@ {% extends 'global.html'%} {% load static %} +{% load i18n %} {% block additional_head %} {% endblock additional_head %} -{% block title %}Lost Places{% endblock %} +{% block title %}{% trans 'Lost Places' %}{% endblock %} {% block maincontent %} {% include 'partials/osm_map.html' with config=mapping_config %}
            -

            Listing our places

            +

            {% trans 'Listing our places' %}

              {% for place in place_list %}
            • diff --git a/django_lostplaces/lostplaces/templates/place/place_update.html b/django_lostplaces/lostplaces/templates/place/place_update.html index 150dbfd..f061a0e 100644 --- a/django_lostplaces/lostplaces/templates/place/place_update.html +++ b/django_lostplaces/lostplaces/templates/place/place_update.html @@ -1,12 +1,13 @@ {% extends 'global.html'%} {% load static %} +{% load i18n %} -# {% block title %}Update place{% endblock %} +# {% block title %}{% trans 'Update place' %}{% endblock %} {% block maincontent %}
              - Update place + {% trans 'Update place' %} {% csrf_token %}
              @@ -38,8 +39,9 @@
              + {% trans 'Update' as action %}
              - {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action='Update' %} + {% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
              diff --git a/django_lostplaces/lostplaces/templates/place_image/place_image_create.html b/django_lostplaces/lostplaces/templates/place_image/place_image_create.html index 4213cbd..455d9ef 100644 --- a/django_lostplaces/lostplaces/templates/place_image/place_image_create.html +++ b/django_lostplaces/lostplaces/templates/place_image/place_image_create.html @@ -1,9 +1,10 @@ {% extends 'global.html'%} +{% load i18n %} {% block maincontent %}
              - Submit images to an place + {% trans 'Submit images to a place' %} {% csrf_token %}
              diff --git a/django_lostplaces/lostplaces/templates/registration/login.html b/django_lostplaces/lostplaces/templates/registration/login.html index 4693be5..9ee497b 100644 --- a/django_lostplaces/lostplaces/templates/registration/login.html +++ b/django_lostplaces/lostplaces/templates/registration/login.html @@ -1,13 +1,13 @@ {% extends 'global.html'%} {% load static %} - -# {% block title %}Login{% endblock %} +{% load i18n %} +# {% block title %}{% trans 'Login' %}{% endblock %} {% block maincontent %}
              - Login + {% trans 'Login' %} {% csrf_token %}
              @@ -20,12 +20,12 @@
              - +
              -

              No account? Sign up here

              +

              {% trans 'Have No Account Yet?' %} {% trans 'Sign Up' %}

              {% endblock maincontent %} \ No newline at end of file diff --git a/django_lostplaces/lostplaces/templates/signup.html b/django_lostplaces/lostplaces/templates/signup.html index 517989e..62c84ac 100644 --- a/django_lostplaces/lostplaces/templates/signup.html +++ b/django_lostplaces/lostplaces/templates/signup.html @@ -1,14 +1,15 @@ {% extends 'global.html'%} {% load static %} +{% load i18n %} {% load widget_tweaks %} -# {% block title %}Registrierung{% endblock %} +# {% block title %}{% trans 'Sign up' %}{% endblock %} {% block maincontent %}
              - Registration + {% trans 'Sign Up' %} {% csrf_token %}
              @@ -37,7 +38,7 @@
              - +
              diff --git a/django_lostplaces/lostplaces/views/base_views.py b/django_lostplaces/lostplaces/views/base_views.py index 4737307..346f6d4 100644 --- a/django_lostplaces/lostplaces/views/base_views.py +++ b/django_lostplaces/lostplaces/views/base_views.py @@ -11,6 +11,7 @@ from django.contrib.messages.views import SuccessMessageMixin from django.shortcuts import redirect, get_object_or_404 from django.urls import reverse_lazy +from django.utils.translation import ugettext_lazy as _ from lostplaces.models import Place @@ -21,7 +22,7 @@ class IsAuthenticatedMixin(LoginRequiredMixin, View): the login page. ''' login_url = reverse_lazy('login') - permission_denied_message = 'Please login to proceed' + permission_denied_message = _('Please login to proceed') def handle_no_permission(self): messages.error(self.request, self.permission_denied_message) diff --git a/django_lostplaces/lostplaces/views/views.py b/django_lostplaces/lostplaces/views/views.py index 614cd59..1918feb 100644 --- a/django_lostplaces/lostplaces/views/views.py +++ b/django_lostplaces/lostplaces/views/views.py @@ -81,4 +81,7 @@ class PlaceTagDeleteView(IsAuthenticatedMixin, View): return redirect(reverse_lazy('place_detail', kwargs={'pk': tagged_id})) def FlatView(request, slug): - return render(request, 'flat/' + slug + '.html') + if request.LANGUAGE_CODE == 'de': + return render(request, 'flat/' + slug + '-de' + '.html') + else: + return render(request, 'flat/' + slug + '.html')