mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-04 01:07:48 +08:00
### What problem does this PR solve? This change adds 'Vietnamese' to the list of supported languages in two components related to cross-language functionality. The addition expands language support by including Vietnamese as a selectable option ### Type of change - [x] New Feature (non-breaking change which adds functionality)
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import { FormLabel } from '@/components/ui/form';
|
|
import { MultiSelect } from '@/components/ui/multi-select';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
const Languages = [
|
|
'English',
|
|
'Chinese',
|
|
'Spanish',
|
|
'French',
|
|
'German',
|
|
'Japanese',
|
|
'Korean',
|
|
'Vietnamese',
|
|
];
|
|
|
|
const options = Languages.map((x) => ({ label: x, value: x }));
|
|
|
|
type CrossLanguageItemProps = {
|
|
name?: string | Array<string>;
|
|
onChange: (arg: string[]) => void;
|
|
};
|
|
|
|
export const CrossLanguageItem = ({
|
|
name = ['prompt_config', 'cross_languages'],
|
|
onChange = () => {},
|
|
}: CrossLanguageItemProps) => {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<div>
|
|
<div className="pb-2">
|
|
<FormLabel tooltip={t('chat.crossLanguageTip')}>
|
|
{t('chat.crossLanguage')}
|
|
</FormLabel>
|
|
</div>
|
|
<MultiSelect
|
|
options={options}
|
|
onValueChange={(val) => {
|
|
onChange(val);
|
|
}}
|
|
// defaultValue={field.value}
|
|
placeholder={t('fileManager.pleaseSelect')}
|
|
maxCount={100}
|
|
// {...field}
|
|
modalPopover
|
|
/>
|
|
</div>
|
|
);
|
|
};
|