From fb9c786baf844d7f9f5e2f3920aa80efd0673abe Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sun, 29 Jan 2023 19:00:19 +0100 Subject: [Glitch] Add lang attribute to image description textarea and poll option field Port 2a4f2216d65bd5ac90239d5b99c70f4330d76fde to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/compose/components/poll_form.js | 9 ++++++--- .../glitch/features/compose/containers/poll_form_container.js | 1 + .../flavours/glitch/features/ui/components/focal_point_modal.js | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.js b/app/javascript/flavours/glitch/features/compose/components/poll_form.js index afb5da097..2ab3c64ac 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.js @@ -26,6 +26,7 @@ class Option extends React.PureComponent { static propTypes = { title: PropTypes.string.isRequired, + lang: PropTypes.string, index: PropTypes.number.isRequired, isPollMultiple: PropTypes.bool, autoFocus: PropTypes.bool, @@ -59,7 +60,7 @@ class Option extends React.PureComponent { } render () { - const { isPollMultiple, title, index, autoFocus, intl } = this.props; + const { isPollMultiple, title, lang, index, autoFocus, intl } = this.props; return (
  • @@ -70,6 +71,7 @@ class Option extends React.PureComponent { placeholder={intl.formatMessage(messages.option_placeholder, { number: index + 1 })} maxLength={pollLimits.max_option_chars} value={title} + lang={lang} onChange={this.handleOptionTitleChange} suggestions={this.props.suggestions} onSuggestionsFetchRequested={this.onSuggestionsFetchRequested} @@ -95,6 +97,7 @@ class PollForm extends ImmutablePureComponent { static propTypes = { options: ImmutablePropTypes.list, + lang: PropTypes.string, expiresIn: PropTypes.number, isMultiple: PropTypes.bool, onChangeOption: PropTypes.func.isRequired, @@ -121,7 +124,7 @@ class PollForm extends ImmutablePureComponent { }; render () { - const { options, expiresIn, isMultiple, onChangeOption, onRemoveOption, intl, ...other } = this.props; + const { options, lang, expiresIn, isMultiple, onChangeOption, onRemoveOption, intl, ...other } = this.props; if (!options) { return null; @@ -132,7 +135,7 @@ class PollForm extends ImmutablePureComponent { return (
      - {options.map((title, i) =>