Skip to content

AI translation: translate content into your other languages

Describes AI 0.29.1.

On a site with more than one language, the forms of some modules carry an AI Translate button. It sends the text of the primary language to an AI endpoint and fills in the other languages, in the background, while you keep working.

Where to find it

The button sits under the language tabs of a multilingual form in modules that use it, such as the catalogue and shop forms. It shows when the form has more than one language and AI translation is available: the AI module is on and at least one endpoint is enabled. What you may translate is decided by the module whose form it is.

The AI Translation dialog

AI Translate opens the dialog. It names the source language and says each translation runs as a background job.

  • The endpoint list (Select an endpoint…) offers the enabled endpoints. A note under it says reasoning (“thinking”) models are slower and may return unstructured output, so a standard model is recommended.
  • The prompt list (Select a prompt…) offers the enabled prompts. If the shared translation prompt doesn’t exist yet, Generate Default Prompt creates it, named “PhoenixKit Translate Content”. You can then edit it under AI → Prompts like any other prompt.
  • Translate chooses which languages to fill:
    • Missing only: the languages with no translation yet.
    • All non-primary languages (…, overwrites existing): every other language. Existing translations are overwritten when the jobs finish, and the dialog warns about it.
    • Current tab only: the language of the tab you are on.

The button at the bottom names what it will do, for example Translate 2 missing languages, and starts the jobs.

While it runs

The AI Translate button shows a spinner, the dialog lists Translating to the languages in progress, and a progress bar follows the session. If it takes long, a note says the translations keep running in the background and that you can leave the page: each language is saved the moment it finishes. Starting the same translation twice, for example from two tabs, doesn’t queue it twice.

Each translation is an AI call of the Translation task, so it is listed on the Usage page, and that task’s limits on AI → Tasks apply.

Which endpoint and prompt are preselected

When the dialog opens, the endpoint is the one set as the translation default, if any. Without one, it is the endpoint of the most recent successful chat request on the site whose endpoint is still enabled (so a try in the Playground counts), then the first enabled endpoint without thinking, then the first enabled endpoint. The prompt is the one set as the default, else the shared translation prompt.

What it doesn’t do

  • The AI module has no settings page for translation: the default endpoint, prompt and glossary are site settings a developer sets (see below).
  • It translates only the fields the module hands it. The shared prompt fills the fields called name, title, summary, description, body and content.
  • Translation runs in the background; it doesn’t show the text for review before saving it.

For developers

The defaults are site settings: ai_translation_endpoint_uuid (the default endpoint; for background runs it is binding, so a deleted or disabled endpoint stops them instead of switching), ai_translation_prompt_uuid (the default prompt) and ai_translation_glossary (terminology handed to the model as plain text; ai_translation_glossary_<language> overrides it for one language). A host app can add its own records to the pipeline with config :phoenix_kit_ai, translatables: [...]; see the module README.