From: Anton Khorev Date: Wed, 20 Mar 2024 22:34:46 +0000 (+0300) Subject: Avoid lego translation in trace time/user/tags string X-Git-Tag: live~702^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/76a46824a469d31f1a00164586bad959d990bf66 Avoid lego translation in trace time/user/tags string --- 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"