From a859fe1acf600640b922ac0a160b4a993d35778c Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 22 Mar 2023 18:07:49 +0000 Subject: [PATCH] Avoid raw html in translations for changeset comments --- app/views/browse/changeset.html.erb | 12 ++++++------ config/locales/en.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) 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: -- 2.39.5