PO/Gettext Translation
Target Language: zh-Hans-CN (Chinese, Simplified Chinese, China)
The code of the target language. Example: en, en-US, fil, zh-Hans-CN. Type to search.
Translate Metadata:
Indicates whether to translate PO file metadata such as translator comments and header fields along with the message strings. Disabling this option ensures that metadata remains unchanged in the translated output.
Use Contractions:
Indicates whether to use grammar contractions. Using contractions makes the translation less formal.
Use Shortening:
Indicates whether to use shortened forms if the translation is longer than the source text.
Terminology:
Source PO Content:
AI translation takes time (up to 5 minutes) as the AI processes your content. This PO Translation page translates in real-time and does not store your content on our servers. For large PO files, we recommend using the I18N File Translation page for more reliable delivery. Please do not leave this page until translation is complete.

How to Translate PO/Gettext Files Online

Translating PO (Portable Object) files with our AI-powered service is fast and accurate. Follow these steps to translate your gettext localization content while preserving the PO format structure.

  1. Paste Your PO Content: In the "Source PO Content" section, paste your PO or POT file content. Our service recognizes standard PO format including msgid, msgstr, comments, plural forms, and context entries.
  2. Set Target Language: Enter the target language code (e.g., 'fr-FR' for French, 'de' for German) for the translation.
  3. Start Translation: Click the "Translate" button to begin. Our AI processes the PO structure, translates msgstr values while preserving msgid entries, comments, and format placeholders.
  4. Copy or Save: After the translation is complete, copy the translated PO content to your clipboard or save it as a .po file ready to use in your project.

What Are PO and POT Files?

PO (Portable Object) files are a widely used localization format created by the GNU gettext internationalization system. They store translatable strings as key-value pairs using msgid (original text) and msgstr (translated text) entries.

PO files are the standard localization format for many open-source projects and frameworks, including WordPress, PHP applications, Python (Django, Flask), Ruby on Rails, C/C++ programs, and desktop applications built with GTK or GNOME.

PO File Format Structure

A PO file consists of entries with the following key elements:

# Translation file for MyApp
#: src/components/header.js:12
msgid "Welcome to our application"
msgstr ""

#: src/components/login.js:8
msgid "Sign in to your account"
msgstr ""

#: src/components/dashboard.js:15
msgid "You have %d new messages"
msgid_plural "You have %d new messages"
msgstr[0] ""
msgstr[1] ""
  • msgid — The original untranslated string (source text). This serves as the key for looking up translations.
  • msgstr — The translated string for the target language. Empty msgstr values indicate untranslated strings.
  • Comments (#) — Provide context for translators. #: indicates source file references, #. contains extracted comments, and #, holds flags like fuzzy.
  • Plural forms (msgid_plural, msgstr[N]) — Handle language-specific plural rules. Different languages have different numbers of plural forms (e.g., English has 2, Polish has 3, Arabic has 6).
  • Context (msgctxt) — Disambiguates identical source strings that need different translations depending on context (e.g., "Open" as a verb vs. adjective).

PO vs. POT Files

A POT (Portable Object Template) file is the template used to create PO files. It contains all the source strings with empty msgstr values. When starting a new translation, you copy the POT file, rename it for your target language (e.g., fr.po), and fill in the translations.

Our service accepts both PO and POT content. Simply paste either format, and the AI will generate translations for all msgstr entries.

POT File Example

Here is a typical POT template file with a header and translatable strings:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-01 00:00+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#: src/app.py:42
msgid "Hello, World!"
msgstr ""

Why Use Our PO Translation Service

  • AI-powered contextual translation: Our advanced AI understands PO file structure, handles gettext format placeholders (like %s, %d, %(name)s), and adapts translations to cultural nuances for the target language.
  • Full gettext format support: Our service handles all PO format features including headers, comments, context entries (msgctxt), plural forms, and format flags. The PO structure is fully preserved during translation.
  • Plural form handling: Correctly generates plural form translations based on the target language rules. Whether your target language has 2, 3, or 6 plural forms, our AI generates the appropriate msgstr[N] entries.
  • Locale-specific adjustments: Automatically adapts numbers, dates, and other locale-sensitive content within translated strings to match the target language conventions.
  • Error handling: Detects and corrects AI translation errors, ensuring consistently high-quality PO file output.
  • Cost-effective: Enjoy affordable pricing with 30,000 free characters monthly. View Pricing
  • Optimized for large PO files: Efficiently processes large PO files by dividing them into manageable chunks, ensuring translation consistency with predefined terminology and context across all entries.

Common Use Cases for PO File Translation

PO files are the standard localization format for a wide range of platforms and frameworks:

  • WordPress: WordPress themes and plugins use PO/POT files for internationalization. The gettext system is the standard way to make WordPress content translatable across 200+ languages.
  • PHP Applications: PHP's gettext extension uses PO files natively. Frameworks like Laravel, Symfony, and CakePHP support PO-based localization for multi-language applications.
  • Python (Django, Flask): Django uses gettext and PO files as its standard localization mechanism. The makemessages command extracts translatable strings into POT files, and compilemessages compiles PO files into binary MO files.
  • Ruby on Rails: While Rails defaults to YAML, many Ruby projects use the gettext gem with PO files for localization, especially when integrating with existing gettext-based translation workflows.
  • C/C++ Programs: GNU gettext was originally designed for C programs. Many system utilities, command-line tools, and desktop applications use PO files for their user interface translations.
  • JavaScript/TypeScript (Lingui): Lingui is a modern i18n library for React, Next.js, and other JavaScript frameworks that uses PO/POT files as its primary translation format. The @lingui/cli tool extracts translatable strings into PO catalogs, and Lingui's runtime loads compiled translations at build time for optimal performance.
  • Desktop Applications (GTK/GNOME/KDE): Linux desktop environments and GTK/Qt applications rely on PO files. GNOME and KDE projects manage thousands of PO files across dozens of languages.

PO Translation vs. Other Localization Formats

PO files are one of the most established localization formats, with over 30 years of history in the open-source community. Unlike JSON or YAML-based formats, PO files include built-in support for plural forms, translator comments, source references, and contextual disambiguation.

While modern frameworks often use JSON (i18next, React Intl) or YAML (Rails), PO remains the preferred format for WordPress plugins, PHP applications, Python Django projects, and Linux desktop software. Our service bridges both worlds — translate PO content here, or use our I18N File Translation page for batch processing of any format.

Our AI translation preserves the complete PO file structure, including headers (Project-Id-Version, Content-Type, Plural-Forms), translator comments, source file references, and format flags, ensuring your translated PO files are ready for immediate use with gettext tools like msgfmt.