in modells we use lazy translation

This commit is contained in:
Benni Bärmann 2022-01-26 15:54:27 +01:00
parent 82dd63a1b5
commit 1cb419f73f
3 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
from django.db import models
from multiselectfield import MultiSelectField
from django.utils.translation import gettext_lazy as _
# ATTENTION!!!
# No key should be used twice in any of these dicts because of the
@ -46,7 +47,7 @@ class Employee(models.Model):
# usermail = models.EmailField(max_length=50, verbose_name="Deine Mailadresse (Ansprechpartner_in)", default='bestechefin@wikimedia.de')
# personal data
firstname = models.CharField(max_length=50, verbose_name="Vorname")
firstname = models.CharField(max_length=50, verbose_name=_("Vorname"))
lastname = models.CharField(max_length=50, verbose_name="Nachname")
# intern = models.BooleanField(verbose_name='Interne_r Mitarbeiter_in?', default=True)
department = models.CharField(max_length=5, choices=DEPARTMENT_CHOICES.items(), verbose_name='Bereich')

View File

@ -25,6 +25,7 @@ class LoginTestCase(TestCase):
print (response_en.content)
print('END')
self.assertContains(response_en, 'You are logged in as vladimir@reiherzehe.com', status_code=200)
self.assertContains(response_en, 'Firstname', status_code=200)
def testDebugWarning(self):
with self.settings(DEBUG=True):

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-26 13:11+0100\n"
"POT-Creation-Date: 2022-01-26 15:52+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,6 +18,10 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: evapp/models.py:50
msgid "Vorname"
msgstr "Firstname"
#: evapp/templates/evapp/employee_form.html:36
msgid "WARNUNG! Test-MODUS aktiviert. Es werden keine Mails verschickt!"
msgstr "ATTENTION! Test mode activated. No mails will be send."