Skip to content

UI translation

Prompt templates are written once, typically in English. UI translation is a display-only feature that translates the system prompt, user prompt, name and description fields into the language of the current admin user — without ever modifying the underlying template.

On the prompt detail page, non-English admins see a Translate to {language} button on both the System and User prompt cards (the button is hidden for English-language admins because the source is already in their language).

  1. Click the button.
  2. The plugin checks whether it has already translated this exact content into the target language.
  3. If a cached translation exists for the current content, it is displayed instantly.
  4. If not, the plugin asks the model to translate the field. The result is cached for next time.
  5. The translation renders in a green-bordered block below the original.
  6. Click the button again to toggle back to the original.

The cache key includes a source_hash — a SHA-256 of the source text. When you edit a prompt and save, the hash changes and the next request misses the cache and triggers a fresh translation. Old cache rows become unreachable and are cleaned up over time. No manual invalidation is needed.

A small outdated badge appears next to the translate button if the underlying prompt was edited after the translation was cached — a reminder that the cached translation is for an earlier revision and a fresh one will be fetched on the next click.

The supported fields are:

  • systemPrompt
  • userPrompt
  • description
  • name

The translation is for reading the template — it does not alter how the model is called. The actual prompt sent to OpenAI is always the source language.

Any language Shopware has configured for the admin can be a target. The plugin uses the admin’s locale to decide which language to translate into; no manual language picker.