How to set the next question into Chinese? #5944
Replies: 8 comments 4 replies
-
|
Hello @silence-pan84! I'm here to help you with any bugs, questions, or contributions you might have for the repository. Let me know how I can assist you! To set the suggested questions in the chatbot interface to display in Chinese, you need to ensure that the Here is the relevant part of the code that handles the display of suggested questions: const {
isOpeningStatement,
suggestedQuestions,
} = item;
if (!isOpeningStatement || !suggestedQuestions?.length)
return null;
return (
<div className='flex flex-wrap'>
{suggestedQuestions.filter(q => !!q && q.trim()).map((question, index) => (
<div
key={index}
className='mt-1 mr-1 max-w-full last:mr-0 shrink-0 py-[5px] leading-[18px] items-center px-4 rounded-lg border border-gray-200 shadow-xs bg-white text-xs font-medium text-primary-600 cursor-pointer'
onClick={() => onSend?.(question)}
>
{question}
</div>),
)}
</div>
);To display the questions in Chinese, you need to populate the {
"isOpeningStatement": true,
"suggestedQuestions": ["你好", "你叫什么名字?", "今天天气怎么样?"]
}This will render the suggested questions as "你好", "你叫什么名字?", and "今天天气怎么样?" in the chatbot interface. Additionally, you can use the SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT = (
"请帮助我预测人类最有可能问的三个问题,每个问题不超过20个字符。\n"
"输出必须是符合指定模式的JSON数组:\n"
"[\"问题1\",\"问题2\",\"问题3\"]\n"
)By ensuring the prompt and the input language are in Chinese, the generated suggested questions will also be in Chinese. Additionally, you can refer to the Dify platform's i18n settings to ensure that all relevant interface elements are properly localized. For example, the feature: {
suggestedQuestionsAfterAnswer: {
title: '下一步问题建议',
description: '设置下一步问题建议可以让用户更好的对话。',
resDes: '回答结束后系统会给出 3 个建议',
tryToAsk: '试着问问',
},
}This should help you set the next questions in Chinese [1][2][3][4]. |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
To change "Try to ask" into Chinese, you need to update the translation file for the corresponding key In your translation JSON file (e.g., {
"appDebug": {
"feature": {
"suggestedQuestionsAfterAnswer": {
"tryToAsk": "试着问问"
}
}
}
}This will ensure that the text "Try to ask" is displayed as "试着问问" in Chinese when the language is set to Chinese in your application [1]. |
Beta Was this translation helpful? Give feedback.
-
|
Not on the debug screen, but on the run screen, "try to ask." @dosu |
Beta Was this translation helpful? Give feedback.
-
|
I checked everything, but it's still in English @dosu |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
I think the problem is in The prompt I chat with it in Chinese, but the generated suggestion questions sometimes display in Chinese and sometimes in English. |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
How to set the next question into Chinese?
2. Additional context or comments
No response
3. Can you help us with this feature?
Beta Was this translation helpful? Give feedback.
All reactions