How to add your own language translation on Open edX

While building a new platform on Open edX, we were looking to translate the platform for more languages.

By default, Open edX uses Transifex, an open source translation platform, to power the translation of edX software into different languages. All translations are hosted at Transifex.com, which provides a web application allowing translators to write, submit, and manage their translations.

After pulling the translations we were not happy with some of them, so I had to come up with ideas on how to patch those translations.

Solution #1

I tried to change the translation on the project but I had to be a part of the team, and it should be reviewed so it seems like a long process to me.

but, it is possible, and if you have the time use this guide to see how it works

Join the team

Solution #2

Disclaimer — this solution is quite hacky, try it with your own risk.

Later I came up with another idea, locating the .po files and changing them. I found those files at the path: edx/edx-platform/conf/locale/<lang>/LC_MESSAGE

But there are many files there, so you can harness Transifex for your help to find the right file. On the dashboard open the Open edX project and choose the right project. Inside you’ll find all the .po files, you can open them and search for the string you’re looking to translate with the search bar.

After you know which one you want to change, you can copy this file from your server to the local directory with something like: 
scp -r username@ip:/edx-platform/conf/locale/<lang>/LC_MESSAGES $(pwd)/lms/django.po

Ok, now we find the string and edit it locally, use the scp command with the other direction:

scp -r $(pwd)/lms/django.po username@ip:/edx-platform/conf/locale/<lang>/LC_MESSAGES

You might need to use chown to change ownership of the file on the server before you can use scp:
sudo chown <yourname> django.po

Final steps

Now, we just need to compile and restart the apache server. Here are the commands to do it.

cd /edx/edx-platform
sudo paver.edxapp i18n_generate
sudo /opt/ctlscript.sh restart apache


That’s it! hope this article helped you!