apache / incubator-answer

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
https://answer.apache.org
Apache License 2.0
12.96k stars 1k forks source link

Upload Image Component Is Not Support many language #1167

Open chenyong0923 opened 2 weeks ago

chenyong0923 commented 2 weeks ago

image

image

`typescript import React, { useMemo, useRef } from 'react'; import { Form, InputGroup } from 'react-bootstrap'; import type { FC } from 'react'; import { useTranslation } from 'react-i18next';

interface CustomFileInputProps { value: string; onChange: React.ChangeEventHandler; isValid?: boolean; isInvalid?: boolean; }

const CustomFileInput: FC = ({ onChange, value, ...rest }) => { const { t } = useTranslation('translation', { keyPrefix: 'editor' }); const fileName = useMemo(() => { return value ?? t('file_upload.text'); }, [value]);

const fileRef = useRef(null);

return (

{t('file_upload.text')} { fileRef?.current?.click?.(); }} /> ); }; export default CustomFileInput; ` ` {/* */} `
LinkinStars commented 2 weeks ago

image

Maybe you need to reload the page after changing the language.

chenyong0923 commented 2 weeks ago

image

Maybe you need to reload the page after changing the language.

This is official and it seems to have a problem. You can try more times. The solution I provided above should resolve the issue.show code image