Add translations for some models

Relates to MS-479
This commit is contained in:
Ramon Wenger 2022-09-14 16:40:27 +02:00
parent d787367020
commit ce5d8603ff
10 changed files with 443 additions and 10 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 3.2.13 on 2022-09-14 13:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('assignments', '0014_alter_assignment_assignment'),
]
operations = [
migrations.AlterModelOptions(
name='assignment',
options={'verbose_name': 'assignment', 'verbose_name_plural': 'assignments'},
),
]

View File

@ -8,6 +8,7 @@ from wagtailautocomplete.edit_handlers import AutocompletePanel
from wagtail.search import index from wagtail.search import index
from core.constants import DEFAULT_RICH_TEXT_FEATURES from core.constants import DEFAULT_RICH_TEXT_FEATURES
from django.utils.translation import ugettext_lazy as _
@register_snippet @register_snippet
@ -39,6 +40,10 @@ class Assignment(index.Indexed, TimeStampedModel):
def __str__(self): def __str__(self):
return self.title if not self.user_created else '{} (erstellt von {})'.format(self.title, self.owner) return self.title if not self.user_created else '{} (erstellt von {})'.format(self.title, self.owner)
class Meta:
verbose_name = _('assignment')
verbose_name_plural = _('assignments')
class StudentSubmission(TimeStampedModel): class StudentSubmission(TimeStampedModel):
text = models.TextField(blank=True) text = models.TextField(blank=True)

View File

@ -4,7 +4,6 @@ from .models import Assignment
class AssignmentAdmin(ModelAdmin): class AssignmentAdmin(ModelAdmin):
model = Assignment model = Assignment
menu_label = 'Assignments'
list_display = ('title', 'module', 'assignment') list_display = ('title', 'module', 'assignment')
search_fields = ('title', 'assignment') search_fields = ('title', 'assignment')
menu_icon = 'form' menu_icon = 'form'

View File

@ -0,0 +1,34 @@
# Generated by Django 3.2.13 on 2022-09-14 13:38
import books.blocks
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('basicknowledge', '0024_auto_20220913_1055'),
]
operations = [
migrations.AlterModelOptions(
name='basicknowledge',
options={'verbose_name': 'instrument', 'verbose_name_plural': 'instruments'},
),
migrations.AlterModelOptions(
name='instrumentcategory',
options={'verbose_name': 'instrument category', 'verbose_name_plural': 'instrument categories'},
),
migrations.AlterModelOptions(
name='instrumenttype',
options={'verbose_name': 'instrument type', 'verbose_name_plural': 'instrument types'},
),
migrations.AlterField(
model_name='basicknowledge',
name='contents',
field=wagtail.core.fields.StreamField([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['bold', 'ul', 'brand', 'secondary']))])), ('image_block', wagtail.images.blocks.ImageChooserBlock()), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('section_title', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock())])), ('infogram_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock()), ('title', wagtail.core.blocks.TextBlock())])), ('genially_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('thinglink_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('subtitle', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock())])), ('cms_document_block', books.blocks.CMSDocumentBlock())], blank=True, null=True),
),
]

View File

