From 403dbd707940f1ff2c47c076a545d919befbd4d3 Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Fri, 25 Oct 2024 18:21:46 +0300 Subject: [PATCH] chore[Op#40437]: humanize reaction instead --- .../journals/item_component/add_reactions.html.erb | 2 +- .../activities_tab/journals/item_component/reactions.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb index 2a062625fc6f..c19ccd4bb1aa 100644 --- a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb +++ b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb @@ -25,7 +25,7 @@ tag: :a, href: toggle_reaction_work_package_activity_path(journal.journable.id, id: journal.id, reaction:), data: { "turbo-stream": true, "turbo-method": :put }, - "aria-label": I18n.t("reactions.react_with", reaction: reaction.tr("_", "")) + "aria-label": I18n.t("reactions.react_with", reaction: reaction.to_s.humanize(capitalize: false)) )) do emoji end diff --git a/app/components/work_packages/activities_tab/journals/item_component/reactions.rb b/app/components/work_packages/activities_tab/journals/item_component/reactions.rb index a7fbee62fb15..a6c083b82b33 100644 --- a/app/components/work_packages/activities_tab/journals/item_component/reactions.rb +++ b/app/components/work_packages/activities_tab/journals/item_component/reactions.rb @@ -62,7 +62,8 @@ def reacted_by_current_user?(users) # ARIA-label, show names and emoji type: "{Name of reaction} by {user A}, {user B} and {user C}". def aria_label_text(reaction, users) - "#{I18n.t('reactions.reaction_by', reaction: reaction.to_s.tr('_', ' '))} #{number_of_user_reactions_text(users)}" + "#{I18n.t('reactions.reaction_by', + reaction: reaction.to_s.humanize(capitalize: false))} #{number_of_user_reactions_text(users)}" end # Visually, show just names: "{user A}, {user B} and {user C}"