Translation workflow?


Hello all,

It seems natural to check translations not only by reviewing them on Transifex but also by deploying them on an Indico instance. However, I am worried about how to manage the translations in sync between my instance and Transifex.

I know Transifex has importing feature from .po file, but .po in the code base is one file per programming language while each .po file is split into several files on Transifex so I am not sure whether importing from local .po file is possible without pitfalls.
My current plan is downloading .po files using Transifex API with cURL and merging locally, executed periodically by cron or so on. Thus, editing translation will be always done on Transifex and my instance will just serve the latest data.

However, I feel that it may not be the optimal workflow. How do you manage translation?

Japanese (ja) translation group

Yes, this would definitely be helpful to have a procedure (tool?) to test translations on a dev instance!


Another possible approach is that imports all the languages with any translated entries periodically.

Pros: Everyone can test them without having an staging instance.
Cons: Some UIs, administration interface for instance, can not be tested.

Indeed we need to prepare development instances for some components anyway, but it would be great if a typical user could easily try work-in-progress translated UIs and report problems to translation groups.


Now, my instance downloads translation data from Transifex weekly. I’d share my recipe here. I hope it will help you. Please do not hesitate to ask if anything is not clear.

My instance runs on Ubuntu 16.04 LTS on Oracle VirtualBox VM, for reference.


First of all, please define your favorite language as an environment variable. In this instructions, I choose Japanese (ja_JP) for instance.


Timer settings

cat > /etc/systemd/system/update-indico-translation.service <<'EOF'
Description=Indico translation update script

ExecStart=/opt/indico/etc/update-indico-translation 2.7 ${INDICO_TARGET_LANGUAGE}

cat > /etc/systemd/system/update-indico-translation.timer <<'EOF'
Description=Update Indico translation data weekly



Then, let’s enable the timer.

systemctl start update-indico-translation.timer
systemcrl enable update-indico-translation.timer

Please check if your timer is activated.

systemctl list-timers

Then, please continue with indico user previlege.

su - indico

Obtain your Transifex API token

Please log in to Transifex, open user settings, and get your API token.

Then, please save the token as /opt/indico/.tx-api-token.

# You definitely want to change the access permissions of it, don't you?
chmod 600 /opt/indico/.tx-api-token

The script

Do not use cat here, since variables are expanded on the fly if you do so. Please use your favorite editor.


api_token="$(cat /opt/indico/.tx-api-token)"

work_dir="${TMPDIR}/$(mktemp -d)"
cd "${work_dir}"

echo "Updating Indico (Python ${python_version}) translation resources for ${lang}..."

fetch_language_resource() {

  if [ -d "${package_dir}" ]; then
    echo "The ${package} package is found. Downloading translation resources for ${lang}..."

    mkdir -p "${locale_dir}"

    echo "Downloading messages.po..."
    py_status_code=$(curl -s -L --user "api:${api_token}" -X GET "${py_resource_url}" -o "messages.po" -w "%{http_code}")

    if [ $? = 0 ] && [ "${py_status_code}" = "200" ]; then
      msgfmt messages.po
      mv messages.po "${locale_dir}"
      echo "Failed to download ${lang} messages.po for ${package}."
      if [ -f messages.po ]; then
        rm -f messages.po

    echo "Downloading messages-js.po..."
    js_status_code=$(curl -s -L --user "api:${api_token}" -X GET "${js_resource_url}" -o "messages-js.po" -w "%{http_code}")

    if [ $? = 0 ] && [ "${js_status_code}" = "200" ]; then
      mv messages-js.po "${locale_dir}"
      echo "Failed to download ${lang} messages-js.po for ${package}."
      if [ -f messages-js.po ]; then
        rm -f messages-js.po

fetch_language_resource indico core

fetch_language_resource indico_chat chat
fetch_language_resource indico_importer importer
fetch_language_resource indico_importer_invenio importer-invenio
fetch_language_resource indico_livesync livesync
fetch_language_resource indico_livesync_invenio livesync-invenio
fetch_language_resource indico_payment_manual payment-manual
fetch_language_resource indico_payment_paypal payment-paypal
fetch_language_resource indico_piwik piwik
fetch_language_resource indico_search search
fetch_language_resource indico_vc_vidyo vc-vidyo

echo "Reloading Indico..."
touch /opt/indico/web/indico.wsgi

rm -rf "${work_dir}"

echo "Finished updating Indico translation resources."

I assume that you saved it at /opt/indico/etc/update-indico-translation in the description below. Please do not forget to add an executable bit to the script.

chmod +x /opt/indico/etc/update-indico-translation


Let’s update translations on Transifex and reload the page next week!

Where to get and how to install German localization for the Indico?
Japanese (ja) translation group

I found that user service and timer are not needed here since we can specify user and group with system service and timer. I will change my setup then update instructions here. I have updated the instructions above.


Hi there @maogino,
Sorry that I’m late to this conversation, but I was on holidays at the time of the discussion.
It would be great to have the sandbox (or even better, a separate server) doing some sort of CI of the translations in different languages.
Coincidentally, we have been working quite hard in creating docker images for Indico that can be easily run on any container-based platform. So, my idea is: why not create a Docker-based setup that uses our image and runs your script (on a cronjob or using webhooks…)? We could then even deploy it here at CERN if needed.

Your Dockerfile would just need to do FROM getindico/indico:latest, etc…

Thanks for the great work you’ve been doing!


Sounds fantastic! I will take a look into the repo.


Cool! I’m also CCing @kolodzie, who is our I18N manager.


Hey, just tried to set this up; however, the download fails with 401 Unauthorized someone has to accept me into the indico transifex project for de_DE … @maogino can you do that please?


Hey, sorry for the delay but I never receive notifications from Transifex about new join requests. Your request has been accepted.