diff --git a/app/helpers/report_helper.rb b/app/helpers/report_helper.rb index 67b5ba6ad18fe5876b323cf9aecf14e30d1376c3..248587d946bdd9eb32c8246c77a99cfa36a27ab0 100644 --- a/app/helpers/report_helper.rb +++ b/app/helpers/report_helper.rb @@ -13,7 +13,7 @@ module ReportHelper post_path(item.post.id, anchor: item.guid) )) else - raw t("report.not_found") + t("report.not_found") end end diff --git a/app/views/admins/stats.html.haml b/app/views/admins/stats.html.haml index 8f9082ef6933cabc2991796e1fa25a6a59d627af..d2d5fcc5e520ccdc1e8588353bcf307b415c8359 100644 --- a/app/views/admins/stats.html.haml +++ b/app/views/admins/stats.html.haml @@ -20,7 +20,7 @@ = submit_tag t('.go'), class: 'btn btn-primary' %h3 - != t('.display_results', :segment => @segment) + != t("admins.stats.display_results", segment: content_tag(:strong, @segment)) .row - [:posts, :comments, :aspect_memberships, :users].each do |name| @@ -45,7 +45,9 @@ .row .col-md-12 %p.alert.alert-info.text-center{role: "alert"} - != t('.current_segment', :post_yest => @posts[:yesterday]/@user_count.to_f, :post_day => @posts[:day_before]/@user_count.to_f) + != t("admins.stats.current_segment", + post_yest: content_tag(:strong, @posts[:yesterday] / @user_count.to_f), + post_day: content_tag(:strong, @posts[:day_before] / @user_count.to_f)) .row .col-md-12 @@ -53,4 +55,6 @@ %ul - @popular_tags.each do |name,count| %li - != t('.tag_name', :name_tag => name, :count_tag => count) + != t("admins.stats.tag_name", + name_tag: content_tag(:strong, name), + count_tag: content_tag(:strong, count)) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 37fd1565d14e3d4da24799885e085f4c1589cf8c..669079d3a17a90b0aedaa93ae56bdce36b74b39d 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -138,7 +138,7 @@ en: daily: "Daily" usage_statistic: "Usage statistics" go: "Go" - display_results: "Displaying results from the <b>%{segment}</b> segment" + display_results: "Displaying results from the %{segment} segment" posts: zero: "%{count} posts" one: "%{count} post" @@ -155,9 +155,9 @@ en: zero: "%{count} users" one: "%{count} user" other: "%{count} users" - current_segment: "The current segment is averaging <b>%{post_yest}</b> posts per user, from <b>%{post_day}</b>" + current_segment: "The current segment is averaging %{post_yest} posts per user, from %{post_day}" 50_most: "50 most popular tags" - tag_name: "Tag name: <b>%{name_tag}</b> Count: <b>%{count_tag}</b>" + tag_name: "Tag name: %{name_tag} Count: %{count_tag}" pods: pod_network: "Pod network" aspects: @@ -943,7 +943,7 @@ en: delete_link: "Delete item" reported_user_details: "Details on reported user" confirm_deletion: "Are you sure to delete the item?" - not_found: "<u>The post/comment was not found. It seems that it was deleted by the user!</u>" + not_found: "The post/comment was not found. It seems that it was deleted by the user!" status: destroyed: "The post was destroyed" failed: "Something went wrong" diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb index 8d617d7c99b61397ef79f735b6da7907c8296cb4..4dfdd0ef5ad28ff9ac6947a9ee7536824c061505 100644 --- a/spec/controllers/admins_controller_spec.rb +++ b/spec/controllers/admins_controller_spec.rb @@ -140,7 +140,9 @@ describe AdminsController, :type => :controller do expect(response).to be_success expect(response).to render_template(:stats) expect(response.body).to include( - I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.daily")) + I18n.translate( + "admins.stats.display_results", segment: "<strong>#{I18n.translate('admins.stats.daily')}</strong>" + ) ) end @@ -150,10 +152,14 @@ describe AdminsController, :type => :controller do expect(response).to be_success expect(response).to render_template(:stats) expect(response.body).not_to include( - I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.daily")) + I18n.translate( + "admins.stats.display_results", segment: "<strong>#{I18n.translate('admins.stats.daily')}</strong>" + ) ) expect(response.body).to include( - I18n.translate("admins.stats.display_results", segment: I18n.translate("admins.stats.#{range}")) + I18n.translate( + "admins.stats.display_results", segment: "<strong>#{I18n.translate("admins.stats.#{range}")}</strong>" + ) ) end end