From: Tom Hughes
- <%= t(".past", :time => distance_of_time_in_words_to_now(@user_block.ends_at)) %>
+ <%= t(".past", :time => time_ago_in_words(@user_block.ends_at, :scope => :'datetime.distance_in_words_ago')) %>
<% end -%>
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb
index 87d3b03d0..1c45f4124 100644
--- a/app/views/issues/index.html.erb
+++ b/app/views/issues/index.html.erb
@@ -38,10 +38,10 @@
<%= link_to comment.diary_entry.title, diary_entry_path(comment.diary_entry.user, comment.diary_entry) %>
- <%= t ".ago", :ago => time_ago_in_words(comment.created_at) %>
+ <%= time_ago_in_words(comment.created_at, :scope => :'datetime.distance_in_words_ago') %>
<%= comment.body.to_html %>
<% if issue.user_updated %>
<%= t ".last_updated_time_user_html", :user => link_to(issue.user_updated.display_name, user_path(issue.user_updated)),
- :time => distance_of_time_in_words_to_now(issue.updated_at),
+ :time => time_ago_in_words(issue.updated_at, :scope => :'datetime.distance_in_words_ago'),
:title => l(issue.updated_at) %>
<% else %>
- <%= t ".last_updated_time_html", :time => distance_of_time_in_words_to_now(issue.updated_at),
+ <%= t ".last_updated_time_html", :time => time_ago_in_words(issue.updated_at, :scope => :'datetime.distance_in_words_ago'),
:title => l(issue.updated_at) %>
<% end %>
diff --git a/app/views/notes/mine.html.erb b/app/views/notes/mine.html.erb
index 2751e1559..c7015578b 100644
--- a/app/views/notes/mine.html.erb
+++ b/app/views/notes/mine.html.erb
@@ -26,8 +26,8 @@
<%= link_to note.id, browse_note_path(note) %>
<%= note_author(note.author) %>
<%= note.comments.first.body.to_html %>
- <%= t ".ago_html", :when => friendly_date(note.created_at) %>
- <%= t ".ago_html", :when => friendly_date(note.updated_at) %>
+ <%= friendly_date_ago(note.created_at) %>
+ <%= friendly_date_ago(note.updated_at) %>
<% end -%>
diff --git a/app/views/traces/_trace.html.erb b/app/views/traces/_trace.html.erb
index 34f661500..ceeb4d88d 100644
--- a/app/views/traces/_trace.html.erb
+++ b/app/views/traces/_trace.html.erb
@@ -14,7 +14,7 @@
<% if trace.inserted %>
(<%= t ".count_points", :count => trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/, '\1,') %>)
<% end %>
- ... <%= t ".ago", :time_in_words_ago => time_ago_in_words(trace.timestamp) %>
+ ... <%= time_ago_in_words(trace.timestamp, :scope => :'datetime.distance_in_words_ago') %>
<%= link_to_if trace.inserted?, t(".map"), { :controller => "site", :action => "index", :mlat => trace.latitude, :mlon => trace.longitude, :anchor => "map=14/#{trace.latitude}/#{trace.longitude}" }, { :title => t(".view_map") } %> /
<%= link_to t(".edit"), { :controller => "site", :action => "edit", :gpx => trace.id }, { :title => t(".edit_map") } %>
<%= t("." + trace.visibility) %>
diff --git a/app/views/user_blocks/revoke.html.erb b/app/views/user_blocks/revoke.html.erb
index 44da21d85..9bd7df5ae 100644
--- a/app/views/user_blocks/revoke.html.erb
+++ b/app/views/user_blocks/revoke.html.erb
@@ -28,6 +28,6 @@
<% else %>
<%= t ".created" %>: <%= raw t ".ago", :time => friendly_date(@user_block.created_at) %>
+<%= t ".created" %>: <%= friendly_date_ago(@user_block.created_at) %>
<%= t ".status" %>: <%= block_status(@user_block) %>
diff --git a/app/views/users/_contact.html.erb b/app/views/users/_contact.html.erb index 9950da0f8..1479a1e4f 100644 --- a/app/views/users/_contact.html.erb +++ b/app/views/users/_contact.html.erb @@ -21,7 +21,7 @@<% changeset = contact.changesets.first %> <% if changeset %> - <%= t("users.show.latest edit", :ago => t("users.show.ago", :time_in_words_ago => time_ago_in_words(changeset.created_at))) %> + <%= t("users.show.latest edit", :ago => time_ago_in_words(changeset.created_at, :scope => :'datetime.distance_in_words_ago')) %> <% comment = changeset.tags["comment"].to_s != "" ? changeset.tags["comment"] : t("browse.no_comment") %> "<%= link_to(comment, { :controller => "browse", :action => "changeset", :id => changeset.id }, diff --git a/config/locales/en.yml b/config/locales/en.yml index 0281703ab..1de83f9d6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -163,14 +163,14 @@ en: api: notes: comment: - opened_at_html: "Created %{when} ago" - opened_at_by_html: "Created %{when} ago by %{user}" - commented_at_html: "Updated %{when} ago" - commented_at_by_html: "Updated %{when} ago by %{user}" - closed_at_html: "Resolved %{when} ago" - closed_at_by_html: "Resolved %{when} ago by %{user}" - reopened_at_html: "Reactivated %{when} ago" - reopened_at_by_html: "Reactivated %{when} ago by %{user}" + opened_at_html: "Created %{when}" + opened_at_by_html: "Created %{when} by %{user}" + commented_at_html: "Updated %{when}" + commented_at_by_html: "Updated %{when}by %{user}" + closed_at_html: "Resolved %{when}" + closed_at_by_html: "Resolved %{when} by %{user}" + reopened_at_html: "Reactivated %{when}" + reopened_at_by_html: "Reactivated %{when} by %{user}" rss: title: "OpenStreetMap Notes" description_area: "A list of notes, reported, commented on or closed in your area [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]" @@ -185,12 +185,12 @@ en: browse: created: "Created" closed: "Closed" - created_html: "Created %{time} ago" - closed_html: "Closed %{time} ago" - created_by_html: "Created %{time} ago by %{user}" - deleted_by_html: "Deleted %{time} ago by %{user}" - edited_by_html: "Edited %{time} ago by %{user}" - closed_by_html: "Closed %{time} ago by %{user}" + created_html: "Created %{time}" + closed_html: "Closed %{time}" + created_by_html: "Created %{time} by %{user}" + deleted_by_html: "Deleted %{time} by %{user}" + edited_by_html: "Edited %{time} by %{user}" + closed_by_html: "Closed %{time} by %{user}" version: "Version" in_changeset: "Changeset" anonymous: "anonymous" @@ -210,8 +210,8 @@ en: relation: "Relations (%{count})" relation_paginated: "Relations (%{x}-%{y} of %{count})" comment: "Comments (%{count})" - hidden_commented_by: "Hidden comment from %{user} %{when} ago" - commented_by: "Comment from %{user} %{when} ago" + hidden_commented_by: "Hidden comment from %{user} %{when}" + commented_by: "Comment from %{user} %{when}" changesetxml: "Changeset XML" osmchangexml: "osmChange XML" feed: @@ -286,15 +286,15 @@ en: open_title: "Unresolved note #%{note_name}" closed_title: "Resolved note #%{note_name}" hidden_title: "Hidden note #%{note_name}" - open_by: "Created by %{user} %{when} ago" - open_by_anonymous: "Created by anonymous %{when} ago" - commented_by: "Comment from %{user} %{when} ago" - commented_by_anonymous: "Comment from anonymous %{when} ago" - closed_by: "Resolved by %{user} %{when} ago" - closed_by_anonymous: "Resolved by anonymous %{when} ago" - reopened_by: "Reactivated by %{user} %{when} ago" - reopened_by_anonymous: "Reactivated by anonymous %{when} ago" - hidden_by: "Hidden by %{user} %{when} ago" + open_by: "Created by %{user} %{when}" + open_by_anonymous: "Created by anonymous %{when}" + commented_by: "Comment from %{user} %{when}" + commented_by_anonymous: "Comment from anonymous %{when}" + closed_by: "Resolved by %{user} %{when}" + closed_by_anonymous: "Resolved by anonymous %{when}" + reopened_by: "Reactivated by %{user} %{when}" + reopened_by_anonymous: "Reactivated by anonymous %{when}" + hidden_by: "Hidden by %{user} %{when}" report: Report this note query: title: "Query Features" @@ -333,7 +333,7 @@ en: changeset_comments: comment: comment: "New comment on changeset #%{changeset_id} by %{author}" - commented_at_by_html: "Updated %{when} ago by %{user}" + commented_at_by_html: "Updated %{when} by %{user}" comments: comment: "New comment on changeset #%{changeset_id} by %{author}" index: @@ -415,7 +415,6 @@ en: post: Post when: When comment: Comment - ago: "%{ago} ago" newer_comments: "Newer Comments" older_comments: "Older Comments" geocoder: @@ -1028,8 +1027,8 @@ en: status: Status reports: Reports last_updated: Last Updated - last_updated_time_html: "%{time} ago" - last_updated_time_user_html: "%{time} ago by %{user}" + last_updated_time_html: "%{time}" + last_updated_time_user_html: "%{time} by %{user}" link_to_reports: View Reports reported_user: Reported User reports_count: @@ -1857,7 +1856,6 @@ en: trace: pending: "PENDING" count_points: "%{count} points" - ago: "%{time_in_words_ago} ago" more: "more" trace_details: "View Trace Details" view_map: "View Map" @@ -2130,12 +2128,10 @@ en: remove as friend: Unfriend add as friend: Add Friend mapper since: "Mapper since:" - ago: "(%{time_in_words_ago} ago)" ct status: "Contributor terms:" ct undecided: Undecided ct declined: Declined - ct accepted: Accepted %{ago} ago - latest edit: "Latest edit %{ago}:" + latest edit: "Latest edit (%{ago}):" email address: "Email address:" created from: "Created from:" status: "Status:" @@ -2368,7 +2364,7 @@ en: title: "Revoking block on %{block_on}" heading: "Revoking block on %{block_on} by %{block_by}" time_future: "This block will end in %{time}." - past: "This block ended %{time} ago and cannot be revoked now." + past: "This block ended %{time} and cannot be revoked now." confirm: "Are you sure you wish to revoke this block?" revoke: "Revoke!" flash: "This block has been revoked." @@ -2376,7 +2372,7 @@ en: time_future: "Ends in %{time}." until_login: "Active until the user logs in." time_future_and_until_login: "Ends in %{time} and after the user has logged in." - time_past: "Ended %{time} ago." + time_past: "Ended %{time}." block_duration: hours: one: "1 hour" @@ -2404,10 +2400,7 @@ en: show: title: "%{block_on} blocked by %{block_by}" heading: "%{block_on} blocked by %{block_by}" - time_future: "Ends in %{time}" - time_past: "Ended %{time} ago" created: "Created" - ago: "%{time} ago" status: "Status" show: "Show" edit: "Edit" @@ -2441,7 +2434,6 @@ en: description: "Description" created_at: "Created at" last_changed: "Last changed" - ago_html: "%{when} ago" javascripts: close: Close share: diff --git a/test/helpers/note_helper_test.rb b/test/helpers/note_helper_test.rb index 408236879..ce82f3ab5 100644 --- a/test/helpers/note_helper_test.rb +++ b/test/helpers/note_helper_test.rb @@ -8,8 +8,8 @@ class NoteHelperTest < ActionView::TestCase date = Time.new(2014, 3, 5, 21, 37, 45, "+00:00") user = create(:user) - assert_match %r{^Created by anonymous .* ago$}, note_event("open", date, nil) - assert_match %r{^Resolved by #{user.display_name} .* ago$}, note_event("closed", date, user) + assert_match %r{^Created by anonymous .* ago$}, note_event("open", date, nil) + assert_match %r{^Resolved by #{user.display_name} .* ago$}, note_event("closed", date, user) end def test_note_author