From aec2fdac167f6760d8dfe661e17df8ba00b4a31f Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 25 Jan 2022 11:21:57 +0100 Subject: [PATCH] translation (not working actually) --- eva/settings_development.py | 3 ++- evapp/templates/evapp/employee_form.html | 5 ++++- evapp/tests.py | 11 +++++++--- locale/en/LC_MESSAGES/django.po | 28 ++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 locale/en/LC_MESSAGES/django.po diff --git a/eva/settings_development.py b/eva/settings_development.py index cdcd234..09a15d2 100644 --- a/eva/settings_development.py +++ b/eva/settings_development.py @@ -58,6 +58,7 @@ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -119,7 +120,7 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ -LANGUAGE_CODE = 'en-us' +# LANGUAGE_CODE = 'de' TIME_ZONE = 'UTC' diff --git a/evapp/templates/evapp/employee_form.html b/evapp/templates/evapp/employee_form.html index e95669d..618ea69 100644 --- a/evapp/templates/evapp/employee_form.html +++ b/evapp/templates/evapp/employee_form.html @@ -14,6 +14,9 @@ {% load socialaccount %} {% if user.is_authenticated %} {% block content %} + +{% get_current_language as LANGUAGE_CODE %} +