@ -9,6 +9,7 @@ from books.blocks import CMSDocumentBlock, DocumentBlock, GeniallyBlock, Infogra
SubtitleBlock, ThinglinkBlock, VideoBlock SubtitleBlock, ThinglinkBlock, VideoBlock
from core.constants import DEFAULT_RICH_TEXT_FEATURES from core.constants import DEFAULT_RICH_TEXT_FEATURES
from core.wagtail_utils import StrictHierarchyPage from core.wagtail_utils import StrictHierarchyPage
from django.utils.translation import ugettext_lazy as _
LANGUAGE_COMMUNICATION = 'language_communication' LANGUAGE_COMMUNICATION = 'language_communication'
SOCIETY = 'society' SOCIETY = 'society'
@ -27,7 +28,8 @@ class InstrumentCategory(models.Model):
return self.name return self.name
class Meta: class Meta:
verbose_name_plural = 'instrument categories' verbose_name_plural = _('instrument categories')
verbose_name = _('instrument category')
def default_category(): def default_category():
@ -35,6 +37,10 @@ def default_category():
class InstrumentType(models.Model): class InstrumentType(models.Model):
class Meta:
verbose_name = _('instrument type')
verbose_name_plural = _('instrument types')
CATEGORY_CHOICES = ( CATEGORY_CHOICES = (
(LANGUAGE_COMMUNICATION, LANGUAGE_COMMUNICATION_LABEL), (LANGUAGE_COMMUNICATION, LANGUAGE_COMMUNICATION_LABEL),
(SOCIETY, SOCIETY_LABEL), (SOCIETY, SOCIETY_LABEL),
@ -58,7 +64,12 @@ class InstrumentType(models.Model):
return self.type return self.type
class BasicKnowledge(StrictHierarchyPage): class BasicKnowledge(StrictHierarchyPage):
class Meta:
verbose_name = _('instrument')
verbose_name_plural = _('instruments')
parent_page_types = ['books.book'] parent_page_types = ['books.book']
intro = RichTextField(features=DEFAULT_RICH_TEXT_FEATURES, default='', blank=True) intro = RichTextField(features=DEFAULT_RICH_TEXT_FEATURES, default='', blank=True)
@ -92,5 +103,3 @@ class BasicKnowledge(StrictHierarchyPage):
StreamFieldPanel('contents') StreamFieldPanel('contents')
] ]
class Meta:
verbose_name = 'Instrument'

View File

@ -1,10 +1,10 @@
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register from wagtail.contrib.modeladmin.options import ModelAdmin, ModelAdminGroup, modeladmin_register
from .models import BasicKnowledge, InstrumentCategory, InstrumentType from .models import BasicKnowledge, InstrumentCategory, InstrumentType
from django.utils.translation import ugettext_lazy as _
class InstrumentAdmin(ModelAdmin): class InstrumentAdmin(ModelAdmin):
model = BasicKnowledge model = BasicKnowledge
menu_label = 'Instruments'
list_display = ('title', 'new_type', 'status_string') list_display = ('title', 'new_type', 'status_string')
search_fields = ('title', 'new_type__name') search_fields = ('title', 'new_type__name')
@ -21,6 +21,9 @@ class InstrumentTypeAdmin(ModelAdmin):
inspect_view_fields = ('name', 'category', 'instruments',) inspect_view_fields = ('name', 'category', 'instruments',)
modeladmin_register(InstrumentAdmin) class InstrumentGroup(ModelAdminGroup):
modeladmin_register(InstrumentCategoryAdmin) menu_label = _('Instruments')
modeladmin_register(InstrumentTypeAdmin) items = (InstrumentAdmin, InstrumentTypeAdmin, InstrumentCategoryAdmin,)
modeladmin_register(InstrumentGroup)

View File

