Home » Tutorials » How to Translate With GetText PO and POT Files

How to Translate With GetText PO and POT Files

GetText Portable Object (PO) files are the industry standard for multilingual websites in PHP.

In this tutorial we’ll talk about how to translate PO, or POT files and maintain translations up-to-date.

First, let’s explain what the files are.

  • POT – Portable Object Template. This is the file that you get when you extract texts from the application. Normally, you send this file to your translators.
  • PO – Portable Object. This is the file that you receive back from the translators. It’s a text file that includes the original texts and the translations.
  • MO – Machine Object. The MO file includes the exact same contents as PO file. The two files differ in their format. While a PO file is a text file and is easy for humans to read, MO files are compiled and are easy for computers to read. Your web server will use the MO file to display the translations.

Need Translation for Your PO/POT File?

ICanLocalize provides professional translation for GetText files.

Upload your PO or POT file and get a final quote, right now.

PO or POT file:

From language:

Differences Between POT and PO Files

PO and POT files are essentially the same. The difference is in the intended use. This is why the two files have different extensions (.pot versus .po).

The tool that scans your PHP source will produce a .pot file. This file includes only the original texts, which need translation. You send this file to your translators.

The translator’s tool will be able to merge the texts from the .pot file with the existing translations (the .po file). It will mark new or modified texts as needing translation and will leave existing translation intact.

Free Translation Tools for POT and PO Files

Since PO / POT files are so popular, there are several excellent tools for translating them.

The best known tool is a program called poedit. poedit is a tool for translators. It allows merging between new texts in a POT file (compared to the current translation in the PO file) and produces both PO and MO as output.

There are some great open-source web-based tools for translating GetText files.

Professional Translation for POT / PO Files

If you’re also looking for translators for your POT files, try ICanLocalize Software Localization projects.

You can upload your PO or POT file to the project. A parser will go through your file and extract the texts for translation. It counts the words and calculates the cost for translation.

Then, you can choose translators for your project and get started. When translation is complete, you will receive back the completed PO and MO files. There’s no software to download. Translation can begin immediately and complete quickly as well.

Our Software Localization projects are tuned to your needs exactly. There’s one major goal – to provide the best translation possible.

To accomplish this, we’ve built powerful QA features inside the Software Localization system:

Built-in Translation Review Process
By default, all projects are done by two translators. One translator translates and the other proofreads.
Issue Tracking System
We translate just like you develop. When we find an issue, we track it. Before we deliver the completed translation, our system makes sure that all issues are closed and handled. No matter if you have a tiny or huge project, we’ll make sure that translation is 100% correct.
Format Checker
Many strings contain placeholders and HTML tags. Our system makes sure that translations contain the correct placeholders and tags as well.
All Professional Translators
All the translators in our system are certified professionals. Translators only write in their native language and must hold a university degree in translation in order to join ICanLocalize.
Because we’ve automated the entire translation process, our translators can concentrate on translation. This allows a cost saving of 50% compared to contracting the same translators in translation portals. We pass this saving to you.

13 responses to “How to Translate With GetText PO and POT Files”

  1. Benson

    Is there any tool to support de-trnaslate file?

    1. Ikem

      To convert a gettext .mo file into a .po file I use this:

      msgunfmt [path_to_file.mo] > [path_to_file.po]

  2. Hrach

    Thanks for detail explanation

  3. Avinit

    Can we use SDL Passolo 2011 and SDL Trados 2011 to translate file with the extension .pot?

    1. Juraj

      Yes, with the Passolo 2011 SP6 it is possible 🙂

  4. Iwan

    do we need to create a po file for each language used on the website?

    1. Andy

      Only one .pot file is needed to produce 1 or many .po files. The .po files are the translations and one .po file needs to be created for every language translation. And the .mo files are complimentary to the .po files for optimization purposes where they don’t need to be edited by a human.

  5. Don Froien

    Can the same .mo files be used in an embedded product? I am assuming the only constraint is going to be the number of .mo files required to exist in the NAND Flash. If my assumption is correct, can you indicate how large a .mo file will be when compared to a text file? More specifically, is there a size ratio of text to .mo file?

  6. shaurabh singh

    Is there any tool that also translate numeric values?

    1. Laura

      Texts that have numbers should have placeholders. You should explain to translators how to translate these placeholders and you will get it done like any other text in the project. If you’d like to get more info, please write to hello@onthegosystems.com.