Commit 28db65de authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

i18n in place, startpage text

closes #1
parent 83f49e39
Pipeline #127541 passed with stage
in 2 minutes and 47 seconds
...@@ -11,11 +11,11 @@ list running containers ...@@ -11,11 +11,11 @@ list running containers
enter running container enter running container
docker exec -it plan-git_django_1 bash docker exec -it plan_django_1 bash
logs logs
docker logs rdmo_django_1 docker logs plan_django_1
## compose ## compose
...@@ -25,7 +25,7 @@ build images: ...@@ -25,7 +25,7 @@ build images:
run container: run container:
docker-compose build docker-compose up
create super-user (on first run) create super-user (on first run)
...@@ -44,37 +44,26 @@ Additional commands have to be run on first setup or on upgrades ...@@ -44,37 +44,26 @@ Additional commands have to be run on first setup or on upgrades
docker exec -it rdmo_django_1 python3 manage.py createsuperuser docker exec -it rdmo_django_1 python3 manage.py createsuperuser
# Development
## Translation
# Usage (without docker - old) Collect strings from modified templates:
Clone the repo next to the rdmo-app dir and add symbolic links
git clone git@gitlab.gwdg.de:era/plan.git rdmo-era-mod
cd rdmo-app
ln -s ../rdmo-era-mod/locale/ .
ln -s ../rdmo-era-mod/theme/ .
# Translation docker exec plan_django_1 python3 manage.py makemessages -l de -l en
To collect strings from modified templates:
./manage.py makemessages -l de -l en --symlinks --ignore "env/*"
to compile changes messages to compile changes messages
./manage.py compilemessages -l de -l en docker exec plan_django_1 python3 manage.py compilemessages -l de -l en
# Test ### old translation test stuff, TODO: test and dockerize
pip install Babel pip install Babel
pip install django-babel pip install django-babel
pybabel extract theme/templates/ env/lib/python3.6/site-packages/rdmo/projects/ -o locale/en/LC_MESSAGES/django.po -F ../rdmo-era-mod/babel.cfg pybabel extract theme/templates/ env/lib/python3.6/site-packages/rdmo/projects/ -o locale/en/LC_MESSAGES/django.po -F ../rdmo-era-mod/babel.cfg
# with pybabel #### with pybabel
sudo apt install python3-django-babel sudo apt install python3-django-babel
......
...@@ -5,6 +5,7 @@ RUN apt update -y && apt upgrade -y && apt install -y \ ...@@ -5,6 +5,7 @@ RUN apt update -y && apt upgrade -y && apt install -y \
python3 \ python3 \
python3-dev \ python3-dev \
python3-pip \ python3-pip \
gettext \
git git
......
...@@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ...@@ -29,7 +29,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get -y autoremove \ && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
#COPY ./theme /app/theme COPY ./theme /app/theme
COPY ./locale /app/locale COPY ./locale /app/locale
COPY ./config/production.py /app/config/settings/local.py COPY ./config/production.py /app/config/settings/local.py
......
...@@ -261,3 +261,7 @@ VENDOR_CDN = False ...@@ -261,3 +261,7 @@ VENDOR_CDN = False
THEME_DIR = os.path.join(BASE_DIR, 'theme') THEME_DIR = os.path.join(BASE_DIR, 'theme')
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)
...@@ -147,7 +147,7 @@ Theme, see also: ...@@ -147,7 +147,7 @@ Theme, see also:
http://rdmo.readthedocs.io/en/latest/configuration/themes.html http://rdmo.readthedocs.io/en/latest/configuration/themes.html
''' '''
# THEME_DIR = os.path.join(BASE_DIR, 'theme') THEME_DIR = os.path.join(BASE_DIR, 'theme')
''' '''
Export Formats Export Formats
...@@ -338,5 +338,7 @@ LOGGING = { ...@@ -338,5 +338,7 @@ LOGGING = {
VENDOR_CDN = False VENDOR_CDN = False
#THEME_DIR = os.path.join(BASE_DIR, 'theme') LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)
...@@ -15,6 +15,7 @@ services: ...@@ -15,6 +15,7 @@ services:
- postgres - postgres
volumes: volumes:
- ./theme:/app/theme - ./theme:/app/theme
- ./locale:/app/locale
env_file: env_file:
- ./.envs/.django - ./.envs/.django
- ./.envs/.postgres - ./.envs/.postgres
......
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-23 11:49+0100\n" "POT-Creation-Date: 2020-03-11 22:27+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -37,65 +37,81 @@ msgstr "" ...@@ -37,65 +37,81 @@ msgstr ""
msgid "Contact" msgid "Contact"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:29 #: theme/templates/core/base_navigation.html:30
msgid "Management" msgid "Management"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:34 #: theme/templates/core/base_navigation.html:35
#: theme/templates/core/base_navigation.html:55
msgid "Questions"
msgstr ""
#: theme/templates/core/base_navigation.html:40
msgid "Domain" msgid "Domain"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:39 #: theme/templates/core/base_navigation.html:45
#: theme/templates/projects/project_detail.html:8 #: theme/templates/projects/project_detail.html:8
#: theme/templates/projects/projects.html:15 #: theme/templates/projects/projects.html:15
msgid "Options" msgid "Options"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:44 #: theme/templates/core/base_navigation.html:50
msgid "Conditions" msgid "Conditions"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:49 #: theme/templates/core/base_navigation.html:60
msgid "Questions"
msgstr ""
#: theme/templates/core/base_navigation.html:54
msgid "Tasks" msgid "Tasks"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:59 #: theme/templates/core/base_navigation.html:65
msgid "Views" msgid "Views"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:67 #: theme/templates/core/base_navigation.html:73
msgid "Admin" msgid "Admin"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:80 #: theme/templates/core/base_navigation.html:86
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:94 #: theme/templates/core/base_navigation.html:102
msgid "About RDMO"
msgstr ""
#: theme/templates/core/base_navigation.html:111
msgid "Update profile" msgid "Update profile"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:116 #: theme/templates/core/base_navigation.html:133
msgid "Logout" msgid "Logout"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:127 #: theme/templates/core/base_navigation.html:144
#: theme/templates/core/home.html:60
msgid "Login" msgid "Login"
msgstr "" msgstr ""
#: theme/templates/core/home.html:42
msgid ""
"A tool to support the planning, implementation, and organisation of research "
"data management. Powered by RDMO."
msgstr ""
"Ein Werkzeug zur Planung, Implementierung und Organisation von "
"Forschungsdatenmanagement. Unterstützt durch RDMO."
#: theme/templates/projects/project_detail.html:12 #: theme/templates/projects/project_detail.html:12
msgid "Answer questions" msgid "Answer questions"
msgstr "Fragebogen ausfüllen" msgstr "Fragebogen ausfüllen"
#: theme/templates/projects/project_detail.html:18 #: theme/templates/projects/project_detail.html:18
#: theme/templates/projects/project_detail_snapshots.html:32
msgid "View answers" msgid "View answers"
msgstr "Fragebogen ansehen" msgstr "Fragebogen ansehen"
#: theme/templates/projects/project_detail.html:26 #: theme/templates/projects/project_detail.html:26
#: theme/templates/projects/project_detail_snapshots.html:58
msgid "Create snapshot" msgid "Create snapshot"
msgstr "" msgstr ""
...@@ -108,6 +124,7 @@ msgid "Delete project" ...@@ -108,6 +124,7 @@ msgid "Delete project"
msgstr "" msgstr ""
#: theme/templates/projects/project_detail.html:52 #: theme/templates/projects/project_detail.html:52
#: theme/templates/projects/project_detail_memberships.html:46
msgid "Add member" msgid "Add member"
msgstr "" msgstr ""
...@@ -119,51 +136,82 @@ msgstr "" ...@@ -119,51 +136,82 @@ msgstr ""
msgid "Back to projects overview" msgid "Back to projects overview"
msgstr "" msgstr ""
#: theme/templates/projects/project_detail.html:78 #: theme/templates/projects/project_detail.html:80
#: theme/templates/projects/projects.html:63 #: theme/templates/projects/projects.html:63
msgid "Fill in Questionaire" msgid "Fill in Questionaire"
msgstr "Fragebogen ausfüllen" msgstr "Fragebogen ausfüllen"
#: theme/templates/projects/project_detail.html:80 #: theme/templates/projects/project_detail.html:83
#: theme/templates/projects/project_detail_snapshots.html:14
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: theme/templates/projects/project_detail.html:88 #: theme/templates/projects/project_detail.html:91
msgid "No description available." msgid "No description available."
msgstr "" msgstr ""
#: theme/templates/projects/project_form.html:9 #: theme/templates/projects/project_detail_memberships.html:8
#: theme/templates/projects/project_form.html:11 msgid "Members"
msgid "Update project"
msgstr "" msgstr ""
#: theme/templates/projects/project_form.html:15 #: theme/templates/projects/project_detail_memberships.html:12
#: theme/templates/projects/project_form.html:17 msgid "User"
#: theme/templates/projects/projects.html:19 msgstr ""
#: theme/templates/projects/projects.html:75
msgid "Add new project"
msgstr "Neues Projekt hinzufügen"
#: theme/templates/projects/project_questions.html:41 #: theme/templates/projects/project_detail_memberships.html:13
msgid "Questionnaire for project <em>{$ service.project.title $}</em>" msgid "E-Mail"
msgstr "Fragebogen für Projekt <em>{$ service.project.title $}</em>" msgstr ""
#: theme/templates/projects/project_questions.html:70 #: theme/templates/projects/project_detail_memberships.html:14
msgid "Save" #: theme/templates/projects/projects.html:41
msgid "Role"
msgstr ""
#: theme/templates/projects/project_detail_memberships.html:31
msgid "Update membership"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions.html:73 #: theme/templates/projects/project_detail_memberships.html:36
msgid "Save and proceed" msgid "Delete membership"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions.html:79 #: theme/templates/projects/project_detail_snapshots.html:7
msgid "Back" msgid "Snapshots"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions.html:82 #: theme/templates/projects/project_detail_snapshots.html:13
msgid "Skip" msgid "Snapshot"
msgstr "" msgstr ""
#: theme/templates/projects/project_detail_snapshots.html:15
#: theme/templates/projects/projects.html:42
msgid "Created"
msgstr ""
#: theme/templates/projects/project_detail_snapshots.html:36
msgid "Update snapshot"
msgstr ""
#: theme/templates/projects/project_detail_snapshots.html:41
msgid "Rollback to snapshot"
msgstr ""
#: theme/templates/projects/project_detail_snapshots.html:52
msgid "No snapshots found."
msgstr ""
#: theme/templates/projects/project_form.html:9
#: theme/templates/projects/project_form.html:11
msgid "Update project"
msgstr ""
#: theme/templates/projects/project_form.html:15
#: theme/templates/projects/project_form.html:17
#: theme/templates/projects/projects.html:19
#: theme/templates/projects/projects.html:75
msgid "Add new project"
msgstr "Neues Projekt hinzufügen"
#: theme/templates/projects/project_questions_sidebar.html:4 #: theme/templates/projects/project_questions_sidebar.html:4
msgid "Progress" msgid "Progress"
msgstr "" msgstr ""
...@@ -172,23 +220,23 @@ msgstr "" ...@@ -172,23 +220,23 @@ msgstr ""
msgid "Overview" msgid "Overview"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions_sidebar.html:41 #: theme/templates/projects/project_questions_sidebar.html:34
msgid "Navigation" msgid "Navigation"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions_sidebar.html:44 #: theme/templates/projects/project_questions_sidebar.html:37
msgid "Please note that using the navigation will discard any usaved input." msgid "Please note that using the navigation will discard any usaved input."
msgstr "" msgstr ""
#: theme/templates/projects/project_questions_sidebar.html:50 #: theme/templates/projects/project_questions_sidebar.html:43
msgid "skip to previous page" msgid "skip to previous page"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions_sidebar.html:55 #: theme/templates/projects/project_questions_sidebar.html:48
msgid "skip to next page" msgid "skip to next page"
msgstr "" msgstr ""
#: theme/templates/projects/project_questions_sidebar.html:62 #: theme/templates/projects/project_questions_sidebar.html:55
msgid "Back to project overview" msgid "Back to project overview"
msgstr "" msgstr ""
...@@ -212,14 +260,6 @@ msgstr "" ...@@ -212,14 +260,6 @@ msgstr ""
msgid "Name" msgid "Name"
msgstr "" msgstr ""
#: theme/templates/projects/projects.html:41
msgid "Role"
msgstr ""
#: theme/templates/projects/projects.html:42
msgid "Created"
msgstr ""
#: theme/templates/projects/projects.html:43 #: theme/templates/projects/projects.html:43
msgid "Template" msgid "Template"
msgstr "" msgstr ""
...@@ -236,3 +276,6 @@ msgstr "Projekteinstellungen bearbeiten" ...@@ -236,3 +276,6 @@ msgstr "Projekteinstellungen bearbeiten"
#: theme/templates/projects/projects.html:66 #: theme/templates/projects/projects.html:66
msgid "Delete Project" msgid "Delete Project"
msgstr "Projekt löschen" msgstr "Projekt löschen"
#~ msgid "Questionnaire for project <em>{$ service.project.title $}</em>"
#~ msgstr "Fragebogen für Projekt <em>{$ service.project.title $}</em>"
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-11-23 11:49+0100\n" "POT-Creation-Date: 2020-03-11 22:27+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -36,65 +36,79 @@ msgstr "" ...@@ -36,65 +36,79 @@ msgstr ""
msgid "Contact" msgid "Contact"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:29 #: theme/templates/core/base_navigation.html:30
msgid "Management" msgid "Management"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:34 #: theme/templates/core/base_navigation.html:35
#: theme/templates/core/base_navigation.html:55
msgid "Questions"
msgstr ""
#: theme/templates/core/base_navigation.html:40
msgid "Domain" msgid "Domain"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:39 #: theme/templates/core/base_navigation.html:45
#: theme/templates/projects/project_detail.html:8 #: theme/templates/projects/project_detail.html:8
#: theme/templates/projects/projects.html:15 #: theme/templates/projects/projects.html:15
msgid "Options" msgid "Options"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:44 #: theme/templates/core/base_navigation.html:50
msgid "Conditions" msgid "Conditions"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:49 #: theme/templates/core/base_navigation.html:60
msgid "Questions"
msgstr ""
#: theme/templates/core/base_navigation.html:54
msgid "Tasks" msgid "Tasks"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:59 #: theme/templates/core/base_navigation.html:65
msgid "Views" msgid "Views"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:67 #: theme/templates/core/base_navigation.html:73
msgid "Admin" msgid "Admin"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:80 #: theme/templates/core/base_navigation.html:86
msgid "Language" msgid "Language"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:94 #: theme/templates/core/base_navigation.html:102
msgid "About RDMO"
msgstr ""
#: theme/templates/core/base_navigation.html:111
msgid "Update profile" msgid "Update profile"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:116 #: theme/templates/core/base_navigation.html:133
msgid "Logout" msgid "Logout"
msgstr "" msgstr ""
#: theme/templates/core/base_navigation.html:127 #: theme/templates/core/base_navigation.html:144
#: theme/templates/core/home.html:60
msgid "Login" msgid "Login"
msgstr "" msgstr ""
#: theme/templates/core/home.html:42
msgid ""
"A tool to support the planning, implementation, and organisation of research "
"data management. Powered by RDMO."
msgstr ""
#: theme/templates/projects/project_detail.html:12