Add missing event name translations

We were always displaying the event names in English.

Note we're changing the `user_supported_budgets` key because it didn't
make much sense; the investments are supported, and not the budgets.

We're also adding "created" to most of the event names in order to make
the texts more explicit, since not all the events refer to created data.
This commit is contained in:
Javi Martín
2024-04-25 03:44:09 +02:00
parent 328413373e
commit d25f2e7259
8 changed files with 32 additions and 28 deletions

View File

@@ -30,6 +30,6 @@ class Admin::Stats::BudgetSupportingComponent < ApplicationComponent
end
def chart
@chart ||= Ahoy::Chart.new("user_supported_budgets")
@chart ||= Ahoy::Chart.new("budget_investment_supported")
end
end

View File

@@ -31,18 +31,14 @@ module Ahoy
end
def title
text = t("admin.stats.graph.#{event_name}")
if text.to_s.match(/translation missing/)
text = event_name.to_s.titleize
end
text
t("admin.stats.graph.#{event_name}")
end
private
def records
case event_name.to_sym
when :user_supported_budgets
when :budget_investment_supported
Vote.where(votable_type: "Budget::Investment")
when :visits
Visit.all