update prompts ui lang

This commit is contained in:
duanfuxiang 2025-05-01 13:21:46 +08:00
parent 03e0d08623
commit dc4ce4aeca
3 changed files with 65 additions and 24 deletions

View File

@ -215,7 +215,7 @@ const CustomModeView = () => {
{/* Mode name */} {/* Mode name */}
<div className="infio-custom-modes-section"> <div className="infio-custom-modes-section">
<div className="infio-section-header"> <div className="infio-section-header">
<h3>Mode Name</h3> <h3>{t('prompt.modeName')}</h3>
{!isBuiltinMode && !isNewMode && ( {!isBuiltinMode && !isNewMode && (
<button className="infio-section-btn" onClick={deleteMode}> <button className="infio-section-btn" onClick={deleteMode}>
<Trash2 size={16} /> <Trash2 size={16} />
@ -224,10 +224,10 @@ const CustomModeView = () => {
</div> </div>
{ {
isBuiltinMode ? ( isBuiltinMode ? (
<p className="infio-section-subtitle">Built-in mode names cannot be modified</p> <p className="infio-section-subtitle">{t('prompt.builtinModeNameWarning')}</p>
) : ( ) : (
<p className="infio-section-subtitle"> <p className="infio-section-subtitle">
Mode names must only contain letters, numbers, and hyphens {t('prompt.modeNameRequirements')}
</p> </p>
) )
} }
@ -241,7 +241,7 @@ const CustomModeView = () => {
setModeName(e.target.value) setModeName(e.target.value)
}} }}
className="infio-custom-modes-input" className="infio-custom-modes-input"
placeholder="Enter mode name..." placeholder={t('prompt.modeNamePlaceholder')}
disabled={isBuiltinMode} disabled={isBuiltinMode}
/> />
</div> </div>
@ -249,14 +249,14 @@ const CustomModeView = () => {
{/* Role definition */} {/* Role definition */}
<div className="infio-custom-modes-section"> <div className="infio-custom-modes-section">
<div className="infio-section-header"> <div className="infio-section-header">
<h3>Role Definition</h3> <h3>{t('prompt.roleDefinition')}</h3>
{isBuiltinMode && ( {isBuiltinMode && (
<button className="infio-section-btn"> <button className="infio-section-btn">
<Undo2 size={16} /> <Undo2 size={16} />
</button> </button>
)} )}
</div> </div>
<p className="infio-section-subtitle">Set professional domain and response style</p> <p className="infio-section-subtitle">{t('prompt.roleDefinitionDescription')}</p>
<textarea <textarea
className="infio-custom-textarea" className="infio-custom-textarea"
value={roleDefinition} value={roleDefinition}
@ -266,14 +266,14 @@ const CustomModeView = () => {
} }
setRoleDefinition(e.target.value) setRoleDefinition(e.target.value)
}} }}
placeholder="Enter role definition..." placeholder={t('prompt.roleDefinitionPlaceholder')}
/> />
</div> </div>
{/* Available features */} {/* Available features */}
<div className="infio-custom-modes-section"> <div className="infio-custom-modes-section">
<div className="infio-section-header"> <div className="infio-section-header">
<h3>Available Features</h3> <h3>{t('prompt.availableFeatures')}</h3>
{/* {!isBuiltinMode && ( {/* {!isBuiltinMode && (
<button className="infio-section-btn"> <button className="infio-section-btn">
<Undo2 size={16} /> <Undo2 size={16} />
@ -282,7 +282,7 @@ const CustomModeView = () => {
</div> </div>
{ {
isBuiltinMode && ( isBuiltinMode && (
<p className="infio-section-subtitle">Available features of built-in modes cannot be modified</p> <p className="infio-section-subtitle">{t('prompt.builtinFeaturesWarning')}</p>
) )
} }
<div className="infio-tools-list"> <div className="infio-tools-list">
@ -294,7 +294,7 @@ const CustomModeView = () => {
checked={selectedTools.includes('read')} checked={selectedTools.includes('read')}
onChange={() => handleToolChange('read')} onChange={() => handleToolChange('read')}
/> />
Read Files {t('prompt.readFiles')}
</label> </label>
</div> </div>
<div className="infio-tool-item"> <div className="infio-tool-item">
@ -305,7 +305,7 @@ const CustomModeView = () => {
checked={selectedTools.includes('edit')} checked={selectedTools.includes('edit')}
onChange={() => handleToolChange('edit')} onChange={() => handleToolChange('edit')}
/> />
Edit Files {t('prompt.editFiles')}
</label> </label>
</div> </div>
<div className="infio-tool-item"> <div className="infio-tool-item">
@ -316,7 +316,7 @@ const CustomModeView = () => {
checked={selectedTools.includes('research')} checked={selectedTools.includes('research')}
onChange={() => handleToolChange('research')} onChange={() => handleToolChange('research')}
/> />
Web Search {t('prompt.webSearch')}
</label> </label>
</div> </div>
</div> </div>
@ -325,14 +325,14 @@ const CustomModeView = () => {
{/* Mode-specific rules */} {/* Mode-specific rules */}
<div className="infio-custom-modes-section"> <div className="infio-custom-modes-section">
<div className="infio-section-header"> <div className="infio-section-header">
<h3>Mode-Specific Rules (Optional)</h3> <h3>{t('prompt.modeSpecificRules')}</h3>
{isBuiltinMode && ( {isBuiltinMode && (
<button className="infio-section-btn"> <button className="infio-section-btn">
<Undo2 size={16} /> <Undo2 size={16} />
</button> </button>
)} )}
</div> </div>
<p className="infio-section-subtitle">Mode-specific rules</p> <p className="infio-section-subtitle">{t('prompt.modeSpecificRulesDescription')}</p>
<textarea <textarea
className="infio-custom-textarea" className="infio-custom-textarea"
value={customInstructions} value={customInstructions}
@ -342,10 +342,10 @@ const CustomModeView = () => {
} }
setCustomInstructions(e.target.value) setCustomInstructions(e.target.value)
}} }}
placeholder="Enter mode custom instructions..." placeholder={t('prompt.modeSpecificRulesPlaceholder')}
/> />
<p className="infio-section-footer"> <p className="infio-section-footer">
Support reading configuration from<a href="#" className="infio-link" onClick={() => openOrCreateMarkdownFile(app, `_infio_prompts/${modeName}/rules.md`, 0)}>_infio_prompts/{modeName}/rules</a> file {t('prompt.supportReadingConfig')}<a href="#" className="infio-link" onClick={() => openOrCreateMarkdownFile(app, `_infio_prompts/${modeName}/rules.md`, 0)}>_infio_prompts/{modeName}/rules</a> {t('prompt.file')}
</p> </p>
</div> </div>
@ -357,15 +357,15 @@ const CustomModeView = () => {
> >
<div className="infio-section-header-title-container"> <div className="infio-section-header-title-container">
{isAdvancedCollapsed ? <ChevronRight size={16} /> : <ChevronDown size={16} />} {isAdvancedCollapsed ? <ChevronRight size={16} /> : <ChevronDown size={16} />}
<h6 className="infio-section-header-title">Override System Prompt</h6> <h6 className="infio-section-header-title">{t('prompt.overrideSystemPrompt')}</h6>
</div> </div>
</div> </div>
{!isAdvancedCollapsed && ( {!isAdvancedCollapsed && (
<> <>
<p className="infio-section-subtitle"> <p className="infio-section-subtitle">
You can completely replace the system prompt for this mode (excluding role definition and custom instructions) by creating a file {t('prompt.overrideDescription')}
<a href="#" className="infio-link" onClick={() => openOrCreateMarkdownFile(app, `_infio_prompts/${modeName}/system_prompt.md`, 0)}>_infio_prompts/{modeName}/system_prompt</a> <a href="#" className="infio-link" onClick={() => openOrCreateMarkdownFile(app, `_infio_prompts/${modeName}/system_prompt.md`, 0)}>_infio_prompts/{modeName}/system_prompt</a>
. This is a very advanced feature that will override all built-in prompts including tool usage, please use with caution <button {t('prompt.overrideWarning')} <button
className="infio-preview-btn" className="infio-preview-btn"
onClick={async () => { onClick={async () => {
let filesSearchMethod = settings.filesSearchMethod let filesSearchMethod = settings.filesSearchMethod
@ -396,7 +396,7 @@ const CustomModeView = () => {
} }
} }
> >
Preview System Prompt {t('prompt.previewSystemPrompt')}
</button> </button>
</p></> </p></>
)} )}
@ -414,7 +414,7 @@ const CustomModeView = () => {
} }
}} }}
> >
Save {t('prompt.save')}
</button> </button>
</div> </div>

