1
0
Fork 0

changed languages default to german, translated last labels (verbosename) for variables

This commit is contained in:
Benni Bärmann 2022-12-04 16:40:23 +00:00
parent 97525ad564
commit b662011618
7 changed files with 23 additions and 10 deletions

View File

@ -15,9 +15,17 @@ Including another URLconf
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path, include from django.urls import path, include
from django.conf.urls.i18n import i18n_patterns
urlpatterns = [ urlpatterns = [
path('', include("input.urls")), path('', include("input.urls")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('accounts/', include('django.contrib.auth.urls')), path('accounts/', include('django.contrib.auth.urls')),
] ]
#urlpatterns = i18n_patterns('',
# path('', include("input.urls")),
# path('admin/', admin.site.urls),
# path('accounts/', include('django.contrib.auth.urls')),
# #your urls
#)

View File

@ -22,7 +22,7 @@ def export_as_csv(self, request, queryset):
return response return response
export_as_csv.short_description = "Export Selected" export_as_csv.short_description = "Ausgewähltes zu CSV exportieren"
admin.site.add_action(export_as_csv) admin.site.add_action(export_as_csv)

View File

@ -150,7 +150,6 @@ class Command(BaseCommand):
# [IF_EMAIL], # [IF_EMAIL],
# fail_silently=False) # fail_silently=False)
project.end_mail_send = True
project.mail_state = 'END' project.mail_state = 'END'
try: try:
project.save() project.save()
@ -209,7 +208,6 @@ class Command(BaseCommand):
# [IF_EMAIL], # [IF_EMAIL],
# fail_silently=False) # fail_silently=False)
project.end_mail_send = True
project.mail_state = 'END' project.mail_state = 'END'
project.save() project.save()
except BadHeaderError: except BadHeaderError:

View File

@ -17,8 +17,8 @@ class Volunteer(models.Model):
help_text=format_html('Bitte gib deine E-Mail-Adresse ein, damit dich<br>Wikimedia Deutschland bei Rückfragen oder für<br>die Zusage kontaktieren kann.')) help_text=format_html('Bitte gib deine E-Mail-Adresse ein, damit dich<br>Wikimedia Deutschland bei Rückfragen oder für<br>die Zusage kontaktieren kann.'))
# the following Fields are not supposed to be edited by users # the following Fields are not supposed to be edited by users
granted = models.BooleanField(null=True) granted = models.BooleanField(null=True, verbose_name='bewilligt')
granted_date = models.DateField(null=True) granted_date = models.DateField(null=True, verbose_name='bewilligt am')
survey_mail_send = models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken') survey_mail_send = models.BooleanField(default=False, verbose_name='Keine Umfragemail schicken')
survey_mail_date = models.DateField(verbose_name='Umfragemail wurde verschickt am', null=True, blank=True) survey_mail_date = models.DateField(verbose_name='Umfragemail wurde verschickt am', null=True, blank=True)
mail_state = models.CharField(max_length=6, choices=EMAIL_STATES.items(), default='NONE') mail_state = models.CharField(max_length=6, choices=EMAIL_STATES.items(), default='NONE')
@ -61,7 +61,7 @@ class Account(models.Model):
code = models.CharField('Kostenstelle', max_length=5, default="DEF", code = models.CharField('Kostenstelle', max_length=5, default="DEF",
null=False, primary_key = True) null=False, primary_key = True)
description = models.CharField('Beschreibung', max_length=60, default='NO DESCRIPTION') description = models.CharField('Beschreibung', max_length=60, default='NO DESCRIPTION')
intern_notes = models.TextField(max_length=1000, blank=True) intern_notes = models.TextField(max_length=1000, blank=True, verbose_name="interne Anmerkungen")
def __str__(self): def __str__(self):
return f"{self.code} {self.description}" return f"{self.code} {self.description}"
@ -81,7 +81,7 @@ class Project(Volunteer):
insurance = models.BooleanField(default=False, verbose_name='Haftpflichtversicherung') insurance = models.BooleanField(default=False, verbose_name='Haftpflichtversicherung')
insurance_technic = models.BooleanField(default=False, verbose_name='Technikversicherung Ausland') insurance_technic = models.BooleanField(default=False, verbose_name='Technikversicherung Ausland')
support = models.CharField(max_length=300, blank=True, null=True, verbose_name='Betreuungsperson und Vertretung') support = models.CharField(max_length=300, blank=True, null=True, verbose_name='Betreuungsperson und Vertretung')
cost = models.IntegerField(blank=True, null=True) cost = models.IntegerField(blank=True, null=True, verbose_name='Kosten')
account = models.ForeignKey('Account', on_delete=models.CASCADE, null=True, to_field='code', db_constraint = False) account = models.ForeignKey('Account', on_delete=models.CASCADE, null=True, to_field='code', db_constraint = False)
granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von') granted_from = models.CharField(max_length=100,null=True,verbose_name='Bewilligt von')
notes = models.TextField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen') notes = models.TextField(max_length=1000,null=True,blank=True,verbose_name='Anmerkungen')
@ -89,7 +89,7 @@ class Project(Volunteer):
# the following Fields are not supposed to be edited by users # the following Fields are not supposed to be edited by users
pid = models.CharField(max_length=15, null=True, blank=True) pid = models.CharField(max_length=15, null=True, blank=True)
end_mail_send = models.BooleanField(null=True) end_mail_send = models.BooleanField(null=True, verbose_name='Endmail versenden')
status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet'),('NOT','nicht stattgefunden')),default='RUN') status = models.CharField(max_length=3,choices=(('RUN', 'läuft'),('END','beendet'),('NOT','nicht stattgefunden')),default='RUN')
persons = models.IntegerField(default=1) persons = models.IntegerField(default=1)
finance_id = models.CharField(max_length=15, null= True, blank=True) finance_id = models.CharField(max_length=15, null= True, blank=True)

