Uploading source content to Transifex
After the strings have been marked either inside templates or in Python code (for example in Views), you can push them to Transifex.
In order to be able to do so, first make sure your Transifex project secret is in your Django settings file, as described in the setup section, and then simply run:
./manage.py transifex push
This command works in two phases:
- First, it goes through all the files of the current directory (and subdirectories) and collects all translatable strings in memory
- Then, it contacts Transifex and pushes the strings with all the metadata to the project (and resource) that is associated with the token you have given during setup
This way, the source strings reach Transifex and become available for translation.
Explore more advanced options using the command line help:
./manage.py transifex push --help usage: manage.py transifex push [-h] [--extension EXTENSIONS] [--purge] [--symlinks] optional arguments: -h, --help show this help message and exit --extension EXTENSIONS, -e EXTENSIONS The file extension(s) to examine (default: "html,txt,py", or "js" if the domain is "djangojs"). Separate multiple extensions with commas, or use -e multiple times. --purge, -p Replace the entire resource content with the pushed content of this request. If not provided (the default), then append the source content of this request to the existing resource content. --symlinks, -s Follows symlinks to directories when examining source code and templates for translation strings.