-
Notifications
You must be signed in to change notification settings - Fork 7
Translation and internationalization
Follow the installation instructions from the README:
mkvirtualenv candideit
git clone https://github.com/ciudadanointeligente/candidator.git
cd candidator
pip install -r requirements.txt
python manage.py test elections
python manage.py syncdb
If you run python manage.py runserver
and open http://127.0.0.1:8000/
you should see the Spanish version in your browser.
Create a local_settings.py
file, and edit settings as appropriate:
cp local_settings.py.example local_settings.py
The following commands assume your locale code is en
. Replace it as appropriate with the ISO 639-1 code for your locale. The locale code you choose below must match the LANGUAGE_CODE
in local_settings.py
.
First, create or update the django.po
file for your locale:
django-admin.py makemessages -l en
You will find the file in locale/en/LC_MESSAGES
. You can now edit the .po
file by hand or with a variety of editors.
You may prefer to use Transifex to translate the .po
file:
- Go to Candideit's Transifex page
- Click "Add new translation"
- Select your language and click "Translate online"
Once your translations are done, notify a Candideit maintainer, and they can pull your translations into the project.
- Keep the same case: translate "NOMBRE DE LA ELECCIÓN:" as "ELECTION NAME:" not "Election name:"
- Keep all punctuation: translate "NOMBRE DE LA ELECCIÓN:" as "ELECTION NAME:" not "ELECTION NAME"
To use your translation, you need to compile the .po
file to a .mo
file:
python manage.py compilemessages
And that's it!