View File

@ -12,6 +12,12 @@ DATAPROTECTION = "https://www.wikimedia.de/datenschutz/#datenerfassung"
FOERDERRICHTLINIEN = "https://de.wikipedia.org/wiki/Wikipedia:Wikimedia_Deutschland/F%C3%B6rderrichtlinien" FOERDERRICHTLINIEN = "https://de.wikipedia.org/wiki/Wikipedia:Wikimedia_Deutschland/F%C3%B6rderrichtlinien"
NUTZUNGSBEDINGUNGEN = 'static/input/nutzungsbedingungen.html' NUTZUNGSBEDINGUNGEN = 'static/input/nutzungsbedingungen.html'
LANGUAGE_CODE = 'de'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
ACCOUNTS ={ # "21103": '21103 Willkommen', ACCOUNTS ={ # "21103": '21103 Willkommen',
"DEF": 'DEFAULT VALUE, you hould not see this!', "DEF": 'DEFAULT VALUE, you hould not see this!',

View File

@ -1,12 +1,12 @@
from django.urls import path from django.urls import path
from .views import ExternView, done, authorize, deny, InternView, export from .views import ExternView, done, authorize, deny, InternView, export
urlpatterns = [ urlpatterns = [
path('', ExternView.as_view(), name='extern'), path('', ExternView.as_view(), name='extern'),
# path('intern', InternView.as_view(), name='intern'), # path('intern', InternView.as_view(), name='intern'),
path('saved', done, name='done'), path('saved', done, name='done'),
path('export', export, name='export'), path('export', export, name='export'),
path('authorize/<str:choice>/<int:pk>', authorize, name='authorize'), path('authorize/<str:choice>/<int:pk>', authorize, name='authorize'),
path('deny/<str:choice>/<int:pk>', deny, name='deny') path('deny/<str:choice>/<int:pk>', deny, name='deny'),
] ]

View File

@ -12,6 +12,7 @@ from django.template import Context
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
from django.utils.html import format_html from django.utils.html import format_html
from django.utils.translation import gettext as _
from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\ from .forms import ProjectForm, ExternForm, LibraryForm, IFGForm, LiteratureForm,\
HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\ HonoraryCertificateForm, InternForm, TravelForm, EmailForm,\