@ -0,0 +1,26 @@
# Generated by Django 3.2.13 on 2022-09-14 13:38
import assignments.models
import books.blocks
from django.db import migrations
import surveys.models
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.images.blocks
import wagtail.snippets.blocks
class Migration(migrations.Migration):
dependencies = [
('books', '0035_auto_20220728_0848'),
]
operations = [
migrations.AlterField(
model_name='contentblock',
name='contents',
field=wagtail.core.fields.StreamField([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))])), ('basic_knowledge', wagtail.core.blocks.StructBlock([('description', wagtail.core.blocks.RichTextBlock(required=False)), ('basic_knowledge', wagtail.core.blocks.PageChooserBlock(page_type=['basicknowledge.BasicKnowledge'], required=True))])), ('assignment', wagtail.core.blocks.StructBlock([('assignment_id', wagtail.snippets.blocks.SnippetChooserBlock(assignments.models.Assignment))])), ('survey', wagtail.core.blocks.StructBlock([('survey_id', wagtail.snippets.blocks.SnippetChooserBlock(surveys.models.Survey))])), ('image_block', wagtail.images.blocks.ImageChooserBlock()), ('image_url_block', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('solution', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold'])), ('document', books.blocks.CMSDocumentBlock(required=False))])), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('infogram_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock()), ('title', wagtail.core.blocks.TextBlock())])), ('genially_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('thinglink_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('subtitle', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock())])), ('instruction', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=False)), ('text', wagtail.core.blocks.TextBlock(required=False)), ('document', wagtail.documents.blocks.DocumentChooserBlock(required=False))])), ('module_room_slug', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('cms_document_block', books.blocks.CMSDocumentBlock()), ('content_list_item', wagtail.core.blocks.StreamBlock([('text_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold']))])), ('basic_knowledge', wagtail.core.blocks.StructBlock([('description', wagtail.core.blocks.RichTextBlock(required=False)), ('basic_knowledge', wagtail.core.blocks.PageChooserBlock(page_type=['basicknowledge.BasicKnowledge'], required=True))])), ('assignment', wagtail.core.blocks.StructBlock([('assignment_id', wagtail.snippets.blocks.SnippetChooserBlock(assignments.models.Assignment))])), ('survey', wagtail.core.blocks.StructBlock([('survey_id', wagtail.snippets.blocks.SnippetChooserBlock(surveys.models.Survey))])), ('image_block', wagtail.images.blocks.ImageChooserBlock()), ('image_url_block', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('link_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock()), ('url', wagtail.core.blocks.URLBlock())])), ('solution', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(features=['ul', 'bold'])), ('document', books.blocks.CMSDocumentBlock(required=False))])), ('video_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('document_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock())])), ('infogram_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock()), ('title', wagtail.core.blocks.TextBlock())])), ('genially_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('thinglink_block', wagtail.core.blocks.StructBlock([('id', wagtail.core.blocks.TextBlock())])), ('subtitle', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock())])), ('instruction', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=False)), ('text', wagtail.core.blocks.TextBlock(required=False)), ('document', wagtail.documents.blocks.DocumentChooserBlock(required=False))])), ('module_room_slug', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.TextBlock())])), ('cms_document_block', books.blocks.CMSDocumentBlock())]))], blank=True, null=True),
),
]

View File

@ -88,7 +88,8 @@ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.gzip.GZipMiddleware', 'django.middleware.gzip.GZipMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware' 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware'
] ]
# Enable CORS for local development # Enable CORS for local development

Binary file not shown.

View File

