Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Revert "fix i18n"
Browse files Browse the repository at this point in the history
This reverts commit 286bf64.

Signed-off-by: bborn <bruno.bornsztein@gmail.com>
  • Loading branch information
bborn committed Sep 23, 2010
1 parent 31506a0 commit 11a8bb1
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions app/helpers/base_helper.rb
Expand Up @@ -330,17 +330,17 @@ def time_ago_in_words(from_time, to_time = Time.now, include_seconds = false)
when 1..59 then :minutes_ago.l(:count => distance_in_minutes)
when 60..1440 then :hours_ago.l(:count => (distance_in_minutes.to_f / 60.0).round)
when 1440..2880 then :days_ago.l(:count => (distance_in_minutes.to_f / 1440.0).round) # 1.5 days to 2 days
else I18n.t(from_time, :format => :time_ago)
else I18n.l(from_time, :format => :time_ago)
end
end

def time_ago_in_words_or_date(date)
if date.to_date.eql?(Time.now.to_date)
display = I18n.t(date.to_time, :format => :time_ago)
display = I18n.l(date.to_time, :format => :time_ago)
elsif date.to_date.eql?(Time.now.to_date - 1)
display = :yesterday.l
else
display = I18n.t(date.to_date, :format => :date_ago)
display = I18n.l(date.to_date, :format => :date_ago)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/photo.rb
Expand Up @@ -27,7 +27,7 @@ class Photo < ActiveRecord::Base
attr_accessible :name, :description

def display_name
(self.name && self.name.length>0) ? self.name : "#{:created_at.l.downcase}: #{I18n.t(self.created_at, :format => :published_date)}"
(self.name && self.name.length>0) ? self.name : "#{:created_at.l.downcase}: #{I18n.l(self.created_at, :format => :published_date)}"
end

def description_for_rss
Expand Down
2 changes: 1 addition & 1 deletion app/models/post.rb
Expand Up @@ -182,7 +182,7 @@ def has_been_favorited_by(user = nil, remote_ip = nil)
end

def published_at_display(format = 'published_date')
is_live? ? published_at.strftime(I18n.t("time.formats.#{format.to_s}")) : 'Draft'
is_live? ? I18n.l(published_at, :format => format) : 'Draft'
end

end
6 changes: 3 additions & 3 deletions app/views/admin/contests.html.haml
Expand Up @@ -18,11 +18,11 @@

- for contest in @contests
%tr
%td=h I18n.t(contest.created_at, :format => :short_published_date)
%td=h I18n.l(contest.created_at, :format => :short_published_date)
%td=h contest.title
%td=h truncate(contest.post, :length => 250)
%td=h I18n.t(contest.begin_date, :format => :short_published_date)
%td=h I18n.t(contest.end_date, :format => :short_published_date)
%td=h I18n.l(contest.begin_date, :format => :short_published_date)
%td=h I18n.l(contest.end_date, :format => :short_published_date)
%td
= link_to :show.l, contest_path(contest)
%br
Expand Down
4 changes: 2 additions & 2 deletions app/views/comments/_comment.html.haml
Expand Up @@ -8,7 +8,7 @@
%li.update
%a{"href"=> commentable_url(comment), "rel"=>"bookmark"}
%abbr.published{"title"=>"#{comment.created_at}"}
= I18n.t(comment.created_at, :format => :short_literal_date)
= I18n.l(comment.created_at, :format => :short_literal_date)
-if ( comment.can_be_deleted_by(current_user) )
%li.delete=link_to_remote(:delete.l, {:url => comment_path(comment.commentable_type, comment.commentable_id, comment), :method => :delete, 500 => 'alert(\'Sorry, there was a server error\'); return false', :success => visual_effect(:fade, "comment_#{comment.id}"), :confirm => :are_you_sure_you_want_to_permanently_delete_this_comment.l} )
.entry-content= comment.comment
Expand All @@ -25,7 +25,7 @@
%li.update
%a{"href"=> commentable_url(comment), "rel"=>"bookmark"}
%abbr.published{"title"=>"#{comment.created_at}"}
= I18n.t(comment.created_at, :format => :short_literal_date)
= I18n.l(comment.created_at, :format => :short_literal_date)
-if ( comment.can_be_deleted_by(current_user) )
%li.delete=link_to_remote(:delete.l, {:url => comment_path(comment.commentable_type, comment.commentable_id, comment), :method => :delete, 500 => 'alert(\'Sorry, there was a server error\'); return false', :success => visual_effect(:fade, "comment_#{comment.id}"), :confirm => :are_you_sure_you_want_to_permanently_delete_this_comment.l} )
.entry-content= comment.comment
Expand Down
2 changes: 1 addition & 1 deletion app/views/homepage_features/index.html.haml
Expand Up @@ -17,7 +17,7 @@

