diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx index 014280077617eebe7fd954508bc72964b7257a61..366f7e4b61362229ab518852cd042f18d6d1d2d1 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/quick-poll-dropdown/component.jsx @@ -43,30 +43,7 @@ const propTypes = { amIPresenter: PropTypes.bool.isRequired, }; -const getLocalizedAnswers = (type, intl, pollTypes) => { - switch (type) { - case pollTypes.TrueFalse: - return [ - intl.formatMessage(intlMessages.trueOptionLabel), - intl.formatMessage(intlMessages.falseOptionLabel), - ]; - case pollTypes.YesNo: - return [ - intl.formatMessage(intlMessages.yesOptionLabel), - intl.formatMessage(intlMessages.noOptionLabel), - ]; - case pollTypes.YesNoAbstention: - return [ - intl.formatMessage(intlMessages.yesOptionLabel), - intl.formatMessage(intlMessages.noOptionLabel), - intl.formatMessage(intlMessages.abstentionOptionLabel), - ]; - default: - return null; - } -}; - -const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollTypes) => { +const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, pollTypes) => { const pollItemElements = parsedSlides.map((poll) => { let { poll: label, type } = poll; let itemLabel = label; @@ -78,9 +55,6 @@ const getAvailableQuickPolls = (slideId, parsedSlides, startPoll, intl, pollType { const { options } = itemLabel; itemLabel = options.join('/').replace(/[\n.)]/g, ''); - } else { - answers = getLocalizedAnswers(type, intl, pollTypes); - type = pollTypes.Custom; } // removes any whitespace from the label @@ -151,14 +125,6 @@ class QuickPollDropdown extends Component { singlePollType = type; } - if (singlePollType === pollTypes.TrueFalse || - singlePollType === pollTypes.YesNo || - singlePollType === pollTypes.YesNoAbstention) - { - answers = getLocalizedAnswers(singlePollType, intl, pollTypes); - singlePollType = pollTypes.Custom; - } - let btn = ( <Button aria-label={intl.formatMessage(intlMessages.quickPollLabel)} diff --git a/bigbluebutton-html5/imports/ui/components/poll/service.js b/bigbluebutton-html5/imports/ui/components/poll/service.js index 8b61817579e5d737502a0c2ff91686ffb0579911..b161193ff027e2e4d9f6c5fe4df5f410cd2bf0ac 100644 --- a/bigbluebutton-html5/imports/ui/components/poll/service.js +++ b/bigbluebutton-html5/imports/ui/components/poll/service.js @@ -95,7 +95,9 @@ const getPollResultsText = (isDefaultPoll, answers, numRespondents, intl) => { const pctBars = "|".repeat(pct * MAX_POLL_RESULT_BARS / 100); const pctFotmatted = `${Number.isNaN(pct) ? 0 : pct}%`; if (isDefaultPoll) { - const translatedKey = intl.formatMessage(pollAnswerIds[item.key.toLowerCase()]); + const translatedKey = pollAnswerIds[item.key.toLowerCase()] + ? intl.formatMessage(pollAnswerIds[item.key.toLowerCase()]) + : item.key; resultString += `${translatedKey}: ${item.numVotes || 0} |${pctBars} ${pctFotmatted}\n`; } else { resultString += `${item.id+1}: ${item.numVotes || 0} |${pctBars} ${pctFotmatted}\n`;