Tool description

This tool fills gettext PO and POT files with AI translations. Use it for WordPress themes and plugins, Django, PHP, Python and C projects, or any other software that uses gettext. Open a .po or .pot file, pick the language, and the empty msgstr entries are filled with translations of their msgid.

The file is read in your browser. Only the msgid text is sent to the AI, together with its msgctxt context when there is one. Comments, source references, flags such as #, c-format, and obsolete entries are copied as they are.

Features

  • Fills msgstr for every entry, and msgstr[0], msgstr[1] and so on for plural entries.
  • Keeps translator comments, #: references, #, flags and #~ obsolete entries.
  • Uses msgctxt as context, so "Open" in a menu and "Open" as a status can be translated differently.
  • Keeps format strings like %s, %1$d, %(name)s and {name}.
  • Sets the Language field of the header to the target language.
  • Writes multi-line texts in the usual gettext style.

Options explained

  • Only untranslated entries: keeps the entries that already have a translation and fills only the empty ones. Turn it off to translate every entry again.

Examples

#: src/cart.php:42
#, php-format
msgid "%d item in your cart"
msgid_plural "%d items in your cart"
msgstr[0] ""
msgstr[1] ""

translated into French:

#: src/cart.php:42
#, php-format
msgid "%d item in your cart"
msgid_plural "%d items in your cart"
msgstr[0] "%d article dans votre panier"
msgstr[1] "%d articles dans votre panier"

Tips

The number of plural forms depends on the language. The tool fills the msgstr[n] lines that are in the file; if you start from a POT file, set the Plural-Forms header for the target language and add msgstr[n] lines if the language needs more than two forms.

Up to 10,000 characters of text can be translated at once. Keep "Only untranslated entries" on to translate a big file in several runs.

FAQ

Can I compile the result with msgfmt? Yes. The file keeps the gettext format, so msgfmt, Poedit and other tools read it as usual. Review the translations before you release them.

Is my file uploaded? No. The file is read in your browser, and only the source texts are sent to the AI.