Indico comes with a number of languages by default. In release 2.3, those are: English (default), French, Portuguese, Spanish and Chinese (in the order of integration). Additional languages are being prepared on the Transifex platform.
In order to use (partially) existing translations from Transifex or to contribute translations, you need to register with the Indico project on the Transifex platform.
This is a guide to set up an Indico instance with a new language. It is useful for translators to verify how the translation looks in production or for administrators who just want to lurk at the incubated translation embryos.
Create your own Indico instance¶
This should usually be done on your own computer or a virtual machine.
For creating your own Indico instance, we provide two different guides: The first one is for a production system, it will prepare Indico to be served to users and used in all the different purposes you may have besides translations. The second is development a light-weight, easier to set up, version oriented to testing purposes, that should not be exposed to the public.
For the purpose of translation development or testing, which this guide is about, we recommend using the development version.
Get an API token¶
Go to your transifex settings and generate an API token.
Afterwards, you should run the command
tx init --skipsetup.
It will request the token you just copied from the previous settings and save it locally so you can start
using transifex locally.
If you do not know how to run this command, please refer to the
transifex client guide.
Install the translations¶
~/dev/indico/src (assuming you used the standard locations from the dev setup guide).
tx pull -f -l <language_code>.
Languages codes can be obtained here.
For example, Chinese (China) is
Compile translations and run Indico¶
Run the commands
indico i18n compile-catalog
indico i18n compile-catalog-react
and launch Indico.
The language should now show up as an option in the top right corner.
In case you modified the
.js resources, you also need to delete the cached
Why isn’t Indico loading my language?¶
Some languages in transifex use codes that Indico is not able to recognize.
One example is the Chinese’s
The easy fix for this is to rename the folder
indico/translations/) to the extended locale code
Unfortunately, there is no list with mappings for all the languages.
So if by any reason it doesn’t work for you, feel free to ask us.
As a translator, you should have a good knowledge of the Indico functions (from the user side at least). Then you can subscribe to the abovementioned Transifex site for Indico and request membership of one of the translation teams. You should also contact the coordinators; some languages have specific coordinators assigned. They may point you to places, where work is needed and which rules have been agreed for the translations.
The glossary is usually of big help to obtain a uniform translation of all technical terms. Use it!
As a programmer or developer, you will have to be aware of the needs and difficulties of translation work. A Wiki page for Internationalisation is available from github (slightly outdated and we should eventually move it to this documentation). It describes the interface between translating and programming and some conventions to be followed. Everyone involved in translating or programming Indico should have read it before starting the work.
Whenever translaters spot difficult code (forgotten pluralization, typos), they should do their best to avoid double (or rather: multiple) work to their fellow translators. What is a problem for their translation, usually will be a problem for all translations. Don’t hesitate to open an issue or pull request on GitHub. Repair first, then translate (and be aware that after repair, the translation has to be made again for all languages).
The codebase also contains legacy code, which may not follow all rules.
The relationship between
- transifex resources names (core.js, core.py, core.react.js)
- PO file names (messages-js.po, messages.po, messages-react.po) and
- the actual place, where the strings are found
is not always obvious. Starting with the resource names, the files ending in
.pyrefer to translations used with python and jinja templates,
These contain a relationship to PO files, as defined in the following example extracted
[indico.<transifex resource slug>] file_filter = indico/translations/<lang>/LC_MESSAGES/<PO file name>.po source_file = indico/translations/<source file name>.pot source_lang = en type = PO
The transifex resource slug is a name-like alias that identifies a particular file.
For more information regarding this subject a thread has started here.