- for homepage_feature in @homepage_features
%tr
%td=h I18n.t(homepage_feature.created_at, :format => :short_published_date)
%td=h I18n.l(homepage_feature.created_at, :format => :short_published_date)
%td
%a{:href=>"#{h homepage_feature.url}"}=h homepage_feature.title
%td=h truncate(homepage_feature.description, :length => 250)
Expand Down
6 changes: 3 additions & 3 deletions app/views/messages/show.html.haml
Expand Up @@ -11,16 +11,16 @@
=h @message.subject

-unless @message_thread
.right= h I18n.t(@message.created_at, :format => :literal_date)
.right= h I18n.l(@message.created_at, :format => :literal_date)
%pre.clear.message_body= auto_link @message.body
-else
.right= h I18n.t(@message_thread.parent_message.created_at, :format => :literal_date)
.right= h I18n.l(@message_thread.parent_message.created_at, :format => :literal_date)
%pre.clear.message_body= auto_link @message_thread.parent_message.body
%br

- children = @message_thread.parent_message.children
- children.each do |child|
.right=h I18n.t(child.created_at, :format => :literal_date)
.right=h I18n.l(child.created_at, :format => :literal_date)
="<em>#{child.sender.login}</em>:"
%br
%pre.message_body= auto_link child.body
Expand Down
2 changes: 1 addition & 1 deletion app/views/posts/_author_profile.html.haml
Expand Up @@ -10,7 +10,7 @@
- if user.description
= truncate_words( user.description, 12, '...')
%dd.member
=:member_since.l+" #{I18n.t(user.created_at, :format => :short_published_date)}"
=:member_since.l+" #{I18n.l(user.created_at, :format => :short_published_date)}"
%dd.post
- if user.posts.count == 1
= link_to :singular_posts.l(:count => user.posts.count), user_posts_path(user)
Expand Down
2 changes: 1 addition & 1 deletion app/views/posts/manage.html.haml
Expand Up @@ -54,7 +54,7 @@
- @posts.each do |post|
%tr
%td
%abbr{:title=>"#{post.created_at}"}= I18n.t(post.created_at, :format => :published_date)
%abbr{:title=>"#{post.created_at}"}= I18n.l(post.created_at, :format => :published_date)
%td
%abbr{:title=>"#{post.published_at}"}= post.published_at_display
%td
Expand Down
4 changes: 2 additions & 2 deletions app/views/users/_dashboard_nav.html.haml
Expand Up @@ -25,8 +25,8 @@
%h3=:stats.l
%ul
- if @user.last_login_at
%li=:you_last_logged_in_on.l+" #{I18n.t(@user.last_login_at, :format => :published_date)}"
%li=:member_since.l+" #{I18n.t(@user.created_at, :format => :published_date)}"
%li=:you_last_logged_in_on.l+" #{I18n.l(@user.last_login_at, :format => :published_date)}"
%li=:member_since.l+" #{I18n.l(@user.created_at, :format => :published_date)}"
-unless @user.posts.empty?
%li=:you_have_written_blog_posts.l(:count => @user.posts.count)
-unless @user.photos.empty?
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/_profile_user_info_sidebar.html.haml
Expand Up @@ -36,7 +36,7 @@
%li.update
%a{:href=>"#{user_path(@user)}", :rel=>"bookmark"}
%abbr.published{:title=>"#{@user.created_at}"}
=:member_since.l+" #{I18n.t(@user.created_at, :format => :short_published_date)}"
=:member_since.l+" #{I18n.l(@user.created_at, :format => :short_published_date)}"
%li.view
=:profile_views.l
= "(#{@user.view_count})"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/post_test.rb
Expand Up @@ -168,7 +168,7 @@ def test_should_not_set_published_at_if_republishing

def test_should_show_published_at_display
post = posts(:funny_post)
assert_equal post.published_at_display, I18n.t(post.published_at, :format => 'published_date')
assert_equal post.published_at_display, I18n.l(post.published_at, :format => 'published_date')
end

def test_should_show_published_at_display_for_draft
Expand Down

0 comments on commit 11a8bb1

Please sign in to comment.