Translating: how to contribute your translations


Back to the home page

This how-to aims to make it easier for you to help translating open source software, into your own primary language.

Many open source software projects host their translation jobs (or localization jobs, as they're often referred to) on easy translation collaboration sites that make helping to translate a cinch. Examples of those are Launchpad and Transifex. As far as their use isn't self-explanatory, there's excellent help information available at their websites.

I won't concern myself with those, but with the projects that offer no translating infrastructure at all. For example projects that host their translations, together with their other code, on GitHub.

It's probably easiest to describe a real-life example, like the translations for the Moksha desktop of Bodhi Linux. Let's say you're a native French speaker and want to help improve or complete the current French translations of Moksha.

1. Create a free GitHub account
The first thing to do, is to create a free GitHub account.

Background information: a GitHub account will allow you to host your own code, like your improved translations, on GitHub. From within your account, you can "fork" the existing translation into your own branch (or in case there is no existing French translation at all, create a new one). Then you can start translating away happily. Not on GitHub itself, but offline in a way that I'll explain later.

When you're done, you can request the developers of the software that you're translating for (in the example: Moksha), to pull it in and include it in their project. In technical terms: you can create a "pull request". More about that later.

2. Go to the GitHub master branch of the project
Back to the example of Moksha: go to the GitHub master branch of Moksha and click on its po directory. The directory po contains the current translations in the form of .po files. And usually also a vanilla .POT file with no translation at all, but just the text strings that need to be translated.

Click on fr.po in order to enter the existing French translation. Then click on the button called Raw in order to see the current translation as pure unformatted text.

3. Create an offline text file to do the job in
In that Raw view of fr.po on GitHub, select all existing text. For example by means of the key combination Ctrl a or by using your mouse. Copy it by putting the mouse pointer on the selected text block - rightclick with your mouse - Copy.

Then launch a simple text editor like Xed, Gedit or Leafpad. Not a full-blown word processor like LibreOffice Writer, because that would cause formatting hell!

In that simple text editor, paste the text you've just copied from GitHub, into an empty document.

Save that document as fr.po on your hard disk.

In Xed and Gedit you'll notice a sudden change in the view: by giving it the .po extension, Gedit and Xed will recognize and treat it like a proper translation file, with nice colours for the various sorts of lines. Leafpad won't: it's too simple an editor for that....

Close the text editor.

4. Install Poedit and feed your .po file to it
In theory, you could start editing the .po file from within the text editor. But that's only advisable for experienced translators who know exactly what syntax they need to use....

Luckily there's a neat translation application available, called Poedit. Poedit makes it easy for you. Install it like this:

a. Launch a terminal window.
(You can launch a terminal window like this: *Click*)

b. Copy/paste the following command line into the terminal:

sudo apt-get install poedit

Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when you type. Press Enter again.

c. Launch Poedit and open your .po file in it (simply double-clicking it should launch Poedit as well).

5. Using Poedit
Start translating away merrily. After you've finished: click the button Validate in the panel of Poedit. This will make Poedit perform a quality check on the .po file and report potential errors to you.

Faulty lines are always presented at the top, so you might need to move the window slider all the way up in order to see the erroneous lines.

Note: make a habit of always moving up that slider, even when Validate doesn't report errors! There still might be some minor errors to correct, that are too unimportant for the Validate feature.

When you're done: save your changes bij means of the Save button ("save catalog").

The act of saving will have an unexpected side effect: it'll also create a .mo file which can be applied directly in your system as new translation (if you know where to put it, which isn't as easy to find out as you might think). But that's not relevant now: your only concern is the .po file which contains your new translations.

Close Poedit.

6. Transfer to GitHub from within the text editor
Now open your fr.po file with the new French translations in the text editor (Xed, Gedit, Leafpad), not in Poedit. Select all text, either with your mouse or by means of the key combination Ctrl a

Log in at GitHub, go to the current French translation of Moksha, click on the Edit button (the pencil), select all existing text and delete everything. Then paste your own text into it.

Down below, click on the button called Propose file change (with which you create your own fork). Next, click on Create pull request.

7. Wait and be patient
Done! All you have to do now, is to wait until the developers of Moksha will examine your contribution and (hopefully) add it to their project.

It might take a long time before your new translations are being rolled out, because the package developers will need to do a new release of the package. And in the case of a fixed release like Ubuntu and Linux Mint, you might even have to wait for an entire new version of Ubuntu or Mint.

So be patient: translating is a long-term activity....


To the content of this website applies a Creative Commons license.

Back to the home page

Disclaimer