Commit 02d37d21 authored by 金伟强's avatar 金伟强

chore: translate

parent 71f96123
...@@ -4,6 +4,7 @@ import React from 'react' ...@@ -4,6 +4,7 @@ import React from 'react'
import cn from 'classnames' import cn from 'classnames'
import { useBoolean, useClickAway } from 'ahooks' import { useBoolean, useClickAway } from 'ahooks'
import { ChevronDownIcon } from '@heroicons/react/24/outline' import { ChevronDownIcon } from '@heroicons/react/24/outline'
import { useTranslation } from 'react-i18next'
import ModelIcon from '@/app/components/app/configuration/config-model/model-icon' import ModelIcon from '@/app/components/app/configuration/config-model/model-icon'
import { UNIVERSAL_CHAT_MODEL_LIST as MODEL_LIST } from '@/config' import { UNIVERSAL_CHAT_MODEL_LIST as MODEL_LIST } from '@/config'
...@@ -18,6 +19,8 @@ const ModelConfig: FC<IModelConfigProps> = ({ ...@@ -18,6 +19,8 @@ const ModelConfig: FC<IModelConfigProps> = ({
onChange, onChange,
readonly, readonly,
}) => { }) => {
const { t } = useTranslation()
const currModel = MODEL_LIST.find(item => item.id === modelId) const currModel = MODEL_LIST.find(item => item.id === modelId)
const [isShowOption, { setFalse: hideOption, toggle: toogleOption }] = useBoolean(false) const [isShowOption, { setFalse: hideOption, toggle: toogleOption }] = useBoolean(false)
const triggerRef = React.useRef(null) const triggerRef = React.useRef(null)
...@@ -27,7 +30,7 @@ const ModelConfig: FC<IModelConfigProps> = ({ ...@@ -27,7 +30,7 @@ const ModelConfig: FC<IModelConfigProps> = ({
return ( return (
<div className='flex items-center justify-between h-[52px] px-3 rounded-xl bg-gray-50'> <div className='flex items-center justify-between h-[52px] px-3 rounded-xl bg-gray-50'>
<div className='text-sm font-semibold text-gray-800'>Model</div> <div className='text-sm font-semibold text-gray-800'>{t('explore.universalChat.model')}</div>
<div className="relative z-10"> <div className="relative z-10">
<div ref={triggerRef} onClick={() => !readonly && toogleOption()} className={cn(readonly ? 'cursor-not-allowed' : 'cursor-pointer', 'flex items-center h-9 px-3 space-x-2 rounded-lg bg-gray-50 ')}> <div ref={triggerRef} onClick={() => !readonly && toogleOption()} className={cn(readonly ? 'cursor-not-allowed' : 'cursor-pointer', 'flex items-center h-9 px-3 space-x-2 rounded-lg bg-gray-50 ')}>
<ModelIcon modelId={currModel?.id as string} /> <ModelIcon modelId={currModel?.id as string} />
......
...@@ -38,6 +38,7 @@ const translation = { ...@@ -38,6 +38,7 @@ const translation = {
universalChat: { universalChat: {
welcome: 'Start chat with Dify', welcome: 'Start chat with Dify',
welcomeDescribe: 'Your AI conversation companion for personalized assistance', welcomeDescribe: 'Your AI conversation companion for personalized assistance',
model: 'Model',
plugins: { plugins: {
name: 'Plugins', name: 'Plugins',
google_search: { google_search: {
......
...@@ -2,7 +2,7 @@ const translation = { ...@@ -2,7 +2,7 @@ const translation = {
title: '我的应用', title: '我的应用',
sidebar: { sidebar: {
discovery: '发现', discovery: '发现',
chat: '聊天', chat: '智聊',
workspace: '工作区', workspace: '工作区',
action: { action: {
pin: '置顶', pin: '置顶',
...@@ -38,7 +38,9 @@ const translation = { ...@@ -38,7 +38,9 @@ const translation = {
universalChat: { universalChat: {
welcome: '开始和 Dify 聊天吧', welcome: '开始和 Dify 聊天吧',
welcomeDescribe: '您的 AI 对话伴侣,为您提供个性化的帮助', welcomeDescribe: '您的 AI 对话伴侣,为您提供个性化的帮助',
model: '模型',
plugins: { plugins: {
name: '插件',
google_search: { google_search: {
name: '谷歌搜索', name: '谷歌搜索',
more: { more: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment