Skip to content

Translating posts: add languages by hand or with AI

Describes Publishing 0.19.0.

A Publishing post can hold the same text in several languages. Each language has its own title, body and, in slug-based groups, its own URL. You write them by hand in the editor, or let the AI module translate from the primary language.

Where to find it

In the post editor (/admin/publishing/<group>/<post>/edit). You need the Publishing permission.

The languages come from PhoenixKit’s Languages module: the post can be written in every language enabled there, and the primary language set there is the post’s source language. With only one language enabled, the editor shows no language switcher at all. AI translation also needs the AI module installed and enabled, with at least one endpoint and one prompt.

The language switcher

Above the title, Language: lists the enabled languages, primary first. Each shows whether this post already has that language and its status. Clicking a language saves your pending edits and opens it. A brand-new post has to be saved once before you can switch languages.

A language the post doesn’t have yet opens as a new, empty translation: no title, no body. It is created when you save it, with the message “Translation created and saved”.

Status is not set per language. The Status field says Applies to all languages in this version., so publishing a version publishes all its languages at once. Translations also belong to a version: creating a version by copying another copies its translations too.

If the post has a language that is switched off in Languages, or a code PhoenixKit doesn’t recognize, the editor shows Disabled language: or Unknown language: with an explanation. The content is kept and its publishing status is still respected.

Each translation’s URL

In a Slug-based group, the primary language edits the post’s Slug, which is the post’s URL. A translation has its own URL Slug (optional) field instead: Leave empty to generate it from this translation’s title, followed by the slug it would get. Preview: shows the path the translation will have. Saving with the field empty gives the translation a slug from its own title, or the post’s slug when that one is already taken in this language.

The hint under the primary Slug says Translations keep their own URL slugs.: renaming the post’s slug moves only the primary language’s URL. Once the post has been public, changing a slug shows a notice that the URL moves and the old one redirects to the new one.

A URL slug is refused when it isn’t lowercase letters, numbers and hyphens, when it is a language code, when it is a reserved word (admin, api, assets and so on), or when it was another post’s address. When another post in the group uses it, URL slug already in use names that post and offers Open that post.

Clearing a translation

Clear translation, at the bottom of the right column, deletes the current language’s title and body from this version after a confirmation, then returns you to the primary language. You can add the language again later. The primary language can’t be cleared.

Translating with AI

AI Translate, in the row above the editor, opens AI Translation. It shows only when the AI module is on, and only after the post’s first save.

  • Pick an endpoint (Select an endpoint…) and a prompt (Select a prompt…). Manage Endpoints and Manage Prompts open the AI module’s pages. The dialog recommends a standard model over a reasoning one for translation.
  • Generate Default Prompt appears when the module’s translation prompt doesn’t exist yet and creates it. Regenerate Default Prompt appears when the existing one predates the current format.

On the primary language, two buttons:

  • Translate to All Languages: “Translate to All” will create or overwrite translations for all enabled languages.
  • Translate Missing Only: “Translate Missing” will only create translations for languages that don’t have one yet.

On another language, Translate to This Language translates the primary language’s text into it, overwriting what is there.

The editor saves your pending edits first, then starts one background job per language. It translates the title and the body of the version you are on, and gives each translation a URL slug made from its translated title. Before it starts, Confirm Translation lists anything to know: an empty source title or body, languages whose content will be overwritten, and colleagues editing one of those languages, who are locked out and lose their unsaved changes.

While it runs, the dialog shows progress, and the editor shows Translation in progress: Editing is paused while AI translates this content. It will unlock automatically when finished. You can leave the page; the jobs carry on.

What it doesn’t do

  • The AI translates the title and body only. Other fields, such as the SEO and OpenGraph texts, are not translated.
  • Languages are not chosen per post or per group: every language enabled in the Languages module is offered.
  • Status can’t differ between the languages of one version.
  • AI translation always starts from the primary language; you can’t translate from one translation into another.