How to translate content with a prompt
AI providers allows to translate your existing data in the fields to another language. You need to create a corresponding propmpt in AI Assistant for translating purposes.
-
When creating a Prompt, specify in which language you want to receive the response.
-
Create a separate Prompt in which you ask to translate an existing text to another language (similar to how Fix Grammar prompt).
-
Write the question in the language you want to receive the answer. For example, if you want to translate from English to German - write the prompt in German. (Before using this case, please check that your AI provider support required languages: OpenAI supported languages, Claude supported languages, Gemini supported languages.)
-
Use the
{{ store.locale }}variable for the target language and the{{ global.input }}variable for the text to translate.{{ store.locale }}returns the target Store View’s locale label (e.g.,English (United States),German (Germany),French (France)); the store context always comes from the target Store where the prompt runs—regardless of Get Variables’ Values From.{{ global.input }}resolves to the current value of the field being processed when the rule's Include target field value into prompt option is enabled. Together they let you keep a single universal prompt that translates any field into any Store View's language. Example:Translate the following text into {{ store.locale }}:
{{ global.input }}
Output only the translated text. Do not add any preamble, explanation, code fences, or surrounding quotes.In the rule, enable Include target field value into prompt, set Generate content per store to
Yes, and select the target Store Views. In the prompt, set Get variables' values from to the source Store View (usuallyDefault) so each iteration reads from the same source.