mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? fix: Optimize internationalization configuration - Update multi-language options, adding general translations for functions like Select All and Clear - Add internationalization support for modules like Chat, Search, and Datasets ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -114,7 +114,7 @@ export default function Agent() {
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink onClick={navigateToAgents}>
|
||||
Agent
|
||||
{t('header.flow')}
|
||||
</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator />
|
||||
|
||||
@ -36,7 +36,7 @@ export default function Agents() {
|
||||
<section className="flex flex-col w-full flex-1">
|
||||
<div className="px-8 pt-8 ">
|
||||
<ListFilterBar
|
||||
title="Agents"
|
||||
title={t('flow.agents')}
|
||||
searchString={searchString}
|
||||
onSearchChange={handleInputChange}
|
||||
icon="agent"
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { t } from 'i18next';
|
||||
import { lowerFirst } from 'lodash';
|
||||
import {
|
||||
Box,
|
||||
ChartPie,
|
||||
@ -23,26 +25,38 @@ const menuItems = [
|
||||
items: [
|
||||
{
|
||||
icon: Sparkle,
|
||||
label: MenuItemKey.Recommended,
|
||||
label: t('flow.' + lowerFirst(MenuItemKey.Recommended)),
|
||||
key: MenuItemKey.Recommended,
|
||||
},
|
||||
{ icon: Box, label: MenuItemKey.Agent, key: MenuItemKey.Agent },
|
||||
{
|
||||
icon: Box,
|
||||
label: t('flow.' + lowerFirst(MenuItemKey.Agent)),
|
||||
key: MenuItemKey.Agent,
|
||||
},
|
||||
{
|
||||
icon: MessageCircleCode,
|
||||
label: MenuItemKey.CustomerSupport,
|
||||
label: t(
|
||||
'flow.' + lowerFirst(MenuItemKey.CustomerSupport).replace(' ', ''),
|
||||
),
|
||||
key: MenuItemKey.CustomerSupport,
|
||||
},
|
||||
{
|
||||
icon: ChartPie,
|
||||
label: MenuItemKey.Marketing,
|
||||
label: t('flow.' + lowerFirst(MenuItemKey.Marketing)),
|
||||
key: MenuItemKey.Marketing,
|
||||
},
|
||||
{
|
||||
icon: Component,
|
||||
label: MenuItemKey.ConsumerApp,
|
||||
label: t(
|
||||
'flow.' + lowerFirst(MenuItemKey.ConsumerApp.replace(' ', '')),
|
||||
),
|
||||
key: MenuItemKey.ConsumerApp,
|
||||
},
|
||||
{ icon: PencilRuler, label: MenuItemKey.Other, key: MenuItemKey.Other },
|
||||
{
|
||||
icon: PencilRuler,
|
||||
label: t('flow.' + lowerFirst(MenuItemKey.Other)),
|
||||
key: MenuItemKey.Other,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@ -140,11 +140,11 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="flex justify-start items-start">
|
||||
<div className="flex items-center gap-0">
|
||||
<div className="flex items-center gap-1">
|
||||
<span>{t('chunk.question')}</span>
|
||||
<HoverCard>
|
||||
<HoverCardTrigger asChild>
|
||||
<span className="text-xs mt-[-3px] text-center scale-[90%] font-thin text-primary cursor-pointer rounded-full w-[16px] h-[16px] border-muted-foreground/50 border">
|
||||
<span className="text-xs mt-[0px] text-center scale-[90%] text-text-secondary cursor-pointer rounded-full w-[17px] h-[17px] border-text-secondary border-2">
|
||||
?
|
||||
</span>
|
||||
</HoverCardTrigger>
|
||||
|
||||
@ -95,7 +95,10 @@ export default ({
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
<div className="w-[20px]"></div>
|
||||
<Button onClick={() => createChunk()} className="bg-bg-card text-primary">
|
||||
<Button
|
||||
onClick={() => createChunk()}
|
||||
className="bg-bg-card text-primary hover:bg-card"
|
||||
>
|
||||
<Plus size={44} />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@ -28,6 +28,7 @@ export function ChunkMethodItem() {
|
||||
<FormItem className=" items-center space-y-0 ">
|
||||
<div className="flex items-center">
|
||||
<FormLabel
|
||||
required
|
||||
tooltip={t('chunkMethodTip')}
|
||||
className="text-sm text-muted-foreground whitespace-wrap w-1/4"
|
||||
>
|
||||
@ -68,6 +69,7 @@ export function EmbeddingModelItem() {
|
||||
<FormItem className=" items-center space-y-0 ">
|
||||
<div className="flex items-center">
|
||||
<FormLabel
|
||||
required
|
||||
tooltip={t('embeddingModelTip')}
|
||||
className="text-sm text-muted-foreground whitespace-wrap w-1/4"
|
||||
>
|
||||
|
||||
@ -16,4 +16,5 @@ export const ImageMap = {
|
||||
table: getImageName('table', 2),
|
||||
one: getImageName('one', 2),
|
||||
knowledge_graph: getImageName('knowledge-graph', 2),
|
||||
tag: getImageName('tag', 2),
|
||||
};
|
||||
|
||||
@ -83,7 +83,7 @@ export default function TestingForm({
|
||||
<FormContainer className="p-10">
|
||||
<SimilaritySliderFormField
|
||||
vectorSimilarityWeightName="keywords_similarity_weight"
|
||||
isTooltipShown
|
||||
isTooltipShown={true}
|
||||
></SimilaritySliderFormField>
|
||||
<RerankFormFields></RerankFormFields>
|
||||
<UseKnowledgeGraphFormField name="use_kg"></UseKnowledgeGraphFormField>
|
||||
|
||||
@ -4,6 +4,7 @@ import { SharedBadge } from '@/components/shared-badge';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
||||
import { IKnowledge } from '@/interfaces/database/knowledge';
|
||||
import { t } from 'i18next';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { DatasetDropdown } from './dataset-dropdown';
|
||||
import { useRenameDataset } from './use-rename-dataset';
|
||||
@ -20,7 +21,10 @@ export function DatasetCard({
|
||||
|
||||
return (
|
||||
<HomeCard
|
||||
data={{ ...dataset, description: `${dataset.doc_num} files` }}
|
||||
data={{
|
||||
...dataset,
|
||||
description: `${dataset.doc_num} ${t('knowledgeDetails.files')}`,
|
||||
}}
|
||||
moreDropdown={
|
||||
<DatasetDropdown
|
||||
showDatasetRenameModal={showDatasetRenameModal}
|
||||
|
||||
@ -55,7 +55,7 @@ export default function Datasets() {
|
||||
return (
|
||||
<section className="py-4 flex-1 flex flex-col">
|
||||
<ListFilterBar
|
||||
title={t('header.knowledgeBase')}
|
||||
title={t('header.dataset')}
|
||||
searchString={searchString}
|
||||
onSearchChange={handleInputChange}
|
||||
value={filterValue}
|
||||
|
||||
@ -78,7 +78,11 @@ export default function Files() {
|
||||
|
||||
const leftPanel = (
|
||||
<div>
|
||||
{breadcrumbItems.length > 0 ? <FileBreadcrumb></FileBreadcrumb> : 'File'}
|
||||
{breadcrumbItems.length > 0 ? (
|
||||
<FileBreadcrumb></FileBreadcrumb>
|
||||
) : (
|
||||
t('fileManager.files')
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@ export function Applications() {
|
||||
|
||||
const options = useMemo(
|
||||
() => [
|
||||
{ value: Routes.Chats, label: t('header.chat') },
|
||||
{ value: Routes.Searches, label: t('header.search') },
|
||||
{ value: Routes.Chats, label: t('chat.chatApps') },
|
||||
{ value: Routes.Searches, label: t('search.searchApps') },
|
||||
{ value: Routes.Agents, label: t('header.flow') },
|
||||
],
|
||||
[t],
|
||||
|
||||
@ -22,7 +22,7 @@ export function Datasets() {
|
||||
<section>
|
||||
<h2 className="text-2xl font-bold mb-6 flex gap-2.5 items-center">
|
||||
<IconFont name="data" className="size-8"></IconFont>
|
||||
{t('header.knowledgeBase')}
|
||||
{t('header.dataset')}
|
||||
</h2>
|
||||
<div className="flex gap-6">
|
||||
{loading ? (
|
||||
|
||||
@ -43,7 +43,7 @@ export default function ChatBasicSetting() {
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('assistantName')}</FormLabel>
|
||||
<FormLabel required>{t('assistantName')}</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field}></Input>
|
||||
</FormControl>
|
||||
@ -69,7 +69,9 @@ export default function ChatBasicSetting() {
|
||||
name={'prompt_config.empty_response'}
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('emptyResponse')}</FormLabel>
|
||||
<FormLabel tooltip={t('emptyResponseTip')}>
|
||||
{t('emptyResponse')}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea {...field}></Textarea>
|
||||
</FormControl>
|
||||
@ -82,7 +84,9 @@ export default function ChatBasicSetting() {
|
||||
name={'prompt_config.prologue'}
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>{t('setAnOpener')}</FormLabel>
|
||||
<FormLabel tooltip={t('setAnOpenerTip')}>
|
||||
{t('setAnOpener')}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea {...field}></Textarea>
|
||||
</FormControl>
|
||||
@ -93,14 +97,17 @@ export default function ChatBasicSetting() {
|
||||
<SwitchFormField
|
||||
name={'prompt_config.quote'}
|
||||
label={t('quote')}
|
||||
tooltip={t('quoteTip')}
|
||||
></SwitchFormField>
|
||||
<SwitchFormField
|
||||
name={'prompt_config.keyword'}
|
||||
label={t('keyword')}
|
||||
tooltip={t('keywordTip')}
|
||||
></SwitchFormField>
|
||||
<SwitchFormField
|
||||
name={'prompt_config.tts'}
|
||||
label={t('tts')}
|
||||
tooltip={t('ttsTip')}
|
||||
></SwitchFormField>
|
||||
<TavilyFormField></TavilyFormField>
|
||||
<KnowledgeBaseFormField></KnowledgeBaseFormField>
|
||||
|
||||
@ -37,11 +37,12 @@ export function ChatPromptEngine() {
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<SimilaritySliderFormField></SimilaritySliderFormField>
|
||||
<SimilaritySliderFormField isTooltipShown></SimilaritySliderFormField>
|
||||
<TopNFormField></TopNFormField>
|
||||
<SwitchFormField
|
||||
name={'prompt_config.refine_multiturn'}
|
||||
label={t('multiTurn')}
|
||||
tooltip={t('multiTurnTip')}
|
||||
></SwitchFormField>
|
||||
<UseKnowledgeGraphFormField name="prompt_config.use_kg"></UseKnowledgeGraphFormField>
|
||||
<SwitchFormField
|
||||
|
||||
@ -23,6 +23,7 @@ import {
|
||||
import { useFetchUserInfo } from '@/hooks/user-setting-hooks';
|
||||
import { buildMessageUuidWithRole } from '@/utils/chat';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { t } from 'i18next';
|
||||
import { isEmpty, omit } from 'lodash';
|
||||
import { ListCheck, Plus, Trash2 } from 'lucide-react';
|
||||
import { forwardRef, useCallback, useImperativeHandle, useRef } from 'react';
|
||||
@ -139,7 +140,7 @@ const ChatCard = forwardRef(function ChatCard(
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Apply model configs</p>
|
||||
<p>{t('chat.applyModelConfigs')}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
{!isLatestChat || chatBoxIds.length === 3 ? (
|
||||
|
||||
@ -63,10 +63,10 @@ export default function Chat() {
|
||||
<section className="pt-14 h-[100vh] pb-24">
|
||||
<div className="flex items-center justify-between px-10 pb-5">
|
||||
<span className="text-2xl">
|
||||
Multiple Models ({chatBoxIds.length}/3)
|
||||
{t('chat.multipleModels')} ({chatBoxIds.length}/3)
|
||||
</span>
|
||||
<Button variant={'ghost'} onClick={switchDebugMode}>
|
||||
Exit <LogOut />
|
||||
{t('chat.exit')} <LogOut />
|
||||
</Button>
|
||||
</div>
|
||||
<MultipleChatBox
|
||||
@ -124,7 +124,7 @@ export default function Chat() {
|
||||
isNew === 'true'
|
||||
}
|
||||
>
|
||||
<ArrowUpRight /> Multiple Models
|
||||
<ArrowUpRight /> {t('chat.multipleModels')}
|
||||
</Button>
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
|
||||
@ -71,7 +71,7 @@ export function Sessions({
|
||||
</section>
|
||||
<div className="flex justify-between items-center mb-4 pt-10">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-base font-bold">Conversations</span>
|
||||
<span className="text-base font-bold">{t('chat.conversations')}</span>
|
||||
<span className="text-text-secondary text-xs">
|
||||
{conversationList.length}
|
||||
</span>
|
||||
|
||||
@ -38,7 +38,7 @@ export default function ChatList() {
|
||||
<section className="flex flex-col w-full flex-1">
|
||||
<div className="px-8 pt-8">
|
||||
<ListFilterBar
|
||||
title="Chat apps"
|
||||
title={t('chat.chatApps')}
|
||||
icon="chat"
|
||||
onSearchChange={handleInputChange}
|
||||
searchString={searchString}
|
||||
|
||||
@ -62,7 +62,7 @@ export default function SearchPage() {
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink onClick={navigateToSearchList}>
|
||||
Search
|
||||
{t('header.search')}
|
||||
</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator />
|
||||
|
||||
@ -397,7 +397,11 @@ const SearchSetting: React.FC<SearchSettingProps> = ({
|
||||
name="search_config.similarity_threshold"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Similarity Threshold</FormLabel>
|
||||
<FormLabel
|
||||
tooltip={t('knowledgeDetails.similarityThresholdTip')}
|
||||
>
|
||||
{t('knowledgeDetails.similarityThreshold')}
|
||||
</FormLabel>
|
||||
<div
|
||||
className={cn(
|
||||
'flex items-center gap-4 justify-between',
|
||||
@ -433,9 +437,11 @@ const SearchSetting: React.FC<SearchSettingProps> = ({
|
||||
name="search_config.vector_similarity_weight"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
<span className="text-destructive mr-1"> *</span>Vector
|
||||
Similarity Weight
|
||||
<FormLabel
|
||||
tooltip={t('knowledgeDetails.vectorSimilarityWeightTip')}
|
||||
>
|
||||
<span className="text-destructive mr-1"> *</span>
|
||||
{t('knowledgeDetails.vectorSimilarityWeight')}
|
||||
</FormLabel>
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
@ -239,7 +239,7 @@ export default function SearchingView({
|
||||
searchData.search_config.related_search && (
|
||||
<div className="mt-14 w-full overflow-hidden opacity-100 max-h-96">
|
||||
<p className="text-text-primary mb-2 text-xl">
|
||||
{t('relatedSearch')}
|
||||
{t('search.relatedSearch')}
|
||||
</p>
|
||||
<div className="mt-2 flex flex-wrap justify-start gap-2">
|
||||
{relatedQuestions?.map((x, idx) => (
|
||||
|
||||
@ -49,7 +49,7 @@ export default function SearchList() {
|
||||
<div className="px-8 pt-8">
|
||||
<ListFilterBar
|
||||
icon="search"
|
||||
title="Search apps"
|
||||
title={t('searchApps')}
|
||||
showFilter={false}
|
||||
onSearchChange={(e) => handleSearchChange(e.target.value)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user