30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Create Translation File

translations/create-translation-file starts a translation for a bundle in a locale it does not yet have, seeded from the POT template so every translatable string is there and empty, ready to fill in.

It takes no path. Where a translation belongs depends on the text domain and whether the bundle is a theme, and Loco already knows the answer — supplying a path would only be a way to get it wrong.

At a glance

Abilitytranslations/create-translation-file
ToolsetLoco Translate — toolset/loco-translate
GroupLoco Translate › Translation Files
RequiresLoco Translate, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

It refuses rather than overwrites. If a translation for that locale already exists, this stops — because the alternative is silently discarding somebody’s work.

Seeding comes from the POT. A bundle with no template produces a thin or empty file, which is why translations/get-bundle is worth calling first and translations/extract-strings worth running when there is no template at all.

The compiled artefacts are written immediately, so the new locale is live — showing untranslated source text, which is correct — rather than half-created.

Input

NameTypeRequiredWhat it is
bundlestringYesBundle id, handle or slug — all three appear in Loco’s own screens. Use core for WordPress itself.
domainstringNoText domain. Omit for the bundle default.
localestringYesLocale to create, such as de_DE. Call translations/list-locales for valid tags.

What comes back

NameTypeWhat it is
artefactsobjectBytes written per artefact — po_bytes, mo_bytes, php_bytes, json_files, json_bytes. Read back from disk rather than reported by Loco, so a zero mo_bytes means the site is still serving the old strings.
filestringThe PO file that was created.
string_countintegerHow many strings it was seeded with.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent 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:

Start a Spanish translation for this theme.

It resolves to one call:

{
  "ability": "translations/create-translation-file",
  "parameters": {
    "bundle": "twentytwentyfive",
    "locale": "es_ES"
  }
}

Worth knowing

  • Refuses if the locale already exists. That is a guard, not a failure.
  • A low string_count usually means the bundle has no POT template to seed from.
  • Get valid locale tags from translations/list-locales rather than guessing.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading