How to add Django Localization Support
How to add Transifex support to your code
- The best place to start is to create your application from a standard cookiecutter:
- IDA -Â https://github.com/edx/cookiecutter-django-ida
- Django App -Â https://github.com/edx/cookiecutter-django-app
- XBlock - https://github.com/edx/cookiecutter-xblock (see also XBlock Translations: Workflow)
- To add Transifex to an existing project
- Generate a stub project from the cookiecutter
- Merge it into your own project
- You should now have a Makefile that utilizes the Transifex client
- Ensure that all of your localizable strings use one of theÂ
gettext
functions Extract translations from your code:Â
make extract_translations
Add your English language .po files to Transifex
- See How to add a new translation to Transifex below
- Automate the management of your translation files
How to add a new translation resource
Step 1: Upload file to Transifex
- https://www.transifex.com/open-edx/edx-platform/content/
- Click "Add resources"
- Specify the .po files you wish to upload
Step 2. Categorize
Make sure to categorize your resource in Transifex. Category must reflect whether translation strings will be 1) student or instructor facing, and 2) functional area in which they will be used.
Examples
Correct:Â Student LMS, Instructor Studio
Incorrect:Â Student, Studio, Analytics.
Step 3. Update Wiki page
Update list of resources with resource name and owner (could be a person or a team)