-
Notifications
You must be signed in to change notification settings - Fork 48
Translation
This page explains how to translate Agora Ciudadana into a language other than American English.
It is meant for anyone, the only requirements being a knowledge of American English (the source language) and, of course, of the language you are translating Agora Ciudadana into. Even if you can’t understand American English, you should be able to translate the application using other translation and some online tools (dictionaries, automatic translators, etc.) as guidelines.
You’ve decided to contribute to Agora Ciudadana with translations, that’s great!
The first thing you should do is to find out whether or not Agora Ciudadana is already being translated into your language.
To do that, check the name of the folders in this directory of the source code. If the code of your language is not listed there, continue from New Language; else, continue from Existing Language instead.
If you do not know what the code of your language is, check the (English) Wikipedia article for your language. There you will find, in the right-side box, your language’s ISO 639-1 code. If there is no ISO 639-1, the ISO 639-2 is used instead. If you can’t find the Wikipedia article for your language, contact us and we will help you.
You want to make Agora Ciudadana available in a new language? Cool!
First you need to get a translation file to start working with. You have some options here, choose whatever you prefer:
- Download the .po files of an existing language.
- Create an empty template file for your language. You will need to download the Agora Ciudadana source code, install Django and run this command from the agora_site folder:
django-admin.py makemessages -l <language code>
- The template will be generated at “locale/<language></language>/LC_MESSAGES/django.po”.
After translating the file — you don’t need to translate it all at once, partial translations are OK —, contact us by email, present yourself, and remember to attach your translation files in the email.
Of course, if your prefer, you can just fork the repository, generate the PO file for your language, translate it, and do a Pull Request. But presenting yourself by email too would be great.
If you would like to contribute to an existing translation, you should contact us to let us know about you, and so you can get in contact with the current translator for your language — if any — and discuss what to do next, share some virtual or Real World™ beers, etc.
This is the typical workflow when updating an existing translation of Agora Ciudadana.
The PO files are the standard formatted files that we use in Agora to translate the application into different languages.
You will find them at agora_site/locale/<language code>/LC_MESSAGES/*.po. Once you are reading the files (django.po, djangojs.po, djsgettext.po), click the Raw button to download it.
For example, you can download the Spanish translation files from:
- https://github.com/agoraciudadana/agora-ciudadana/raw/master/agora_site/locale/es/LC_MESSAGES/django.po
- https://github.com/agoraciudadana/agora-ciudadana/raw/master/agora_site/locale/es/LC_MESSAGES/djangojs.po
- https://github.com/agoraciudadana/agora-ciudadana/raw/master/agora_site/locale/es/LC_MESSAGES/djsgetext.po
If you have never translated a .po file before:
- Install Poedit.
- Open the .po file with Poedit.
- For each English string (piece of text), provide the translation in your language. There’s not much to it.
- Save the changes to the file.
- Do not translate strings like %(<something>)s (e.g. %(url)s). These are keywords that get replaced by some values (e.g. by an URL).
- You can skip this step, but we would really appreciate if you took the time. It will give us a bit more time to implement cool new features for Agora Ciudadana!
django-admin.py compilemessages -l <language>
A binary translation file will be generated at agora_site/locale/<language></language></lc_messages/django.mo.></language>You don’t need to send it to us, and can delete it or ignore it.
If there is any error with your .po file, you will get notified in the output of the command. Before you continue, fix those issues. Common issues are omitting a %(<something>)s tag or changing it.
Once your translation file is ready, you can send it back. Again, there is more than one way to do it:
- Send an email with the file attached.
- If you are forking the source code in Github, send a pull request.
If you find any typo in the English strings, or anything you think that can be improved, please don’t hesitate to tell us about it so we can fix it.
If it is an obvious error and you don’t think it needs a previous discussion, it’s fine to send a pull request with the fix.
You can download the source code of Agora Ciudadana:
- As a ZIP archive.
- Cloning with Git the repository:
git clone git://github.com/agoraciudadana/agora-ciudadana.git
Check out the official documentation.