Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Translation

Eduardo Robles Elvira edited this page May 7, 2013 · 4 revisions

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.

Table of Contents

Your First Time

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.

New Language

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:

 django-admin.py makemessages -l <language code>
The template will be generated at “locale/<language></language>/LC_MESSAGES/django.po”.
Once you have the file to translate into, update it with your translations.

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.

Existing Language

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.

Workflow

This is the typical workflow when updating an existing translation of Agora Ciudadana.

Download the Current PO

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:

Each PO file contains a different set of strings that need to be translated.

Update It

If you have never translated a .po file before:

  1. Install Poedit.
  2. Open the .po file with Poedit.
  3. For each English string (piece of text), provide the translation in your language. There’s not much to it.
  4. Save the changes to the file.
There are some things you should keep in mind while translating Agora Ciudadana:
  • 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).

Build It

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!
Build your translation file locally, to make sure there is no error in your translation. You will need to be working with the Agora Ciudadana source code, and have Django installed. Then, from agora_site, run:
 django-admin.py compilemessages -l &lt;language&gt;

A binary translation file will be generated at agora_site/locale/&lt;language&gt;&lt;/language&gt&lt;/lc_messages/django.mo.&gt;</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.

Send It Back

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.

Feedback

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.

Appendix

Download the Source Code

You can download the source code of Agora Ciudadana:

 git clone git://github.com/agoraciudadana/agora-ciudadana.git

Install Django

Check out the official documentation.