Translate GNU Gettext POT, POT files

What are Gettext (PO, POT) files?

Gettext (PO) files are language files used by the gettext i18n system. This system is used by almost all programming languages and many frameworks. This system supports many features, such as pluralization, developer comments (instructions), the context and categories of the string…

Fun fact: This system was first released in 1990, which makes it one of the oldest language file formats. 👴

WebTranslateIt is a software localization platform that can help localize Gettext .po or .pot files.

What is the difference between PO and POT files?

These two files are almost identical.

PO (short for Portable Object) files are the files which contain the actual translations. Each language will have its own PO file, for example, for French there would be a fr.po file, for German there would be a de.po, for American English there might be en-US.po.

POT (short for Portable Object Template) files are the template files for PO files. They will have all the translation strings left empty. A POT file is essentially PO file emptied from its translations, with just the original strings.


Before importing the document, WebTranslateIt checks if the .po file is valid before importing using the utility msgfmt. If msgfmt encounters an error, we will display that error message, which will allow you to investigate your file further by running in a terminal:

$ msgfmt file.po

Tip: Beware the BOM. If you get an error saying that there is an error on line 1, column 2, then it is very likely that your file contains a byte order mark. WebTranslateIt could handle your file, but a PO file with a BOM is not a legit PO file for msgfmt. In order to fix your file, remove the BOM and upload the file to WebTranslateIt again. On Windows, tools such as Notepad++ have an option to remove the BOM (“Encoding » Convert to UTF-8 without BOM”).

Plural strings completeness

Incompletely translated plural strings (i.e. plural strings missing one or several plural rules) are exported as untranslated, as incomplete plural strings can break your application.

Magic Comments

This file handler support the following magic comments:

  • Comments containing [MAXCHAR=xx] will set a max character limit to xx. Example: #. [MAXCHAR=20]
  • Comments containing [LABEL=xxxx] will assign the label to xxxx. Example: #. [LABEL=new feature]

Encoding Detection

Especially if you source language file is English (which contains few “foreign” characters, the file encoding is sometimes difficult to detect reliably. In order to reliably import the file in the correct encoding, make sure the file encoding is described in your file headers:

#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OLPC website files Version 1.2\n"
"POT-Creation-Date: 2006-02-14 12:00-0500\n"
"PO-Revision-Date: 2006-08-27 15:00-0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" ⬅️ Right here!
"Content-Transfer-Encoding: 8bit\n"

Having Content-Type: text/plain; charset=utf-8 will make sure your file is imported as UTF-8.

.pot file example

Here’s an example of .pot file. WebTranslateIt imports instructions starting by a #..

#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OLPC website files Version 1.2\n"
"POT-Creation-Date: 2006-02-14 12:00-0500\n"
"PO-Revision-Date: 2006-08-27 15:00-0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "align"
msgstr "_: the alignment (left or right) of your language goes here"

#: laptop.html
#. An instruction to translators
msgid "title"
msgstr "One Laptop per Child"

msgid "intro"
msgstr "Introducing the children's laptop..."    

.po file example

# Copyright (C) YEAR VideoLAN
# This file is distributed under the same license as the PACKAGE package.
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2009-03-26 21:58+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 1.3.0\n"

#: include/vlc_common.h:879
msgid ""
"This program comes with NO WARRANTY, to the extent permitted by law.\n"
"You may redistribute it under the terms of the GNU General Public License;\n"
"see the file named COPYING for details.\n"
"Written by the VideoLAN team; see the AUTHORS file.\n"
msgstr ""
"Ce programme est fourni SANS AUCUNE GARANTIE, tel que permis par la loi.\n"
"Vous pouvez le redistribuer selon les termes de la Licence Publique Générale "
"GNU ;\n"
"voir le fichier COPYING pour plus de détails.\n"
"Écrit par l’équipe VideoLAN ; voir le fichier AUTHORS.\n"

#: include/vlc_config_cat.h:32
msgid "VLC preferences"
msgstr "Préférences de VLC"

#: include/vlc_config_cat.h:34
msgid "Select \"Advanced Options\" to see all options."
msgstr "Cliquez sur « Options avancées » pour voir toutes les options."

#: include/vlc_config_cat.h:37 modules/gui/macosx/simple_prefs.m:174
#: modules/gui/qt4/components/simple_preferences.cpp:77
#: modules/gui/qt4/menus.cpp:952 modules/misc/dummy/dummy.c:68
msgid "Interface"
msgstr "Interface"

msgid "Deine Nachricht enthält einen Fehler"
msgid_plural "Deine Nachricht enthält %{num} Fehler"
msgstr[0] "Deine Nachricht enthält einen Fehler:"
msgstr[1] "Deine Nachricht enthält %{num} Fehler:"

How to Translate a Gettext PO File?

It is easy to translate a Gettext PO file with WebTranslateIt. In a project, upload your source Android XML file in the File Manager and translate it on the Translation Interface.

The tools included in WebTranslateIt, such as Batch Operations, the Translation Memory or Machine Translation can help you translate that file automatically, faster and cost effectively.

More Information

Related Platforms