@ -0,0 +1,339 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-14 13:57+0000\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"
"Language: \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"
#: assignments/models.py:44
msgid "assignment"
msgstr "auftrag"
#: assignments/models.py:45
msgid "assignments"
msgstr "aufträge"
#: basicknowledge/models.py:31
msgid "instrument categories"
msgstr "instrumentkategorien"
#: basicknowledge/models.py:32
msgid "instrument category"
msgstr "instrumentkategorie"
#: basicknowledge/models.py:41
msgid "instrument types"
msgstr "instrumenttypen"
#: basicknowledge/models.py:69
msgid "instrument"
msgstr "instrument"
#: basicknowledge/models.py:70
msgid "instruments"
msgstr "instrumente"
#: basicknowledge/wagtail_hooks.py:25
msgid "Instruments"
msgstr "Instrumente"
#: core/settings.py:197
msgid "German"
msgstr ""
#: core/settings.py:198
msgid "English"
msgstr ""
#: core/templates/registration/login.html:9
msgid "Melden Sie sich jetzt an."
msgstr ""
#: core/templates/registration/login.html:14
msgid "Email und Passwort stimmen nicht überein."
msgstr ""
#: core/templates/registration/login.html:22
msgid "E-Mail"
msgstr ""
#: core/templates/registration/login.html:30
msgid "Anmelden"
msgstr ""
#: core/templates/registration/login.html:34
#: core/templates/registration/password_reset_form.html:5
#: core/templates/registration/password_reset_form.html:9
msgid "Passwort vergessen?"
msgstr ""
#: core/templates/registration/password_reset_complete.html:4
#: core/templates/registration/password_reset_complete.html:8
msgid "Passwort zurücksetzen abgeschlossen"
msgstr ""
#: core/templates/registration/password_reset_complete.html:9
msgid ""
"Ihr Passwort wurde zurückgesetzt. Sie können sich nun auf der Loginseite "
"anmelden."
msgstr ""
#: core/templates/registration/password_reset_complete.html:10
msgid "Einloggen"
msgstr ""
#: core/templates/registration/password_reset_confirm.html:5
#: core/templates/registration/registration_set_password_confirm.html:5
#: core/templates/registration/set_password_confirm.html:5
msgid "Setzen Sie Ihr Passwort"
msgstr ""
#: core/templates/registration/password_reset_confirm.html:9
msgid "Setzen Sie Ihr neues Passwort"
msgstr ""
#: core/templates/registration/password_reset_confirm.html:10
#: users/serializers.py:51
msgid "Das Passwort muss Grossbuchstaben, Zahlen und Sonderzeichen beinhalten"
msgstr ""
#: core/templates/registration/password_reset_confirm.html:14
#: core/templates/registration/password_reset_form.html:17
msgid "Passwort zurücksetzen"
msgstr ""
#: core/templates/registration/password_reset_done.html:5
msgid "Anweisungen versandt"
msgstr ""
#: core/templates/registration/password_reset_done.html:9
#: core/templates/registration/registration_set_password_done.html:5
#: core/templates/registration/registration_set_password_done.html:9
#: core/templates/registration/set_password_done.html:5
#: core/templates/registration/set_password_done.html:9
msgid "Schauen Sie in Ihr Postfach"
msgstr ""
#: core/templates/registration/password_reset_done.html:10
msgid ""
"Wir haben die Anweisungen, um Ihr Passwort zurückzusetzen, an Sie "
"verschickt. Die E-Mail sollte in Kürze bei Ihnen ankommen."
msgstr ""
#: core/templates/registration/password_reset_email.html:5
#, python-format
msgid ""
"Sie erhalten diese E-Mail, weil Ihr Passwort auf %(site_name)s zurückgesetzt "
"wurde."
msgstr ""
#: core/templates/registration/password_reset_email.html:9
#: core/templates/registration/registration_set_password_email.html:9
#: core/templates/registration/set_password_email.html:7
msgid "Bitte öffnen Sie folgende Seite, um Ihr neues Passwort einzugeben:"
msgstr ""
#: core/templates/registration/password_reset_email.html:17
#: core/templates/registration/registration_set_password_email.html:19
#: core/templates/registration/set_password_email.html:11
msgid "Ihr Benutzername lautet:"
msgstr ""
#: core/templates/registration/password_reset_email.html:19
msgid "Ihr Skillbox Team"
msgstr ""
#: core/templates/registration/password_reset_form.html:10
#: core/templates/registration/registration_set_password_confirm.html:10
msgid ""
"Kein Problem! Geben Sie Ihre E-Mail-Adresse ein und erhalten Sie weitere "
"Anweisungen."
msgstr ""
#: core/templates/registration/registration_set_password_complete.html:4
#: core/templates/registration/registration_set_password_complete.html:8
#: core/templates/registration/set_password_complete.html:4
#: core/templates/registration/set_password_complete.html:8
msgid "Sie haben es geschafft"
msgstr ""
#: core/templates/registration/registration_set_password_complete.html:9
#: core/templates/registration/set_password_complete.html:9
msgid ""
"Ihr Passwort wurde erfolgreich gespeichert. Sie können sich nun anmelden."
msgstr ""
#: core/templates/registration/registration_set_password_complete.html:10
#: core/templates/registration/set_password_complete.html:10
msgid "Jetzt anmelden"
msgstr ""
#: core/templates/registration/registration_set_password_confirm.html:9
#: core/templates/registration/set_password_confirm.html:9
msgid "Geben Sie ein persönliches Passwort ein:"
msgstr ""
#: core/templates/registration/registration_set_password_confirm.html:14
#: core/templates/registration/set_password_confirm.html:14
msgid "Passwort speichern"
msgstr ""
#: core/templates/registration/registration_set_password_done.html:10
#: core/templates/registration/set_password_done.html:10
msgid ""
"Wir haben ein E-Mail mit allen weiteren Anweisungen an Sie verschickt. Die E-"
"Mail sollte in Kürze bei Ihnen ankommen."
msgstr ""
#: core/templates/registration/registration_set_password_email.html:5
#: core/templates/registration/set_password_email.html:5
msgid ""
"Sie erhalten diese E-Mail, um Ihr Passwort auf mySkillbox initial zu setzen."
msgstr ""
#: core/templates/registration/registration_set_password_email.html:23
#: core/templates/registration/set_password_email.html:13
msgid "Ihr mySkillbox Team"
msgstr ""
#: core/templates/registration/registration_set_password_form.html:5
#: core/templates/registration/set_password_form.html:5
msgid "Willkommen bei mySkillbox"
msgstr ""
#: core/templates/registration/registration_set_password_form.html:9
#: core/templates/registration/set_password_form.html:9
msgid "Willkommen bei Myskillbox"
msgstr ""
#: core/templates/registration/registration_set_password_form.html:10
#: core/templates/registration/set_password_form.html:10
msgid ""
"Bevor Sie mySkillbox verwenden können, müssen Sie Ihre E-Mail-Adresse "
"bestätigen und ein persönliches Passwort festlegen."
msgstr ""
#: core/templates/registration/registration_set_password_form.html:14
#: core/templates/registration/set_password_form.html:14
msgid "Geben Sie als erstes hier Ihre E-Mail-Adresse ein:"
msgstr ""
#: core/templates/registration/registration_set_password_form.html:17
#: core/templates/registration/set_password_form.html:17
msgid "E-Mail bestätigen"
msgstr ""
#: core/templates/registration/set_password_confirm.html:10
msgid "Das Passwort muss Grossbuchstaben, Zahlen und Sonderzeichen beinhalten."
msgstr ""
#: core/templates/registration/set_password_done.html:11
msgid ""
"Hinweis: Ihre persönlichen Angaben für Ihr Benutzerkonto wurden zuvor in "
"mySkillbox importiert. Sie können ausschliesslich die importierte E-Mail-"
"Adresse verwenden. Wenn Sie nicht wissen, welche E-Mail-Adresse für Sie "
"importiert wurde, können Sie Ihre Lehrperson fragen."
msgstr ""
#: core/templates/wagtailadmin/pages/listing/_list.html:34
#, python-format
msgid ""
"%(time_period)s\n"
" ago"
msgstr ""
#: core/templates/wagtailadmin/pages/listing/_list.html:55
msgid "Select page"
msgstr ""
#: core/templates/wagtailadmin/pages/listing/_list.html:63
msgid "Drag"
msgstr ""
#: core/templates/wagtailadmin/pages/listing/_list.html:79
msgid "Edit this page"
msgstr ""
#: core/templates/wagtailadmin/pages/listing/_list.html:106
#, python-format
msgid ""
"%(time_period)s\n"
" ago"
msgstr ""
#: news/models.py:6
msgid "Image URL"
msgstr ""
#: news/models.py:7
msgid "Title"
msgstr ""
#: news/models.py:8
msgid "Description"
msgstr ""
#: news/models.py:11
msgid "News Article URL"
msgstr ""
#: news/models.py:12
msgid "Image Source"
msgstr ""
#: users/managers.py:24
msgid "Lehrperson"
msgstr ""
#: users/managers.py:25
msgid "Schüler"
msgstr ""
#: users/models.py:38
msgid "email address"
msgstr ""
#: users/models.py:239
msgid "Key"
msgstr ""
#: users/models.py:240
msgid "Name"
msgstr ""
#: users/models.py:241
msgid "Role permission"
msgstr ""
#: users/serializers.py:27
msgid "Das eingegebene Passwort ist falsch"
msgstr ""
#: users/serializers.py:34
msgid "Das neue Passwort muss gesetzt werden"
msgstr ""
#: users/serializers.py:36
msgid "Das alte Passwort muss angegeben werden"
msgstr ""
#, fuzzy
#~| msgid "instrument category"
#~ msgid "instrument type"
#~ msgstr "instrumenttyp"
#~ msgid "assignmentsss"
#~ msgstr "aufträge"