translations/get-string reads a single string out of a POT or a translation, addressed by its exact source text.
It is the confirmation step before a write: does this string exist, in this domain, in this locale, spelled exactly this way?
At a glance
| Ability | translations/get-string |
| Toolset | Loco Translate — toolset/loco-translate |
| Group | Loco Translate › Strings |
| Requires | Loco Translate, active on the site |
| Capability | manage_options |
| Safety | Read-only — changes nothing |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
How it works
The source must match the file byte for byte. A trailing space, a curly apostrophe where the source has a straight one, an ellipsis character instead of three dots — any of those makes it a different string as far as gettext is concerned.
context disambiguates when the same source text appears more than once. Gettext uses it precisely so that “Post” the noun and “Post” the verb can be translated differently.
The fuzzy flag is worth reading before overwriting. A fuzzy string already has a translation that somebody thought was close; replacing it blindly discards that.
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. |
locale | string | No | Locale such as de_DE. Omit to address the POT template instead of a translation. |
source | string | Yes | The exact source text, as it appears in the file. |
context | string | No | Gettext context, when the same source text appears more than once. |
What comes back
| Name | Type | What it is |
|---|---|---|
string | object | Source, translation, context, references and fuzzy flag. |
file | string | The file that was read. |
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:
What is “Add to cart” currently translated as in French?
It resolves to one call:
{
"ability": "translations/get-string",
"parameters": {
"bundle": "woocommerce",
"locale": "fr_FR",
"source": "Add to cart"
}
}Worth knowing
- Byte-for-byte match. Copy the source from
translations/list-stringsrather than retyping it. - Pass
contextwhen the same text appears twice, or you may read the wrong one. - A fuzzy result means somebody already tried. Read it before replacing it.
Related abilities
- List Translation Strings — find the exact source text
- Update Translation Strings — change it
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category