Add translations in backend
This commit is contained in:
parent
f69b607ca8
commit
dc4af21e00
|
|
@ -87,7 +87,7 @@ msgstr ""
|
|||
msgid "Lehrgang-Seite"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/course/models.py:278
|
||||
#: vbv_lernwelt/dashboard/person_export.py:116
|
||||
msgid "Teilnehmer"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ msgstr ""
|
|||
msgid "Versicherungsvermittler-Lehrgang"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/course/models.py:351
|
||||
#: vbv_lernwelt/course/models.py:350
|
||||
msgid "ÜK-Lehrgang"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -155,10 +155,30 @@ msgstr ""
|
|||
msgid "Email"
|
||||
msgstr "Email"
|
||||
|
||||
#: vbv_lernwelt/course_session/services/export_attendance.py:138
|
||||
#: vbv_lernwelt/course_session/services/export_attendance.py:127
|
||||
msgid "Lehrvertragsnummer"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:16
|
||||
msgid "export_personen"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:68
|
||||
msgid "Telefon"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:69
|
||||
msgid "Rolle"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:118
|
||||
msgid "Trainer"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:120
|
||||
msgid "Regionenleiter"
|
||||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/feedback/export.py:19
|
||||
msgid "export_feedback"
|
||||
msgstr ""
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -88,8 +88,9 @@ msgid "Lehrgang-Seite"
|
|||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/course/models.py:278
|
||||
#: vbv_lernwelt/dashboard/person_export.py:116
|
||||
msgid "Teilnehmer"
|
||||
msgstr ""
|
||||
msgstr "Participant"
|
||||
|
||||
#: vbv_lernwelt/course/models.py:279
|
||||
msgid "Experte/Trainer"
|
||||
|
|
@ -160,6 +161,28 @@ msgstr "E-mail"
|
|||
msgid "Lehrvertragsnummer"
|
||||
msgstr "Numéro de contrat d'apprentissage"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:16
|
||||
#, fuzzy
|
||||
#| msgid "export_anwesenheit"
|
||||
msgid "export_personen"
|
||||
msgstr "export_presence"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:68
|
||||
msgid "Telefon"
|
||||
msgstr "Téléphone"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:69
|
||||
msgid "Rolle"
|
||||
msgstr "Rôle"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:118
|
||||
msgid "Trainer"
|
||||
msgstr "Formateur / Formatrice"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:120
|
||||
msgid "Regionenleiter"
|
||||
msgstr "Responsable CI"
|
||||
|
||||
#: vbv_lernwelt/feedback/export.py:19
|
||||
msgid "export_feedback"
|
||||
msgstr "export_feedback"
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -88,8 +88,9 @@ msgid "Lehrgang-Seite"
|
|||
msgstr ""
|
||||
|
||||
#: vbv_lernwelt/course/models.py:278
|
||||
#: vbv_lernwelt/dashboard/person_export.py:116
|
||||
msgid "Teilnehmer"
|
||||
msgstr ""
|
||||
msgstr "Partecipante"
|
||||
|
||||
#: vbv_lernwelt/course/models.py:279
|
||||
msgid "Experte/Trainer"
|
||||
|
|
@ -160,6 +161,28 @@ msgstr "Email"
|
|||
msgid "Lehrvertragsnummer"
|
||||
msgstr "Numero di contratto di tirocinio"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:16
|
||||
#, fuzzy
|
||||
#| msgid "export_anwesenheit"
|
||||
msgid "export_personen"
|
||||
msgstr "esportazione_presenza"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:68
|
||||
msgid "Telefon"
|
||||
msgstr "Telefono"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:69
|
||||
msgid "Rolle"
|
||||
msgstr "Ruolo"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:118
|
||||
msgid "Trainer"
|
||||
msgstr "Trainer"
|
||||
|
||||
#: vbv_lernwelt/dashboard/person_export.py:120
|
||||
msgid "Regionenleiter"
|
||||
msgstr "Responsabile CI"
|
||||
|
||||
#: vbv_lernwelt/feedback/export.py:19
|
||||
msgid "export_feedback"
|
||||
msgstr "esportazione_feedback"
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ def _add_rows(
|
|||
idx_offset += 1
|
||||
continue
|
||||
|
||||
user_role = (user_cs.get("user_role"),)
|
||||
user_role = _role_as_string(user_cs.get("user_role"))
|
||||
idx = row_idx - idx_offset
|
||||
|
||||
sheet.cell(row=idx, column=1, value=user["first_name"])
|
||||
|
|
@ -108,4 +108,15 @@ def _add_rows(
|
|||
column=5,
|
||||
value=user.get("phone", ""),
|
||||
)
|
||||
sheet.cell(row=idx, column=6, value=user_role[0])
|
||||
sheet.cell(row=idx, column=6, value=user_role)
|
||||
|
||||
|
||||
def _role_as_string(role):
|
||||
if role == "MEMBER":
|
||||
return str(_("Teilnehmer"))
|
||||
elif role == "EXPERT":
|
||||
return str(_("Trainer"))
|
||||
elif role == "SUPERVISOR":
|
||||
return str(_("Regionenleiter"))
|
||||
else:
|
||||
return role
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import io
|
||||
|
||||
from django.utils.translation import activate
|
||||
from openpyxl import load_workbook
|
||||
|
||||
from vbv_lernwelt.core.constants import (
|
||||
|
|
@ -45,7 +46,7 @@ class PersonsExportTestCase(ExportBaseTestCase):
|
|||
self.test_student1.email,
|
||||
None,
|
||||
None,
|
||||
"MEMBER",
|
||||
"Teilnehmer",
|
||||
]
|
||||
self.test_student2_row = [
|
||||
self.test_student2.first_name,
|
||||
|
|
@ -53,7 +54,7 @@ class PersonsExportTestCase(ExportBaseTestCase):
|
|||
self.test_student2.email,
|
||||
None,
|
||||
None,
|
||||
"MEMBER",
|
||||
"Teilnehmer",
|
||||
]
|
||||
self.test_student3_row = [
|
||||
self.test_student3.first_name,
|
||||
|
|
@ -61,7 +62,7 @@ class PersonsExportTestCase(ExportBaseTestCase):
|
|||
self.test_student3.email,
|
||||
None,
|
||||
None,
|
||||
"MEMBER",
|
||||
"Teilnehmer",
|
||||
]
|
||||
self.test_trainer1_row = [
|
||||
self.test_trainer1.first_name,
|
||||
|
|
@ -69,7 +70,7 @@ class PersonsExportTestCase(ExportBaseTestCase):
|
|||
self.test_trainer1.email,
|
||||
None,
|
||||
None,
|
||||
"EXPERT",
|
||||
"Trainer",
|
||||
]
|
||||
self.test_trainer2_row = [
|
||||
self.test_trainer2.first_name,
|
||||
|
|
@ -77,7 +78,7 @@ class PersonsExportTestCase(ExportBaseTestCase):
|
|||
self.test_trainer2.email,
|
||||
None,
|
||||
None,
|
||||
"EXPERT",
|
||||
"Trainer",
|
||||
]
|
||||
|
||||
def _generate_expected_data(self, rows):
|
||||
|
|
@ -139,3 +140,45 @@ class PersonsExportTestCase(ExportBaseTestCase):
|
|||
wb.active = wb["Test Zürich 2022 a"]
|
||||
|
||||
self._check_export(wb, [[None] * 6], 1, 6)
|
||||
|
||||
def test_export_in_fr(self):
|
||||
activate("fr")
|
||||
wb = self._generate_workbook(self.test_trainer1, [self.course_session_be.id])
|
||||
self.assertEqual(len(wb.sheetnames), 1)
|
||||
self.assertEqual(wb.sheetnames[0], "Test Bern 2022 a")
|
||||
wb.active = wb["Test Bern 2022 a"]
|
||||
|
||||
header = [
|
||||
"Prénom",
|
||||
"Nom de famille",
|
||||
"E-mail",
|
||||
"Numéro de contrat d'apprentissage",
|
||||
"Téléphone",
|
||||
"Rôle",
|
||||
]
|
||||
|
||||
self.assertEqual([cell.value for cell in wb.active[1]], header)
|
||||
self.assertEqual(wb.active.cell(row=2, column=6).value, "Participant")
|
||||
self.assertEqual(
|
||||
wb.active.cell(row=5, column=6).value, "Formateur / Formatrice"
|
||||
)
|
||||
|
||||
def test_export_in_it(self):
|
||||
activate("it")
|
||||
wb = self._generate_workbook(self.test_trainer1, [self.course_session_be.id])
|
||||
self.assertEqual(len(wb.sheetnames), 1)
|
||||
self.assertEqual(wb.sheetnames[0], "Test Bern 2022 a")
|
||||
wb.active = wb["Test Bern 2022 a"]
|
||||
|
||||
header = [
|
||||
"Nome",
|
||||
"Cognome",
|
||||
"Email",
|
||||
"Numero di contratto di tirocinio",
|
||||
"Telefono",
|
||||
"Ruolo",
|
||||
]
|
||||
|
||||
self.assertEqual([cell.value for cell in wb.active[1]], header)
|
||||
self.assertEqual(wb.active.cell(row=2, column=6).value, "Partecipante")
|
||||
self.assertEqual(wb.active.cell(row=5, column=6).value, "Trainer")
|
||||
|
|
|
|||
Loading…
Reference in New Issue