fix(web): add missing 'general' chunk method description in locales (#17773)

This commit is contained in:
euvre
2026-08-11 23:46:13 -07:00
committed by GitHub
parent fdb6b5fdd2
commit 6d44cd09eb
2 changed files with 9 additions and 2 deletions

View File

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

View File

@@ -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),