常见问题如何为每种语言自定义提示词?
如何为每种语言自定义提示词?
设置中的提示词是所有语言通用的,对吧?我们使用七种不同的语言:英语(主语言)、西班牙语、法语、德语、日语、葡萄牙语和韩语。在这种情况下,如何有效地添加语言变量?
有两种方式:
您可以使用 PHP 钩子为每种语言自定义提示词。
或者,您可以修改提示词模板以添加条件指令,将变量占位符 {$targetLanguage} 的值与每种目标语言进行比较。
例如,您在设置中的提示词模板可以这样写:
If "{$targetLanguage}" equals "Korean", then {instructions for Korean}
Otherwise:
If "{$targetLanguage}" equals "German", then {instructions for German}
Otherwise:
...这样将解析为以下提示词:
If "Korean" equals "Korean", then {instructions for Korean}
Otherwise:
If "Korean" equals "German", then {instructions for German}
Otherwise:
...Prev
Next