From 76a46824a469d31f1a00164586bad959d990bf66 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 21 Mar 2024 01:34:46 +0300 Subject: [PATCH] Avoid lego translation in trace time/user/tags string --- app/views/traces/_trace.html.erb | 12 +++++++----- config/locales/en.yml | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb index f72671e37..184570499 100644 --- a/app/views/traces/_trace.html.erb +++ b/app/views/traces/_trace.html.erb @@ -29,11 +29,13 @@

- <%= friendly_date_ago(trace.timestamp) %> - <%= t ".by" %> <%= link_to trace.user.display_name, trace.user %> - <% if !trace.tags.empty? %> - <%= t ".in" %> - <%= safe_join(trace.tags.collect { |tag| link_to_tag tag.tag }, ", ") %> + <% if trace.tags.empty? %> + <%= t ".details_without_tags_html", :time_ago => friendly_date_ago(trace.timestamp), + :user => link_to(trace.user.display_name, trace.user) %> + <% else %> + <%= t ".details_with_tags_html", :time_ago => friendly_date_ago(trace.timestamp), + :user => link_to(trace.user.display_name, trace.user), + :tags => safe_join(trace.tags.collect { |tag| link_to_tag tag.tag }, ", ") %> <% end %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 9af2dd566..9af89978e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2541,8 +2541,8 @@ en: identifiable: "IDENTIFIABLE" private: "PRIVATE" trackable: "TRACKABLE" - by: "by" - in: "in" + details_with_tags_html: "%{time_ago} by %{user} in %{tags}" + details_without_tags_html: "%{time_ago} by %{user}" index: public_traces: "Public GPS Traces" my_gps_traces: "My GPS Traces" -- 2.39.5