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:
balibabu
2026-03-17 15:56:57 +08:00
committed by GitHub
parent 77483b1e58
commit 549833b8a4
2 changed files with 5 additions and 1 deletions

View File

@@ -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({

View File

@@ -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';