Skip to content

Wagtail site for testing model translation on policylab

Notifications You must be signed in to change notification settings

thepolicylab/translation-flow

Repository files navigation

Automatic Translation Workflow for Wagtail Site

This is a demo site that demonstratse how a 3rd party Translation API can be integrated into a Wagtail Site.

  • trans_home_page in models.py is a fully translatable page, where changes made to the English text are detected and sent to a 3rd party translation API (Gengo). When translations are returned, it is updated in the database and displayed in the user's language.
  • lang_bar.html demonstrates how you can make a language dropdown on your site to allow your users to choose which language they would like to use.
  • Languages you wish to support can be added to settings/languages.csv

Install:

git clone <\insert_clone_url\>
cd translation-flow
python3 -m venv plab/env
source plab/env/bin/activate
pip install wagtail     
pip install -r requirements.txt
pip install wagtail-modeltranslation

How to run:

cd translation-flow
source plab/env/bin/activate
python manage.py runserver

Then, navigate to http://127.0.0.1:8000/admin to see CMS!

Login info

username: admin password: policylab

Push database changes

python manage.py makemigrations
python manage.py migrate

Database

Found at translation-flow/db.sqlite3
The table home_transhomepage stores text for /home page.

Troubleshooting

Try replacing python with python3!

About

Wagtail site for testing model translation on policylab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •