update model settings multi lang.
This commit is contained in:
@@ -56,7 +56,7 @@ const localeMap: { [k: string]: Partial<typeof en> } = {
|
||||
|
||||
const locale = localeMap[moment.locale()];
|
||||
|
||||
export function t(str: string): any {
|
||||
export function t(str: string, params?: Record<string, any>): any {
|
||||
if (!locale) {
|
||||
console.error({
|
||||
plugin: "infio-copilot",
|
||||
@@ -75,5 +75,12 @@ export function t(str: string): any {
|
||||
if (result === undefined) return str;
|
||||
}
|
||||
|
||||
// Handle parameter interpolation
|
||||
if (params && typeof result === 'string') {
|
||||
return result.replace(/\{([^}]+)\}/g, (match, key) => {
|
||||
return params[key] !== undefined ? String(params[key]) : match;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -216,8 +216,29 @@ export default {
|
||||
},
|
||||
Models: {
|
||||
chatModel: 'Chat model:',
|
||||
chatModelDescription: 'Model used for daily conversations and Q&A, handling most chat interactions',
|
||||
autocompleteModel: 'Autocomplete model:',
|
||||
autocompleteModelDescription: 'Model used for code and text autocompletion, providing intelligent writing suggestions',
|
||||
embeddingModel: 'Embedding model:',
|
||||
embeddingModelDescription: 'Model used for document vectorization and semantic search, supporting RAG functionality',
|
||||
},
|
||||
|
||||
// Model Provider Settings
|
||||
ModelProvider: {
|
||||
noApiKeySet: 'No API key has been set',
|
||||
setApiKey: 'Set {provider} API Key',
|
||||
modelSelection: 'Model Selection',
|
||||
oneClickConfig: 'One-Click Config',
|
||||
oneClickConfigTooltip: 'Automatically configure models to recommended models from providers with API keys set',
|
||||
chatModelConfigured: 'Chat model configured automatically: {provider}/{model}',
|
||||
autocompleteModelConfigured: 'Autocomplete model configured automatically: {provider}/{model}',
|
||||
embeddingModelConfigured: 'Embedding model configured automatically: {provider}/{model}',
|
||||
provider: 'Provider',
|
||||
model: 'Model',
|
||||
selectModel: 'Select model...',
|
||||
searchOrEnterModelName: 'Search or enter model name...',
|
||||
enterCustomModelName: 'Enter custom model name',
|
||||
custom: 'Custom: ',
|
||||
},
|
||||
|
||||
// Model Parameters Section
|
||||
|
||||
@@ -224,6 +224,24 @@ export default {
|
||||
embeddingModelDescription: '用于文档向量化和语义搜索的模型,支持 RAG 功能',
|
||||
},
|
||||
|
||||
// 模型提供商设置
|
||||
ModelProvider: {
|
||||
noApiKeySet: '当前未设置任何 API Key',
|
||||
setApiKey: '设置 {provider} API Key',
|
||||
modelSelection: '模型选择',
|
||||
oneClickConfig: '一键配置',
|
||||
oneClickConfigTooltip: '自动配置模型为已设置 API Key 的提供商的推荐模型',
|
||||
chatModelConfigured: '已自动配置聊天模型:{provider}/{model}',
|
||||
autocompleteModelConfigured: '已自动配置自动补全模型:{provider}/{model}',
|
||||
embeddingModelConfigured: '已自动配置嵌入模型:{provider}/{model}',
|
||||
provider: '提供商',
|
||||
model: '模型',
|
||||
selectModel: '选择模型...',
|
||||
searchOrEnterModelName: '搜索或输入模型名称...',
|
||||
enterCustomModelName: '输入自定义模型名称',
|
||||
custom: '自定义: ',
|
||||
},
|
||||
|
||||
// 模型参数部分
|
||||
ModelParameters: {
|
||||
title: '模型参数',
|
||||
|
||||
Reference in New Issue
Block a user