[openstreetmap/openstreetmap-website] WIP: Use a translation scope for time_ago_in_words (#2271)

Andy Allan notifications at github.com
Wed Jun 19 15:31:21 UTC 2019


This represents step 3 in the plan at #2255. I've marked it as WIP since we need to wait for #2270 to be merged, and give the translators some time to make their updates, but it's actually a finished PR. I thought it would be useful to have here now for review since I've done the work to make sure it's all going to work out as intended, even if it's not for immediate merging.

This PR updates our use of `distance_of_time_in_words_to_now` and `time_ago_in_words` rails helpers to use a translation scope. It also introduces a `friendly_date_ago` helper which should be used in place of the `friendly_date` helper for these 'ago' translations.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/2271

-- Commit Summary --

  * Add translations for distance_in_time_ago
  * Use the distance_in_words_ago scope for trace display
  * Use the distance_in_words_ago scope for diary comments pages
  * Use distance_in_words_ago scope for issues display
  * Use scope for time_ago when viewing users
  * Use scope for common details and changeset display in browse pages
  * Use distance_in_words_ago scope for user blocks
  * Add a friendly_date_ago helper
  * Use friendy_date_ago helper for notes
  * Use friendly_date_ago helper for user_blocks
  * Use friendly_date_ago helper for chnagesets
  * Use friendly_date_ago helper for changeset comments
  * Use friendly_date_ago for user blocks
  * Use friendly_date_ago for notes display
  * Update note comments to use friendly_date_ago helper

-- File Changes --

    M app/helpers/application_helper.rb (4)
    M app/helpers/changesets_helper.rb (4)
    M app/helpers/note_helper.rb (4)
    M app/helpers/user_blocks_helper.rb (2)
    M app/views/api/notes/_comment.html.erb (4)
    M app/views/browse/_common_details.html.erb (2)
    M app/views/browse/changeset.html.erb (4)
    M app/views/changeset_comments/_comment.html.erb (2)
    M app/views/diary_entries/comments.html.erb (2)
    M app/views/issues/index.html.erb (4)
    M app/views/notes/mine.html.erb (4)
    M app/views/traces/_trace.html.erb (2)
    M app/views/user_blocks/revoke.html.erb (2)
    M app/views/user_blocks/show.html.erb (2)
    M app/views/users/_contact.html.erb (2)
    M config/locales/en.yml (109)
    M test/helpers/note_helper_test.rb (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/2271.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2271.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2271
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190619/af181623/attachment-0001.html>


More information about the rails-dev mailing list