mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
feat: add 'invalid_model' translation key across multiple languages
- Introduced a new translation key 'invalid_model' in English, Japanese, Russian, Chinese (Simplified and Traditional), Greek, Spanish, French, and Portuguese. - Updated the SelectModelButton component to display an error tag when no valid provider is found, enhancing user feedback.
This commit is contained in:
parent
76ac1bd8f7
commit
fdee510c8c
@ -56,6 +56,7 @@ const MermaidPreview = ({
|
|||||||
document.body.removeChild(measureEl)
|
document.body.removeChild(measureEl)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
[diagramId, mermaid, forceRenderKey]
|
[diagramId, mermaid, forceRenderKey]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -1552,6 +1552,7 @@
|
|||||||
"selected": "Selected tags"
|
"selected": "Selected tags"
|
||||||
},
|
},
|
||||||
"function_calling": "Function Calling",
|
"function_calling": "Function Calling",
|
||||||
|
"invalid_model": "Invalid Model",
|
||||||
"no_matches": "No models available",
|
"no_matches": "No models available",
|
||||||
"parameter_name": "Parameter Name",
|
"parameter_name": "Parameter Name",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1552,6 +1552,7 @@
|
|||||||
"selected": "選択済みのタグ"
|
"selected": "選択済みのタグ"
|
||||||
},
|
},
|
||||||
"function_calling": "関数呼び出し",
|
"function_calling": "関数呼び出し",
|
||||||
|
"invalid_model": "無効なモデル",
|
||||||
"no_matches": "利用可能なモデルがありません",
|
"no_matches": "利用可能なモデルがありません",
|
||||||
"parameter_name": "パラメータ名",
|
"parameter_name": "パラメータ名",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1552,6 +1552,7 @@
|
|||||||
"selected": "Выбранные теги"
|
"selected": "Выбранные теги"
|
||||||
},
|
},
|
||||||
"function_calling": "Вызов функции",
|
"function_calling": "Вызов функции",
|
||||||
|
"invalid_model": "Недействительная модель",
|
||||||
"no_matches": "Нет доступных моделей",
|
"no_matches": "Нет доступных моделей",
|
||||||
"parameter_name": "Имя параметра",
|
"parameter_name": "Имя параметра",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1552,6 +1552,7 @@
|
|||||||
"selected": "已选标签"
|
"selected": "已选标签"
|
||||||
},
|
},
|
||||||
"function_calling": "函数调用",
|
"function_calling": "函数调用",
|
||||||
|
"invalid_model": "无效模型",
|
||||||
"no_matches": "无可用模型",
|
"no_matches": "无可用模型",
|
||||||
"parameter_name": "参数名称",
|
"parameter_name": "参数名称",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1552,6 +1552,7 @@
|
|||||||
"selected": "已選標籤"
|
"selected": "已選標籤"
|
||||||
},
|
},
|
||||||
"function_calling": "函數調用",
|
"function_calling": "函數調用",
|
||||||
|
"invalid_model": "無效模型",
|
||||||
"no_matches": "無可用模型",
|
"no_matches": "無可用模型",
|
||||||
"parameter_name": "參數名稱",
|
"parameter_name": "參數名稱",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1550,6 +1550,7 @@
|
|||||||
"selected": "Επιλεγμένη ετικέτα"
|
"selected": "Επιλεγμένη ετικέτα"
|
||||||
},
|
},
|
||||||
"function_calling": "Ξεχωριστική Κλήση Συναρτήσεων",
|
"function_calling": "Ξεχωριστική Κλήση Συναρτήσεων",
|
||||||
|
"invalid_model": "Μη έγκυρο μοντέλο",
|
||||||
"no_matches": "Δεν υπάρχουν διαθέσιμα μοντέλα",
|
"no_matches": "Δεν υπάρχουν διαθέσιμα μοντέλα",
|
||||||
"parameter_name": "Όνομα παραμέτρου",
|
"parameter_name": "Όνομα παραμέτρου",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1550,6 +1550,7 @@
|
|||||||
"selected": "Etiquetas seleccionadas"
|
"selected": "Etiquetas seleccionadas"
|
||||||
},
|
},
|
||||||
"function_calling": "Llamada a función",
|
"function_calling": "Llamada a función",
|
||||||
|
"invalid_model": "Modelo inválido",
|
||||||
"no_matches": "No hay modelos disponibles",
|
"no_matches": "No hay modelos disponibles",
|
||||||
"parameter_name": "Nombre del parámetro",
|
"parameter_name": "Nombre del parámetro",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1550,6 +1550,7 @@
|
|||||||
"selected": "Étiquette sélectionnée"
|
"selected": "Étiquette sélectionnée"
|
||||||
},
|
},
|
||||||
"function_calling": "Appel de fonction",
|
"function_calling": "Appel de fonction",
|
||||||
|
"invalid_model": "Modèle invalide",
|
||||||
"no_matches": "Aucun modèle disponible",
|
"no_matches": "Aucun modèle disponible",
|
||||||
"parameter_name": "Nom du paramètre",
|
"parameter_name": "Nom du paramètre",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -1550,6 +1550,7 @@
|
|||||||
"selected": "Etiqueta selecionada"
|
"selected": "Etiqueta selecionada"
|
||||||
},
|
},
|
||||||
"function_calling": "Chamada de função",
|
"function_calling": "Chamada de função",
|
||||||
|
"invalid_model": "Modelo inválido",
|
||||||
"no_matches": "Nenhum modelo disponível",
|
"no_matches": "Nenhum modelo disponível",
|
||||||
"parameter_name": "Nome do parâmetro",
|
"parameter_name": "Nome do parâmetro",
|
||||||
"parameter_type": {
|
"parameter_type": {
|
||||||
|
|||||||
@ -4,8 +4,9 @@ import { isLocalAi } from '@renderer/config/env'
|
|||||||
import { isEmbeddingModel, isRerankModel, isWebSearchModel } from '@renderer/config/models'
|
import { isEmbeddingModel, isRerankModel, isWebSearchModel } from '@renderer/config/models'
|
||||||
import { useAssistant } from '@renderer/hooks/useAssistant'
|
import { useAssistant } from '@renderer/hooks/useAssistant'
|
||||||
import { getProviderName } from '@renderer/services/ProviderService'
|
import { getProviderName } from '@renderer/services/ProviderService'
|
||||||
|
import { useAppSelector } from '@renderer/store'
|
||||||
import { Assistant, Model } from '@renderer/types'
|
import { Assistant, Model } from '@renderer/types'
|
||||||
import { Button } from 'antd'
|
import { Button, Tag } from 'antd'
|
||||||
import { ChevronsUpDown } from 'lucide-react'
|
import { ChevronsUpDown } from 'lucide-react'
|
||||||
import { FC, useEffect, useRef } from 'react'
|
import { FC, useEffect, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@ -19,6 +20,7 @@ const SelectModelButton: FC<Props> = ({ assistant }) => {
|
|||||||
const { model, updateAssistant } = useAssistant(assistant.id)
|
const { model, updateAssistant } = useAssistant(assistant.id)
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const timerRef = useRef<NodeJS.Timeout>(undefined)
|
const timerRef = useRef<NodeJS.Timeout>(undefined)
|
||||||
|
const provider = useAppSelector((state) => state.llm.providers.find((p) => p.id === model?.provider))
|
||||||
|
|
||||||
const modelFilter = (model: Model) => !isEmbeddingModel(model) && !isRerankModel(model)
|
const modelFilter = (model: Model) => !isEmbeddingModel(model) && !isRerankModel(model)
|
||||||
|
|
||||||
@ -60,6 +62,7 @@ const SelectModelButton: FC<Props> = ({ assistant }) => {
|
|||||||
</ModelName>
|
</ModelName>
|
||||||
</ButtonContent>
|
</ButtonContent>
|
||||||
<ChevronsUpDown size={14} color="var(--color-icon)" />
|
<ChevronsUpDown size={14} color="var(--color-icon)" />
|
||||||
|
{!provider && <Tag color="error">{t('models.invalid_model')}</Tag>}
|
||||||
</DropdownButton>
|
</DropdownButton>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user