Skip to content

Commit

Permalink
Remove translation for distance_in_words
Browse files Browse the repository at this point in the history
This translation was applying in different helpers (time_ago_in_words,
distance_in_words, ...) and was producing a side effect in the old webui.
  • Loading branch information
DavidKang committed Sep 10, 2018
1 parent 832f53c commit 4a3e6e2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/api/app/helpers/webui/webui_helper.rb
Expand Up @@ -35,7 +35,7 @@ def fuzzy_time(time, with_fulltime = true)
return 'now' # rails' 'less than a minute' is a bit long
end

human_time_ago = time_ago_in_words(time)
human_time_ago = time_ago_in_words(time) + ' ago'

if with_fulltime
raw("<span title='#{l(time.utc)}' class='fuzzy-time'>#{human_time_ago}</span>")
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui2/webui/comment/_content.html.haml
Expand Up @@ -6,7 +6,7 @@
= link_to(comment.user, user_show_path(comment.user))
wrote
%u{ title: l(comment.created_at.utc) }
= time_ago_in_words(comment.created_at)
#{time_ago_in_words(comment.created_at)} ago
= render_as_markdown(comment)
= render partial: 'webui2/webui/comment/links', locals: { comment: comment }
= render partial: 'webui2/webui/comment/reply', locals: { comment: comment, level: 0, commentable: commentable }
Expand Down
Expand Up @@ -11,4 +11,4 @@
= user_with_realname_and_icon(req.creator, short: true)
= surround '(', ')' do
%u{ title: l(req.created_at.utc) }
= time_ago_in_words(req.created_at)
#{time_ago_in_words(req.created_at)} ago
46 changes: 0 additions & 46 deletions src/api/config/locales/en.yml
Expand Up @@ -24,49 +24,3 @@ en:
formats:
only_date: '%Y-%m-%d'
default: '%Y-%m-%d %H:%M UTC'
datetime:
distance_in_words:
less_than_x_seconds:
one: "less than 1 second"
other: "less than %{count} seconds"
x_seconds:
one: "1 second"
other: "%{count} seconds"

less_than_x_minutes:
one: "less than a minute"
other: "less than %{count} minutes"
x_minutes:
one: "1 minute ago"
other: "%{count} minutes ago"

x_hours:
one: "1 hour ago"
other: "%{count} hours ago"
about_x_hours:
one: "about 1 hour ago"
other: "about %{count} hours ago"

x_days:
one: "1 day ago"
other: "%{count} days ago"
about_x_days:
one: "about 1 day ago"
other: "about %{count} days ago"

x_months:
one: "1 month ago"
other: "%{count} months ago"
about_x_months:
one: "about 1 month ago"
other: "about %{count} months ago"

x_years:
one: "1 year ago"
other: "%{count} years ago"
about_x_years:
one: "about 1 year ago"
other: "about %{count} years ago"
over_x_years:
one: "over 1 year ago"
other: "over %{count} years ago"

0 comments on commit 4a3e6e2

Please sign in to comment.