Appearance
Manage Loco Translate Strings with AI
Use Easy MCP AI to find and update interface strings stored in Loco Translate files. These are plugin and theme interface strings, not translations of posts or the language relationships between posts.
In this article
Activate Loco Translate and enable the tools
- In WordPress, go to Plugins > Add New, search for Loco Translate, and install and activate the plugin.
- Go to Easy MCP AI > Tools and search for Loco Translate.
- Expand the list, read, and update tools for Loco Translate. Enable the list and read tools you need, and enable the update tool to make changes. If a tool is locked, its enabled state is controlled by a deployment setting.
- Click Save changes. The settings apply to every client, but the AI connection must also allow the tools and the connected WordPress user must have the
loco_admincapability. - Refresh the tool list in your AI client so it can discover the enabled tools.
List, read, and update a translation
Start by asking your AI client to use wp_loco_list_files to list the Loco Translate files for the plugin or theme and locale you want to update. The list includes each file's path, relative to wp-content, and its location: custom, system, or author. A file marked readable: false cannot be read and is refused. Choose a readable file and the intended locale before making a change.
Ask the AI client to use wp_loco_get_translations to read the matching translation file. The results include the source string, context, translation, plural forms, fuzzy status, and format. Results are paginated, so continue through the pages if the string you need is not in the first results.
Then ask the AI client to use wp_loco_update_translations to update the translation, preserving the exact source string and context from the read result. Provide the translation for the matching locale and include the appropriate translated plural forms when the entry has them. Set fuzzy to mark an entry as needing review. Do not change the source or context as part of a translation update.
This workflow changes interface strings in Loco Translate PO files. It does not translate post content or assign posts to languages. To assign a language to a post or link existing translated posts, see Manage Post Languages and Translations with AI.
Choose a file location and check validation
Loco Translate files can be stored in different locations:
| Location | Where the files are stored | What to keep in mind |
|---|---|---|
custom | wp-content/languages/loco/plugins or wp-content/languages/loco/themes | These files survive plugin and theme updates. |
system | wp-content/languages/plugins or wp-content/languages/themes | WordPress language-pack updates can replace these files. |
author | Inside the plugin or theme directory | Plugin or theme updates can replace these files. |
These tools update a listed, existing file; they do not create a destination file. When choosing which existing file to update, prefer one in the custom location because it survives plugin and theme updates.
Before saving, the tools check that the PO filename contains a recognized locale, that the source string matches exactly, and that the PO, MO, and cache files that need writing are writable. They also check that placeholders retain their type and position, and validate HTML against what the connected account may publish. Duplicate or invalid entries are refused. The checks happen before any files are written, so a failed precheck does not partially update the translation.
The integration is tested with Loco Translate 2.8.9 and later patch releases.
Inspect the save and compilation results
After an update, review the result for updated, unchanged, changed, and files_written, along with any warnings. Loco Translate saves the PO file and compiles the corresponding MO, JSON, or PHP files when needed.
A PO file can be saved even if the MO file is missing. In that case, WordPress may continue to show the old strings. Check the warnings and files_written to see which files were produced, then read the translation again to confirm what was saved. Do not retry the update until you have checked the saved entry and the compilation result.