diff options
author | Philip Arndt <parndt@gmail.com> | 2013-05-12 07:56:06 -0700 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2013-05-12 07:56:06 -0700 |
commit | d29fb394748fab37fffda7fc0cfd0f2aa400ae28 (patch) | |
tree | 5cddcdc32d378cb82f1f5a035a2a57e0c611b253 | |
parent | 8a41b59d6e6d0a44f2db7d4afba80f96dc342bed (diff) | |
parent | 04f7aa2ee2b976d80b1b4c9a6d2df6fdb7caacdd (diff) | |
download | refinerycms-blog-d29fb394748fab37fffda7fc0cfd0f2aa400ae28.tar.gz refinerycms-blog-d29fb394748fab37fffda7fc0cfd0f2aa400ae28.tar.bz2 refinerycms-blog-d29fb394748fab37fffda7fc0cfd0f2aa400ae28.zip |
Merge pull request #328 from jerefrer/master
Uses I18n.localize instead of strftime for posts#archives title and no_articles message (plus small fr locale fix)
-rw-r--r-- | app/controllers/refinery/blog/posts_controller.rb | 12 | ||||
-rw-r--r-- | app/views/refinery/blog/posts/archive.html.erb | 6 | ||||
-rw-r--r-- | config/locales/fr.yml | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/app/controllers/refinery/blog/posts_controller.rb b/app/controllers/refinery/blog/posts_controller.rb index b5caa33..999b49a 100644 --- a/app/controllers/refinery/blog/posts_controller.rb +++ b/app/controllers/refinery/blog/posts_controller.rb @@ -56,14 +56,14 @@ module Refinery def archive if params[:month].present? date = "#{params[:month]}/#{params[:year]}" - @archive_date = Time.parse(date) - @date_title = @archive_date.strftime('%B %Y') - @posts = Post.live.by_month(@archive_date).page(params[:page]) + archive_date = Time.parse(date) + @date_title = ::I18n.l(archive_date, :format => '%B %Y') + @posts = Post.live.by_month(archive_date).page(params[:page]) else date = "01/#{params[:year]}" - @archive_date = Time.parse(date) - @date_title = @archive_date.strftime('%Y') - @posts = Post.live.by_year(@archive_date).page(params[:page]) + archive_date = Time.parse(date) + @date_title = ::I18n.l(archive_date, :format => '%Y') + @posts = Post.live.by_year(archive_date).page(params[:page]) end respond_with (@posts) end diff --git a/app/views/refinery/blog/posts/archive.html.erb b/app/views/refinery/blog/posts/archive.html.erb index 31b5c1e..86a648c 100644 --- a/app/views/refinery/blog/posts/archive.html.erb +++ b/app/views/refinery/blog/posts/archive.html.erb @@ -1,13 +1,13 @@ -<% content_for :title, "#{t('.blog_archive_for', :date => @archive_date.strftime('%B %Y'))}" %> +<% content_for :title, "#{t('.blog_archive_for', :date => @date_title)}" %> <% content_for :body do %> - <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> + <h1><%= t('.blog_archive_for', :date => @date_title) %></h1> <% if @posts.any? %> <section id="blog_posts"> <%= render :partial => "/refinery/blog/shared/post", :collection => @posts %> </section> <% else %> - <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p> + <p><%= t('.no_blog_articles_posted', :date => @date_title) %></p> <% end %> <% end %> diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 04956c1..111bb6d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -150,8 +150,8 @@ fr: no_blog_articles_yet: "Il n'y a aucun article pour l'instant. Restez en alerte." posts_tagged: Articles taggés archive: - blog_archive_for: 'Archive du blog pour le %{date}' - no_blog_articles_posted: "Il n'y a aucun article pour la date du %{date}. Restez en alerte." + blog_archive_for: 'Archive du blog pour %{date}' + no_blog_articles_posted: "Il n'y a aucun article pour %{date}. Restez en alerte." activerecord: models: refinery/blog/category: Catégorie |