From 653be23a0d390f3e03dde457ff39f70b5182bc9d Mon Sep 17 00:00:00 2001 From: Tim Vahlbrock Date: Fri, 1 Nov 2024 01:26:43 +0100 Subject: [PATCH] Show text using i18n and modify existing usages --- src/components/views/dialogs/PollResultsDialog.tsx | 3 ++- src/i18n/strings/en_EN.json | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/views/dialogs/PollResultsDialog.tsx b/src/components/views/dialogs/PollResultsDialog.tsx index 9367c143c2..7e8e9929d4 100644 --- a/src/components/views/dialogs/PollResultsDialog.tsx +++ b/src/components/views/dialogs/PollResultsDialog.tsx @@ -10,6 +10,7 @@ import { PollAnswerSubevent, PollStartEvent } from "matrix-js-sdk/src/extensible import { RoomMember } from "matrix-js-sdk/src/matrix"; import React from "react"; +import { _t } from "../../../languageHandler"; import Modal from "../../../Modal"; import MemberAvatar from "../avatars/MemberAvatar"; import { UserVote } from "../messages/MPollBody"; @@ -54,7 +55,7 @@ function AnswerEntry(props: {
{answer.text} - {votes.length} votes + {_t("poll|result_dialog|count_of_votes", { count: votes.length })}
{votes.length === 0 &&
No one voted for this.
} {votes.map((vote) => { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 7ba141c784..77d2e79be1 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1714,6 +1714,12 @@ "options_heading": "Create options", "options_label": "Option %(number)s", "options_placeholder": "Write an option", + "result_dialog": { + "count_of_votes": { + "one": "%(count)s vote", + "other": "%(count)s votes" + } + }, "topic_heading": "What is your poll question or topic?", "topic_label": "Question or topic", "topic_placeholder": "Write something…", @@ -1723,8 +1729,8 @@ "other": "%(count)s votes cast. Vote to see the results" }, "total_n_votes_voted": { - "one": "Based on %(count)s vote", - "other": "Based on %(count)s votes" + "one": "Based on %(count)s vote. Click here to see the results", + "other": "Based on %(count)s votes. Click here to see the results" }, "total_no_votes": "No votes cast", "total_not_ended": "Results will be visible when the poll is ended", @@ -1875,8 +1881,8 @@ "other": "There are no past polls for the past %(count)s days. Load more polls to view polls for previous months" }, "final_result": { - "one": "Final result based on %(count)s vote", - "other": "Final result based on %(count)s votes" + "one": "Final result based on %(count)s vote. Click here to see the results", + "other": "Final result based on %(count)s votes. Click here to see the results" }, "load_more": "Load more polls", "loading": "Loading polls",