mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-13 20:26:51 +08:00
fix(web): add missing 'general' chunk method description in locales (#17773)
This commit is contained in:
@@ -6,7 +6,7 @@ import DOMPurify from 'dompurify';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import { useMemo } from 'react';
|
||||
import { TagTabs } from './tag-tabs';
|
||||
import { ImageMap } from './utils';
|
||||
import { DescriptionKeyMap, ImageMap } from './utils';
|
||||
|
||||
const CategoryPanel = ({ chunkMethod }: { chunkMethod: string }) => {
|
||||
const parserList = useSelectParserList();
|
||||
@@ -15,9 +15,10 @@ const CategoryPanel = ({ chunkMethod }: { chunkMethod: string }) => {
|
||||
const item = useMemo(() => {
|
||||
const item = parserList.find((x) => x.value === chunkMethod);
|
||||
if (item) {
|
||||
const descriptionKey = DescriptionKeyMap[item.value] ?? item.value;
|
||||
return {
|
||||
title: item.label,
|
||||
description: t(camelCase(item.value)),
|
||||
description: t(camelCase(descriptionKey)),
|
||||
};
|
||||
}
|
||||
return { title: '', description: '' };
|
||||
|
||||
@@ -3,6 +3,12 @@ const getImageName = (prefix: string, length: number) =>
|
||||
.fill(0)
|
||||
.map((x, idx) => `chunk-method/${prefix}-0${idx + 1}`);
|
||||
|
||||
// The Go pipeline catalog uses 'general' as the id of the parser that the
|
||||
// Python backend calls 'naive'; both share the same description.
|
||||
export const DescriptionKeyMap: Record<string, string> = {
|
||||
general: 'naive',
|
||||
};
|
||||
|
||||
export const ImageMap = {
|
||||
book: getImageName('book', 4),
|
||||
laws: getImageName('law', 2),
|
||||
|
||||
Reference in New Issue
Block a user