mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-06 03:18:36 +08:00
Fix: Fixed an issue where agent template titles were not displayed in Chinese mode. (#13647)
### What problem does this PR solve? Fix: Fixed an issue where agent template titles were not displayed in Chinese mode. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -42,7 +42,7 @@ export default function AgentTemplates() {
|
||||
|
||||
const handleOk = useCallback(
|
||||
async (payload: any) => {
|
||||
let dsl = template?.dsl;
|
||||
const dsl = template?.dsl;
|
||||
const canvasCategory = template?.canvas_category;
|
||||
|
||||
const ret = await setAgent({
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { RAGFlowAvatar } from '@/components/ragflow-avatar';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { LanguageAbbreviation } from '@/constants/common';
|
||||
import { IFlowTemplate } from '@/interfaces/database/agent';
|
||||
import i18n from '@/locales/config';
|
||||
import { useCallback, useMemo } from 'react';
|
||||
@@ -19,6 +20,9 @@ export function TemplateCard({ data, showModal }: IProps) {
|
||||
}, [data, showModal]);
|
||||
|
||||
const language = useMemo(() => {
|
||||
if (i18n.language === LanguageAbbreviation.Zh) {
|
||||
return 'zh';
|
||||
}
|
||||
return i18n.language || 'en';
|
||||
}, []) as 'en' | 'zh' | 'de';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user