translations/extract-strings scans a bundle’s source code for translatable strings and writes a fresh POT template.
It is how a bundle with no template gets one, and how a stale template catches up with code that has moved on.
At a glance
| Ability | translations/extract-strings |
| Toolset | Loco Translate — toolset/loco-translate |
| Group | Loco Translate › Maintenance |
| Requires | Loco Translate, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Not idempotent — each call changes the row set, so re-running is not a no-op |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
The gate on this one
Requires confirm: true, because a template is the thing every translation is measured against. Strings that no longer appear in the source are dropped from the new template — and on the next translations/sync-translations they are dropped from every translation too, taking the translated text with them.
How it works
The number to read afterwards is skipped_files. Loco refuses to scan source files over its size limit, and any translatable string inside one of those is simply absent from the template.
That matters because a template can look complete — a healthy string count, no errors — while missing every string in the largest file in the plugin. Reporting the skip count is the only way that becomes visible.
Nothing is translated by this. It produces the list of what could be translated; translations/sync-translations then brings each locale into line with it.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
bundle | string | Yes | Bundle id, handle or slug — all three appear in Loco’s own screens. Use core for WordPress itself. |
domain | string | No | Text domain. Omit for the bundle default. |
What comes back
| Name | Type | What it is |
|---|---|---|
file | string | The POT template that was written. |
string_count | integer | How many strings it holds. |
skipped_files | integer | Source files Loco refused to scan for exceeding its size limit. Any string in them is missing from this template. |
bytes | integer | Size of the template written. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Rebuild the POT template for our custom plugin — we added a lot of new strings.
It resolves to one call:
{
"ability": "translations/extract-strings",
"parameters": {
"bundle": "acrossai-abilities-manager",
"confirm": true
}
}Worth knowing
- Check
skipped_files. Anything above zero means the template is incomplete in a way the string count will not show you. - Sync afterwards, and expect to see translations dropped for strings the source no longer contains.
- Not idempotent — each run rewrites the template from whatever the source says now.
Related abilities
- Sync Translations — apply the new template to each locale
- Get Translation Bundle — check whether a template exists first
- List Translation Strings — read the template that came out
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category