FAQsHow to customize the prompt per language?
How to customize the prompt per language?
The prompt in the Settings will be the general one for all languages, right? We work with seven different languages: English (the main one), Spanish, French, German, Japanese, Portuguese, and Korean. How can I add the language variables effectively in this case?
There are 2 ways:
You can customize the prompt for each language using a PHP hook.
Or you can modify your prompt template to add a conditional instruction, checking the value of variable placeholder {$targetLanguage}
against each target language.
For instance, your prompt template in the Settings can say:
If "{$targetLanguage}” equals “Korean", then {instructions for Korean}
Otherwise:
If "{$targetLanguage}” equals “German", then {instructions for German}
Otherwise:
...
So that will be resolved to this prompt:
If “Korean” equals “Korean", then {instructions for Korean}
Otherwise:
If “Korean” equals “German", then {instructions for German}
Otherwise:
...