PTC delivers Better Than Human AI translationsforWordPress themes and plugins. Start with a .pot fileand get translated .po and .mo files. Learn how to integrate .pot file translation into your development workflow.
This guide covers how to translate .pot files using PTC. If you want to learn how to internationalize your entire WordPress project, including JavaScript strings, see our guide to WordPress internationalization.
Translating PO Files with PTC: First-Time Setup
The initial setup requires a few steps. You’ll prepare your code, generate .pot files, connect your repo to PTC, and provide context about your software. After that, PTC delivers .po and .mo files with translations and automatically handles translation updates whenever your code changes.
Step 1: Wrap Translatable Text In WordPress Localization Functions
Use gettext functions to wrap any user-facing text in your code.
Breaking sentences into parts makes it difficult to maintain grammar and word order in many languages. This can lead to incorrect or awkward translations.
Step 3: Generate a POTFile from the Source Code
Once your code uses __() and _e() properly, generate a .pot file. This file acts as a template that contains all original (untranslated) strings pulled from your theme or plugin.
For WordPress plugins and themes, you can use tools like WP-CLI:
wpi18nmake-pot.languages/plugin-name.pot
Example of what a .pot file should look like:
msgid"Read more"msgstr""msgid"Submit"msgstr""
Each entry starts with msgid, which holds the original (source) string. The msgstr is where the translation will go. In a .pot file, msgstr is always empty—it gets filled later in the .po files.
Step 4: Sign-Up For a PTC Account (Free for 30 Days)
Create a PTC account to start translating. Your free trial gives you full, unlimited access for 30 days.
Step 5: Connect Your Git Repository
PTC works by connecting to your GitHub, GitLab, or Bitbucket repository. This allows it to:
Detect .pot files
Send merge requests with translations in .po and .mo files directly to your repository
You don’t need to upload or download anything manually.
Step 6: Complete PTC’s Setup So It Can Translate Your Project Accurately
During the initial set up, PTC asks you to:
Select the languages you want to translate into. You can choose from 33 supported languages
Provide a short description of your plugin or theme, including what it does and who it’s for
PTC uses this information to generate Better Than Human Translations that are tailored to your project’s purpose and audience.
Step 7: Review and Confirm You Received the Correct Translation Files
After PTC finishes translating, it sends a merge request to your repository. Use this chance to check that you see the correct translation files in the right place before merging.
You should see:
A .po (Portable Object) file for each language, with entries like:
msgid"Read more"msgstr"Leer más"
A .mo (Machine Object) file for each .po. This is a compiled version that WordPress uses to load translations at runtime.
The files added to the correct folder in your repository.
If something looks incorrect, like a missing file or an unexpected folder path, go to Settings → Monitored Files in your PTC project and update the resource file settings.
Step 8: Load the Translations in WordPress
To make sure your plugin or theme uses the translations, load the text domain in your code. For example:
This tells WordPress where to find your .mo files so it can load the correct translations when the user’s site language matches one of the available languages in your plugin or theme.
Step 9: Translate Your Plugin or Theme’s Readme.txt
If your plugin or theme includes a readme.txt file, it won’t be picked up by PTC automatically. But it contains important content users see, like your plugin description, installation steps, and changelog. WordPress.org also uses your README file to populate the Details tab of your plugin or theme listing.
To translate it with PTC:
In your PTC project dashboard, go to Translations → Paste to translate
Paste sections of your readme.txt
Select your target languages and click Translate
You can then copy the translations and bundle them with your theme or plugin. To learn how to make these translations appear on WordPress.org, check our WordPress internationalization guide.
Keeping Translations Up to Date
PTC automatically keeps your PO and MO files updated. When the .pot file changes, PTC detects new or modified strings, translates them, and sends a merge request with the updates.
The only thing you need to update manually is content translated through Paste to translate, like the readme.txt. Just paste the updated text into PTC again if it changes.
Start Translating POT Files with PTC
PTC makes it easy to localize your plugin, theme, or gettext-based software. Try it free for 30 days.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.