From 361b6b497c47835e85397302ee94e749376f68b8 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 7 Feb 2022 14:54:40 +0100 Subject: [PATCH] translation of dataloop works now --- TODO | 7 +++---- evapp/templates/evapp/dataloop.txt | 3 ++- evapp/templates/evapp/department_mail.txt | 5 ++++- evapp/views.py | 1 + locale/en/LC_MESSAGES/django.po | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/TODO b/TODO index 7c3ee5b..280e8ec 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ +* switch to django 4 + + from https://otrs.wikimedia.de/otrs/index.pl?Action=AgentTicketZoom;TicketID=754407: * Team field should be longer @@ -8,7 +11,3 @@ minor stuff: * remove dot before "Nextcloud" at login page. * add Testmode warning at login screen - -translations: - -- dataloop translation missing diff --git a/evapp/templates/evapp/dataloop.txt b/evapp/templates/evapp/dataloop.txt index b4c89a5..6e484a9 100644 --- a/evapp/templates/evapp/dataloop.txt +++ b/evapp/templates/evapp/dataloop.txt @@ -1,4 +1,5 @@ +{% load i18n %} {% autoescape off %} {% for key, value in data.items %}{% if key == 'laptop' %} {{ key }}: {{ value | safe}}{% else %} -{{ key }}: {{ value }}{% endif %}{% endfor %} +{% trans key %}: {{ value }}{% endif %}{% endfor %} {% endautoescape %} diff --git a/evapp/templates/evapp/department_mail.txt b/evapp/templates/evapp/department_mail.txt index e76497a..8645617 100644 --- a/evapp/templates/evapp/department_mail.txt +++ b/evapp/templates/evapp/department_mail.txt @@ -1,3 +1,5 @@ +{% load i18n %} + (english below) Hallo! @@ -13,7 +15,7 @@ Wenn Du Fragen hast, melde Dich bei {{contact}}. Grüße, Deine E.V.A. ------------------------- - +{% language 'en' %} Hi! There is a new employee at Wikimedia! Here ( https://wiki.wikimedia.de/wiki/Onboarding ) you can see, which @@ -26,3 +28,4 @@ All Data you need for this: If you have any questions please write to {{contact}}. Regards, Your E.V.A. +{% endlanguage %} diff --git a/evapp/views.py b/evapp/views.py index 6a502a7..0491415 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -10,6 +10,7 @@ from formtools.wizard.views import CookieWizardView from django.shortcuts import render from django.conf import settings from django.contrib.auth.mixins import LoginRequiredMixin +from django.utils.translation import gettext_lazy as _ from .models import Employee, DEPARTMENT_CHOICES, OS_CHOICES, VENDOR_CHOICES, \ LANG_CHOICES, ACCOUNT_CHOICES, TRANSPONDER_CHOICES, KEYBOARD_CHOICES diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index c7bba05..8759790 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-31 12:06+0100\n" +"POT-Creation-Date: 2022-02-07 14:44+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,7 +70,7 @@ msgstr "Special Doors (please note below)" msgid "Kein Transponder" msgstr "No transponder" -#: evapp/models.py:50 +#: evapp/models.py:50 evapp/templates/evapp/department_mail.txt:26 msgid "Vorname" msgstr "Firstname"