How to Translate Gettext PO and POT Files with PTC

PTC (Private Translation Cloud), a powerful software translation tool, makes it quick and easy to translate PO files and deliver multilingual software.

If you’re developing in environments like WordPress, Java programs, or using the GNU gettext system, PO files are an essential part of making your project multilingual. These files let you translate the text in your application’s user interface so users can interact with your software in their own language.

As you work with PO files, you’ll also come across related formats like POT and MO files. Before you start translating, it’s important you understand how these files work together in the localization process.

What Are POT, PO, and MO Files?

POT, PO, and MO files each handle a different aspect of your project’s translations.

.pot

POT (Portable Object Template) file

The Starting Point for Translations

Template for creating PO files

Doesn’t contain translations

Lists all the original text strings that need translation

Example:

msgid "Hello, World!"
msgstr ""
msgid "File not found"
msgstr ""
  • msgid entries contain the original strings in the source language
  • msgstr entries remain empty because the POT file serves as a template for the translations

.po

PO (Portable Object) file

Where You Store Translations

Stores the actual translations for your software’s user interface

Each entry in a PO file pairs an original string from your software with its translated version

Example:

#:path/to/source/file:23 
msgid "File not found" 
msgstr "Archivo no encontrado"
  • #: path/to/source/file:23 tells you where the original string is in your source code, making it easy to find and edit
  • msgid shows the original (source language) text
  • msgstr provides the translation

.mo

MO (Machine Object) file

Ready for Your Software to Use

A compiled, binary version of the PO file

Allows your software to access translations quickly and efficiently

Where Does an MO File Go?

WordPress: Place the MO file in the languages directory within your theme or plugin (e.g., wp-content/themes/your-theme/languages/).

GNU gettext: Place the MO file within a directory named after the locale (e.g., locale/es/LC_MESSAGES/ for Spanish).

Java: Store the MO file in a resource directory, often named resources or i18n, depending on your project’s structure.

Translating POT/PO Files

Once you prepare your POT/PO files for translation, PTC makes translating them easy:

Set it up once, then let PTC handle the rest

By connecting PTC to your software repository, you automate the entire translation process. PTC detects resource files in your repository, translates them, and makes sure that your software’s translations are always up to date.

Automatic merge requests for translations

As you continue to develop your software, PTC automatically detects changes to your PO files and translates new or updated strings. It then sends you merge requests with the translations, allowing you to review and merge them into your project.

Translate across all branches

PTC automatically detects new texts in any branch you’re working on and translates them. You can also choose which branches to translate, giving you control over the localization process in different stages of development.

Superior translation quality

PTC uses advanced AI and machine learning technologies to deliver Better Than Human Translations. Your software’s localization will be fast and meet the highest standards, providing a better experience for your users.

Start Translating PO Files with PTC

Try PTC’s 30-day free trial and experience automated translations, easy Git integration, and faster localization.

Take Control of Your Software Translations

Whether you’re working with Java programs, GNU gettext, or localizing WordPress themes and plugins, delivering software that resonates with users in their preferred language begins with translating PO files.

Understanding how POT, PO, and MO files work together helps you manage translations smoothly. POT files provide the template, PO files store the translations, and MO files bring them into your software.

Instead of handling translations manually, save time and ensure consistency with PTC. By integrating with your software repository, PTC automates the entire workflow, keeping your Better Than Human Translations up-to-date across all project branches.

Scroll to Top