From fc28212ce047dec88a82dfe04b8ce2a139d26752 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Wed, 8 Jul 2020 14:38:55 +0200 Subject: [PATCH] added translations support --- bootstrap/data_static/User.csv | 3 +- bootstrap/translations/babel.cfg | 5 ++++ bootstrap/webapp/templates/layout.html | 2 +- bootstrap/webapp/templates/navigation.html | 6 ++-- bootstrap/webapp/view_models/Example.yaml_ | 24 +++++++++++++++ oshipka.sh | 7 +++-- oshipka/persistance/__init__.py | 35 +++++++++++++++++++++- vm_gen/templates/_model_py | 2 +- vm_gen/templates/html/_create.html | 9 ++++-- vm_gen/templates/html/_get.html | 8 ++--- vm_gen/templates/html/_table.html | 4 +-- vm_gen/templates/html/_title.html | 2 +- vm_gen/templates/html/_update.html | 5 +++- vm_gen/templates/html/create.html | 2 +- vm_gen/templates/html/get.html | 6 ++-- vm_gen/templates/html/list.html | 4 +-- vm_gen/templates/html/search.html | 4 +-- vm_gen/templates/html/table.html | 4 +-- vm_gen/templates/html/update.html | 2 +- vm_gen/templates/model_py | 2 +- 20 files changed, 104 insertions(+), 32 deletions(-) create mode 100644 bootstrap/translations/babel.cfg create mode 100644 bootstrap/webapp/view_models/Example.yaml_ diff --git a/bootstrap/data_static/User.csv b/bootstrap/data_static/User.csv index a1d1331..4206147 100644 --- a/bootstrap/data_static/User.csv +++ b/bootstrap/data_static/User.csv @@ -1 +1,2 @@ -email,password,role_names \ No newline at end of file +email,password,role_names +admin@blog.pi2.dev,__SENSITIVE__.ADMIN_PASSWORD,admin \ No newline at end of file diff --git a/bootstrap/translations/babel.cfg b/bootstrap/translations/babel.cfg new file mode 100644 index 0000000..d3f93b0 --- /dev/null +++ b/bootstrap/translations/babel.cfg @@ -0,0 +1,5 @@ +[ignore: venv/**] +[ignore: migrations/**] +[python: **.py] +[jinja2: **/templates/**.html] +extensions=jinja2.ext.autoescape,jinja2.ext.with_ \ No newline at end of file diff --git a/bootstrap/webapp/templates/layout.html b/bootstrap/webapp/templates/layout.html index b183f2c..3a0da28 100644 --- a/bootstrap/webapp/templates/layout.html +++ b/bootstrap/webapp/templates/layout.html @@ -4,7 +4,7 @@ - Project + {{ _("Project") }}