mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-02 22:07:31 +08:00
Fix: Cross-language dropdown menu options translation error. (#17615)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { crossLanguageOptions } from '@/components/cross-language-form-field';
|
||||
import { useCrossLanguageOptions } from '@/components/cross-language-form-field';
|
||||
import { LayoutRecognizeFormField } from '@/components/layout-recognize-form-field';
|
||||
import {
|
||||
SelectWithSearch,
|
||||
@@ -167,6 +167,7 @@ export function RemoveHeaderFooterFormField({ prefix }: CommonProps) {
|
||||
|
||||
export function LanguageFormField({ prefix }: CommonProps) {
|
||||
const { t } = useTranslation();
|
||||
const crossLanguageOptions = useCrossLanguageOptions();
|
||||
|
||||
return (
|
||||
<RAGFlowFormItem
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { crossLanguageOptions } from '@/components/cross-language-form-field';
|
||||
import { Languages } from '@/components/cross-language-form-field';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { useEffect } from 'react';
|
||||
import { useFormContext } from 'react-hook-form';
|
||||
@@ -16,14 +16,10 @@ export function useSetInitialLanguage({
|
||||
|
||||
useEffect(() => {
|
||||
if (languageShown && isEmpty(lang)) {
|
||||
form.setValue(
|
||||
buildFieldNameWithPrefix('lang', prefix),
|
||||
crossLanguageOptions[0].value,
|
||||
{
|
||||
shouldValidate: true,
|
||||
shouldDirty: true,
|
||||
},
|
||||
);
|
||||
form.setValue(buildFieldNameWithPrefix('lang', prefix), Languages[0], {
|
||||
shouldValidate: true,
|
||||
shouldDirty: true,
|
||||
});
|
||||
}
|
||||
}, [form, lang, languageShown, prefix]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user