From: Andy Allan Date: Wed, 22 Mar 2023 18:07:49 +0000 (+0000) Subject: Avoid raw html in translations for changeset comments X-Git-Tag: live~1311^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a859fe1acf600640b922ac0a160b4a993d35778c?hp=dff0c82f17d15ebed01941b9a24f9e0ab8feb1df Avoid raw html in translations for changeset comments --- diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 4045c0b48..3c5ba7de0 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -38,9 +38,9 @@ <% if comment.visible %>
  • - <%= t(".commented_by_html", - :when => friendly_date_ago(comment.created_at), - :exact_time => l(comment.created_at), + <%= t(".comment_by_html", + :time_ago => tag.abbr(friendly_date_ago(comment.created_at), + :title => l(comment.created_at)), :user => link_to(comment.author.display_name, user_path(comment.author))) %> <% if current_user and current_user.moderator? %> — <%= t("javascripts.changesets.show.hide_comment") %> @@ -51,9 +51,9 @@ <% elsif current_user and current_user.moderator? %>
  • - <%= t(".hidden_commented_by_html", - :when => friendly_date_ago(comment.created_at), - :exact_time => l(comment.created_at), + <%= t(".hidden_comment_by_html", + :time_ago => tag.abbr(friendly_date_ago(comment.created_at), + :title => l(comment.created_at)), :user => link_to(comment.author.display_name, user_path(comment.author))) %> — <%= t("javascripts.changesets.show.unhide_comment") %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 0a9ca9980..fd84a48bf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -333,8 +333,8 @@ en: relation: "Relations (%{count})" relation_paginated: "Relations (%{x}-%{y} of %{count})" comment: "Comments (%{count})" - hidden_commented_by_html: "Hidden comment from %{user} %{when}" - commented_by_html: "Comment from %{user} %{when}" + hidden_comment_by_html: "Hidden comment from %{user} %{time_ago}" + comment_by_html: "Comment from %{user} %{time_ago}" changesetxml: "Changeset XML" osmchangexml: "osmChange XML" feed: