Skip to content

A platform for community discussion. Free, open, simple.

FIX: Use correct translation string

Dan Ungureanu82b307cd52e8
diff --git a/plugins/poll/plugin.rb b/plugins/poll/plugin.rb
index d1b54eeeeb7..bf5163295b2 100644
--- a/plugins/poll/plugin.rb
+++ b/plugins/poll/plugin.rb
@@ -75,7 +75,7 @@ after_initialize do
poll_groups = poll.groups.split(",").map(&:downcase)
user_groups = user.groups.map { |g| g.name.downcase }
if (poll_groups & user_groups).empty?
- raise StandardError.new I18n.t("js.poll.results.groups.title", group: poll.groups)
+ raise StandardError.new I18n.t("js.poll.results.groups.title", groups: poll.groups)
end
end
diff --git a/plugins/poll/spec/controllers/polls_controller_spec.rb b/plugins/poll/spec/controllers/polls_controller_spec.rb
index 4236e6c51d2..74f15824f2d 100644
--- a/plugins/poll/spec/controllers/polls_controller_spec.rb
+++ b/plugins/poll/spec/controllers/polls_controller_spec.rb
@@ -195,7 +195,7 @@ describe ::DiscoursePoll::PollsController do
expect(response.status).not_to eq(200)
json = ::JSON.parse(response.body)
- expect(json["errors"][0]).to eq(I18n.t("js.poll.results.groups.title", trust_level: 2))
+ expect(json["errors"][0]).to eq(I18n.t("js.poll.results.groups.title", groups: poll.polls.first.groups))
end
it "doesn't discard anonymous votes when someone votes" do