diff --git a/packages/pl-fe/src/components/autosuggest-input.tsx b/packages/pl-fe/src/components/autosuggest-input.tsx index e015a503c..83866f747 100644 --- a/packages/pl-fe/src/components/autosuggest-input.tsx +++ b/packages/pl-fe/src/components/autosuggest-input.tsx @@ -17,7 +17,7 @@ import type { Emoji } from 'pl-fe/features/emoji'; type AutoSuggestion = string | Emoji | Location; -interface IAutosuggestInput extends Pick, 'onChange' | 'onKeyUp' | 'onKeyDown'> { +interface IAutosuggestInput extends Pick, 'lang' | 'onChange' | 'onKeyUp' | 'onKeyDown'> { value: string; suggestions: Array; disabled?: boolean; @@ -271,6 +271,7 @@ const AutosuggestInput: React.FC = ({ maxLength={props.maxLength} data-testid='autosuggest-input' theme={props.theme} + lang={props.lang} /> , diff --git a/packages/pl-fe/src/components/ui/input.tsx b/packages/pl-fe/src/components/ui/input.tsx index 6d2434140..d7e60835a 100644 --- a/packages/pl-fe/src/components/ui/input.tsx +++ b/packages/pl-fe/src/components/ui/input.tsx @@ -17,7 +17,7 @@ const messages = defineMessages({ /** Possible theme names for an Input. */ type InputThemes = 'normal' | 'search' | 'transparent' -interface IInput extends Pick, 'maxLength' | 'onChange' | 'onBlur' | 'type' | 'autoComplete' | 'autoCorrect' | 'autoCapitalize' | 'required' | 'disabled' | 'onClick' | 'readOnly' | 'min' | 'pattern' | 'onKeyDown' | 'onKeyUp' | 'onFocus' | 'style' | 'id'> { +interface IInput extends Pick, 'maxLength' | 'onChange' | 'onBlur' | 'type' | 'autoComplete' | 'autoCorrect' | 'autoCapitalize' | 'required' | 'disabled' | 'onClick' | 'readOnly' | 'min' | 'pattern' | 'onKeyDown' | 'onKeyUp' | 'onFocus' | 'style' | 'id' | 'lang'> { /** Put the cursor into the input on mount. */ autoFocus?: boolean; /** The initial text in the input. */ diff --git a/packages/pl-fe/src/features/compose/components/polls/poll-form.tsx b/packages/pl-fe/src/features/compose/components/polls/poll-form.tsx index 81189fd9b..37524b0f0 100644 --- a/packages/pl-fe/src/features/compose/components/polls/poll-form.tsx +++ b/packages/pl-fe/src/features/compose/components/polls/poll-form.tsx @@ -55,7 +55,7 @@ const Option: React.FC = ({ const dispatch = useAppDispatch(); const intl = useIntl(); - const { suggestions } = useCompose(composeId); + const { suggestions, modified_language: language } = useCompose(composeId); const handleOptionTitleChange = (event: React.ChangeEvent) => onChange(index, event.target.value); @@ -96,6 +96,7 @@ const Option: React.FC = ({ onSuggestionSelected={onSuggestionSelected} searchTokens={[':']} autoFocus={index === 0 || index >= 2} + lang={language || undefined} /> diff --git a/packages/pl-fe/src/features/compose/components/spoiler-input.tsx b/packages/pl-fe/src/features/compose/components/spoiler-input.tsx index 61c206d58..dc1c22d5d 100644 --- a/packages/pl-fe/src/features/compose/components/spoiler-input.tsx +++ b/packages/pl-fe/src/features/compose/components/spoiler-input.tsx @@ -45,6 +45,7 @@ const SpoilerInput: React.FC = ({ searchTokens={[':']} id='cw-spoiler-input' className='rounded-md !bg-transparent dark:!bg-transparent' + lang={modified_language || undefined} /> ); }; diff --git a/packages/pl-fe/src/features/compose/editor/index.tsx b/packages/pl-fe/src/features/compose/editor/index.tsx index 0fd6a4f71..388f39a40 100644 --- a/packages/pl-fe/src/features/compose/editor/index.tsx +++ b/packages/pl-fe/src/features/compose/editor/index.tsx @@ -99,7 +99,7 @@ const ComposeEditor = React.forwardRef(({ placeholder, }, ref) => { const dispatch = useAppDispatch(); - const { content_type: contentType } = useCompose(composeId); + const { content_type: contentType, modified_language: language } = useCompose(composeId); const isWysiwyg = contentType === 'wysiwyg'; const nodes = useNodes(isWysiwyg); const intl = useIntl(); @@ -210,6 +210,7 @@ const ComposeEditor = React.forwardRef(({ 'min-h-[99px]': !condensed, }, )} + lang={language || undefined} /> }