Gettext Localization API (.po)

Localization.One fully supports the industry-standard GNU Gettext format. Whether you are building a WordPress plugin, a Django application, or a C++ project, you can manage your translations in a modern interface and export them as valid .po files.

Why Developers choose our Gettext API?

  • Native PO Format: We generate valid msgid and msgstr entries compatible with Poedit and standard Gettext compilers (msgfmt).
  • Smart Escaping: We automatically handle double quotes and newlines, ensuring your files compile to binary .mo format without syntax errors.
  • Header Management: Every file includes standard headers (Content-Type, Encoding), so your application recognizes the character set (UTF-8) correctly.

Advanced Project Management

We provide powerful tools to keep your localization organized, no matter how large your project grows.

Categorization: Group your strings into a logical folder tree (e.g., Admin > Menu, Frontend > Errors).

Labels & Tags: Mark strings with custom labels to filter exports via API.

Roles & Permissions: Invite unlimited team members and assign granular roles (Owner, Admin, Manager, Translator).

Webhooks: Receive notifications on your server whenever translations are updated or approved.

How to Integrate

Option 1: Manual Export (UI)

Perfect for periodic updates or manual compilation.

  1. Go to your Project Dashboard.
  2. Click the Download button.
  3. Select Gettext PO from the format dropdown.
  4. Choose the language and download the file.

Option 2: Automate with API (CI/CD)

Fetch the latest translations directly in your build pipeline. Pass the format=po parameter.

bash
# Download English translations
curl "https://api.localization.one/{YOUR_API_KEY}/getTranslations?translation_language=1&format=po" > languages/en_US.po

# Download Spanish translations
curl "https://api.localization.one/{YOUR_API_KEY}/getTranslations?translation_language=2&format=po" > languages/es_ES.po

Option 3: Push via Webhooks

Configure a Webhook URL in your project settings to automate the process entirely.

  • Quick Updates: Your server receives a POST request shortly after changes (usually within 5 minutes).
  • Auto-Compile: Use the webhook to trigger a script that downloads the .po file and compiles it to .mo automatically.

Frequently Asked Questions

Do I need to compile the .mo file?

Yes. Our API provides the source .po file. You should include a step in your build process (using msgfmt) to compile it into a binary .mo file for better performance in production.

Is it compatible with WordPress?

Yes. The exported format is fully compatible with WordPress. Just make sure to rename the file to the correct text domain format (e.g., my-plugin-es_ES.po) after downloading.

Related technologies:

Ready to modernize your Gettext workflow? Create your free account today.