View File

@ -1,6 +1,3 @@
// import { APPNAME, MINEXCALIDRAWVERSION } from "src/constants/constants";
//Magyar
export default { export default {
prompt: { prompt: {
"title": "Prompts", "title": "Prompts",
@ -8,5 +5,25 @@ export default {
"modeName": "Mode Name", "modeName": "Mode Name",
"modeNameDescription": "Mode Description", "modeNameDescription": "Mode Description",
"modeNamePlaceholder": "Enter mode name...", "modeNamePlaceholder": "Enter mode name...",
"builtinModeNameWarning": "Built-in mode names cannot be modified",
"modeNameRequirements": "Mode names must only contain letters, numbers, and hyphens",
"roleDefinition": "Role Definition",
"roleDefinitionDescription": "Set professional domain and response style",
"roleDefinitionPlaceholder": "Enter role definition...",
"availableFeatures": "Available Features",
"builtinFeaturesWarning": "Available features of built-in modes cannot be modified",
"readFiles": "Read Files",
"editFiles": "Edit Files",
"webSearch": "Web Search",
"modeSpecificRules": "Mode-Specific Rules (Optional)",
"modeSpecificRulesDescription": "Mode-specific rules",
"modeSpecificRulesPlaceholder": "Enter mode custom instructions...",
"supportReadingConfig": "Support reading configuration from",
"file": "file",
"overrideSystemPrompt": "Override System Prompt",
"overrideDescription": "You can completely replace the system prompt for this mode (excluding role definition and custom instructions) by creating a file",
"overrideWarning": ". This is a very advanced feature that will override all built-in prompts including tool usage, please use with caution",
"previewSystemPrompt": "Preview System Prompt",
"save": "Save"
} }
} }

View File

@ -4,5 +4,29 @@
export default { export default {
prompt: { prompt: {
"title": "模型提示词设置", "title": "模型提示词设置",
"description": "点击 + 创建新模式",
"modeName": "模式名称",
"modeNameDescription": "模式描述",
"modeNamePlaceholder": "请输入模式名称...",
"builtinModeNameWarning": "内置模式名称无法修改",
"modeNameRequirements": "模式名称只能包含字母、数字和连字符",
"roleDefinition": "角色定义",
"roleDefinitionDescription": "设置专业领域和回复风格",
"roleDefinitionPlaceholder": "请输入角色定义...",
"availableFeatures": "可用功能",
"builtinFeaturesWarning": "内置模式的可用功能不能修改",
"readFiles": "读取文件",
"editFiles": "编辑文件",
"webSearch": "网络搜索",
"modeSpecificRules": "模式特定规则(可选)",
"modeSpecificRulesDescription": "模式特定规则",
"modeSpecificRulesPlaceholder": "请输入模式自定义指令...",
"supportReadingConfig": "支持从以下位置读取配置",
"file": "文件",
"overrideSystemPrompt": "覆盖系统提示",
"overrideDescription": "您可以通过创建文件来完全替换此模式的系统提示(不包括角色定义和自定义指令)",
"overrideWarning": "。这是一个非常高级的功能,将覆盖所有内置提示,包括工具使用,请谨慎使用",
"previewSystemPrompt": "预览系统提示",
"save": "保存"
} }
}; };