aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2011-07-01 09:12:27 +1200
committerPhilip Arndt <parndt@gmail.com>2011-07-01 09:12:27 +1200
commit47a71b309f4fb364449167ddc6ed978b6969e047 (patch)
tree842ef03d0fbec90a14666cdeaf6285d54d6feed0 /app
parent46021c66f476747a21ee62bf7acbcd9cb169bd25 (diff)
downloadrefinerycms-blog-47a71b309f4fb364449167ddc6ed978b6969e047.tar.gz
refinerycms-blog-47a71b309f4fb364449167ddc6ed978b6969e047.tar.bz2
refinerycms-blog-47a71b309f4fb364449167ddc6ed978b6969e047.zip
Making use of translation scopes.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/blog/comments_controller.rb4
-rw-r--r--app/controllers/admin/blog/settings_controller.rb2
-rw-r--r--app/controllers/blog/posts_controller.rb4
-rw-r--r--app/helpers/blog_posts_helper.rb2
-rw-r--r--app/views/admin/blog/categories/_category.html.erb2
-rw-r--r--app/views/admin/blog/categories/_form.html.erb2
-rw-r--r--app/views/admin/blog/categories/index.html.erb6
-rw-r--r--app/views/admin/blog/comments/index.html.erb6
-rw-r--r--app/views/admin/blog/posts/_form.html.erb8
-rw-r--r--app/views/admin/blog/posts/_post.html.erb7
-rw-r--r--app/views/admin/blog/posts/_teaser_part.html.erb4
-rw-r--r--app/views/admin/blog/posts/index.html.erb6
-rw-r--r--app/views/admin/blog/posts/uncategorized.html.erb6
-rw-r--r--app/views/blog/posts/_comment.html.erb4
-rw-r--r--app/views/blog/posts/_nav.html.erb2
-rw-r--r--app/views/blog/posts/_post.html.erb7
-rw-r--r--app/views/blog/posts/show.html.erb2
-rw-r--r--app/views/blog/shared/_post.html.erb11
18 files changed, 45 insertions, 40 deletions
diff --git a/app/controllers/admin/blog/comments_controller.rb b/app/controllers/admin/blog/comments_controller.rb
index 0dc1db5..f07abed 100644
--- a/app/controllers/admin/blog/comments_controller.rb
+++ b/app/controllers/admin/blog/comments_controller.rb
@@ -16,7 +16,7 @@ class Admin::Blog::CommentsController < Admin::BaseController
else
@blog_comment = BlogComment.find(params[:id])
@blog_comment.approve!
- flash[:notice] = t('admin.blog.comments.approved', :author => @blog_comment.name)
+ flash[:notice] = t('approved', :scope => 'admin.blog.comments', :author => @blog_comment.name)
redirect_to :action => params[:return_to] || 'index'
end
end
@@ -28,7 +28,7 @@ class Admin::Blog::CommentsController < Admin::BaseController
else
@blog_comment = BlogComment.find(params[:id])
@blog_comment.reject!
- flash[:notice] = t('admin.blog.comments.rejected', :author => @blog_comment.name)
+ flash[:notice] = t('rejected', :scope => 'admin.blog.comments', :author => @blog_comment.name)
redirect_to :action => params[:return_to] || 'index'
end
end
diff --git a/app/controllers/admin/blog/settings_controller.rb b/app/controllers/admin/blog/settings_controller.rb
index a805d9c..eb1eef9 100644
--- a/app/controllers/admin/blog/settings_controller.rb
+++ b/app/controllers/admin/blog/settings_controller.rb
@@ -5,7 +5,7 @@ class Admin::Blog::SettingsController < Admin::BaseController
if request.post?
BlogComment::Notification.recipients = params[:recipients]
- flash[:notice] = t('admin.blog.settings.notification_recipients.updated',
+ flash[:notice] = t('updated', :scope => 'admin.blog.settings.notification_recipients'
:recipients => BlogComment::Notification.recipients)
unless request.xhr? or from_dialog?
redirect_back_or_default(admin_blog_posts_path)
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb
index 4ea2e73..fd1cd1b 100644
--- a/app/controllers/blog/posts_controller.rb
+++ b/app/controllers/blog/posts_controller.rb
@@ -33,10 +33,10 @@ class Blog::PostsController < BlogController
end
if BlogComment::Moderation.enabled?
- flash[:notice] = t('blog.posts.comments.thank_you_moderated')
+ flash[:notice] = t('thank_you_moderated', :scope => 'blog.posts.comments')
redirect_to blog_post_url(params[:id])
else
- flash[:notice] = t('blog.posts.comments.thank_you')
+ flash[:notice] = t('thank_you', :scope => 'blog.posts.comments')
redirect_to blog_post_url(params[:id],
:anchor => "comment-#{@blog_comment.to_param}")
end
diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb
index 357ddac..a15de1d 100644
--- a/app/helpers/blog_posts_helper.rb
+++ b/app/helpers/blog_posts_helper.rb
@@ -3,7 +3,7 @@ module BlogPostsHelper
posts = BlogPost.select('published_at').all_previous
return nil if posts.blank?
html = '<section id="blog_archive_list"><h2>'
- html << t('blog.shared.archives')
+ html << t('archives', :scope => 'blog.shared')
html << '</h2><nav><ul>'
links = []
super_old_links = []
diff --git a/app/views/admin/blog/categories/_category.html.erb b/app/views/admin/blog/categories/_category.html.erb
index d8c8a61..191f649 100644
--- a/app/views/admin/blog/categories/_category.html.erb
+++ b/app/views/admin/blog/categories/_category.html.erb
@@ -11,6 +11,6 @@
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
- :confirm => t('shared.admin.delete.message', :title => category.title) %>
+ :confirm => t('message', :scope => 'shared.admin.delete', :title => category.title) %>
</span>
</li>
diff --git a/app/views/admin/blog/categories/_form.html.erb b/app/views/admin/blog/categories/_form.html.erb
index f55992a..bfcbc7b 100644
--- a/app/views/admin/blog/categories/_form.html.erb
+++ b/app/views/admin/blog/categories/_form.html.erb
@@ -14,6 +14,6 @@
:locals => {
:f => f,
:continue_editing => false,
- :delete_title => t('admin.blog.categories.category.delete')
+ :delete_title => t('delete', :scope => 'admin.blog.categories.category')
} %>
<% end %>
diff --git a/app/views/admin/blog/categories/index.html.erb b/app/views/admin/blog/categories/index.html.erb
index 60ade7a..5d17d42 100644
--- a/app/views/admin/blog/categories/index.html.erb
+++ b/app/views/admin/blog/categories/index.html.erb
@@ -1,12 +1,12 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_categories.any? %>
<%= render :partial => "blog_categories",
:collection => @blog_categories %>
<% else %>
- <p><%= t('admin.search_no_results') %></p>
+ <p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_categories.any? %>
@@ -18,7 +18,7 @@
<% else %>
<p>
<strong>
- <%= t('.no_items_yet', :create => t('admin.blog.submenu.categories.new')) %>
+ <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.categories')) %>
</strong>
</p>
<% end %>
diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/admin/blog/comments/index.html.erb
index fbf268d..aaec4ae 100644
--- a/app/views/admin/blog/comments/index.html.erb
+++ b/app/views/admin/blog/comments/index.html.erb
@@ -1,7 +1,7 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_comments.any? %>
<%=# will_paginate @blog_comments
%>
@@ -14,7 +14,7 @@
<%=# will_paginate @blog_comments
%>
<% else %>
- <p><%= t('admin.search_no_results') %></p>
+ <p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_comments.any? %>
@@ -28,7 +28,7 @@
<% else %>
<h3>
<%= t('.no_items_yet',
- :type => t("admin.blog.submenu.comments.#{action_name.gsub('index', 'new')}").downcase) %>
+ :type => t(action_name.gsub('index', 'new'), :scope => 'admin.blog.submenu.comments').downcase) %>
</h3>
<% end %>
<% end %>
diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/admin/blog/posts/_form.html.erb
index 13dbcf3..c891b63 100644
--- a/app/views/admin/blog/posts/_form.html.erb
+++ b/app/views/admin/blog/posts/_form.html.erb
@@ -14,10 +14,10 @@
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
<ul id='page_parts'>
<li class='ui-state-default ui-state-active'>
- <%= link_to t('activerecord.attributes.blog_post.body'), "#page_part_body" %>
+ <%= link_to t('body', :scope => 'activerecord.attributes.blog_post'), "#page_part_body" %>
</li>
<li class='ui-state-default'>
- <%= link_to t('activerecord.attributes.blog_post.teaser'), "#page_part_teaser" %>
+ <%= link_to t('teaser', :scope => 'activerecord.attributes.blog_post'), "#page_part_teaser" %>
</li>
<% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %>
<li class='ui-state-default' id="custom_<%= tab.name %>_tab">
@@ -66,7 +66,7 @@
</div>
<div id='more_options' style="display:none;">
<div class="hemisquare">
- <h3><%= t('admin.blog.submenu.categories.title') %></h3>
+ <h3><%= t('title', :scope => 'admin.blog.submenu.categories') %></h3>
<ul class='blog_categories'>
<% @blog_categories.each do |category| %>
<li>
@@ -99,7 +99,7 @@
:locals => {
:f => f,
:continue_editing => true,
- :delete_title => t('admin.blog.posts.post.delete')
+ :delete_title => t('delete', :scope => 'admin.blog.posts.post')
} %>
<% end -%>
diff --git a/app/views/admin/blog/posts/_post.html.erb b/app/views/admin/blog/posts/_post.html.erb
index 1226082..a7f09e0 100644
--- a/app/views/admin/blog/posts/_post.html.erb
+++ b/app/views/admin/blog/posts/_post.html.erb
@@ -1,7 +1,10 @@
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(post) -%>">
<span class='title'>
<%= post.title %>
- <span class="preview"><%= post.published_at.try(:strftime, '%b %d, %Y') || 'draft' %><%= " by #{post.author.username}" if post.author.present? %></span>
+ <span class="preview">
+ <%= post.published_at.try(:strftime, '%b %d, %Y') || 'draft' %>
+ <%= " by #{post.author.username}" if post.author.present? %>
+ </span>
</span>
<span class='actions'>
<%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post),
@@ -13,6 +16,6 @@
:class => "cancel confirm-delete",
:title => t('.delete'),
:method => :delete,
- :confirm => t('shared.admin.delete.message', :title => post.title) %>
+ :confirm => t('message', :scope => 'shared.admin.delete', :title => post.title) %>
</span>
</li>
diff --git a/app/views/admin/blog/posts/_teaser_part.html.erb b/app/views/admin/blog/posts/_teaser_part.html.erb
index d615812..71d7d01 100644
--- a/app/views/admin/blog/posts/_teaser_part.html.erb
+++ b/app/views/admin/blog/posts/_teaser_part.html.erb
@@ -2,9 +2,9 @@
<%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%>
<p>
<span class='clearfix label_inline_with_link'>
- <%= link_to t('admin.blog.posts.form.copy_body'), "#",
+ <%= link_to t('copy_body', :scope => 'admin.blog.posts.form'), "#",
:id => 'copy_body_link',
- :title => t('admin.blog.posts.form.copy_body_help') %>
+ :title => t('copy_body_help', :scope => 'admin.blog.posts.form') %>
</span>
</p>
</div>
diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb
index f9baaac..90a6a6e 100644
--- a/app/views/admin/blog/posts/index.html.erb
+++ b/app/views/admin/blog/posts/index.html.erb
@@ -1,14 +1,14 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_posts.any? %>
<ul>
<%= render :partial => "post",
:collection => @blog_posts %>
</ul>
<% else %>
- <p><%= t('shared.admin.search.no_results') %></p>
+ <p><%= t('no_results', :scope => 'shared.admin.search') %></p>
<% end %>
<% else %>
<% if @blog_posts.any? %>
@@ -20,7 +20,7 @@
<% else %>
<p>
<strong>
- <%= t('.no_items_yet', :create => t('admin.blog.submenu.posts.new')) %>
+ <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %>
</strong>
</p>
<% end %>
diff --git a/app/views/admin/blog/posts/uncategorized.html.erb b/app/views/admin/blog/posts/uncategorized.html.erb
index 888daab..19d9e20 100644
--- a/app/views/admin/blog/posts/uncategorized.html.erb
+++ b/app/views/admin/blog/posts/uncategorized.html.erb
@@ -1,12 +1,12 @@
<%= render :partial => '/admin/blog/submenu' %>
<div id='records'>
<% if searching? %>
- <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
+ <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2>
<% if @blog_posts.any? %>
<%= render :partial => "blog_posts",
:collection => @blog_posts %>
<% else %>
- <p><%= t('admin.search_no_results') %></p>
+ <p><%= t('search_no_results', :scope => 'admin') %></p>
<% end %>
<% else %>
<% if @blog_posts.any? %>
@@ -18,7 +18,7 @@
<% else %>
<p>
<strong>
- <%= t('.no_items_yet', :create => t('admin.blog.submenu.posts.new')) %>
+ <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %>
</strong>
</p>
<% end %>
diff --git a/app/views/blog/posts/_comment.html.erb b/app/views/blog/posts/_comment.html.erb
index 17b2002..5503826 100644
--- a/app/views/blog/posts/_comment.html.erb
+++ b/app/views/blog/posts/_comment.html.erb
@@ -3,8 +3,8 @@
<%= simple_format auto_link(comment.message.to_s) %>
<footer class='blog_comment_author'>
<p>
- <%= t('blog.posts.comments.by', :who => comment.name) %>,
- <%= t('blog.posts.comments.time_ago', :time => time_ago_in_words(comment.created_at)) %>
+ <%= t('by', :scope => 'blog.posts.comments', :who => comment.name) %>,
+ <%= t('time_ago', :scope => 'blog.posts.comments', :time => time_ago_in_words(comment.created_at)) %>
</p>
</footer>
</article>
diff --git a/app/views/blog/posts/_nav.html.erb b/app/views/blog/posts/_nav.html.erb
index c73a294..df4b435 100644
--- a/app/views/blog/posts/_nav.html.erb
+++ b/app/views/blog/posts/_nav.html.erb
@@ -3,7 +3,7 @@
<%= link_to (truncate(@blog_post.next.title) + " &#187;").html_safe, @blog_post.next, :class => 'next' %>
<% end -%>
- <%= link_to t('blog.posts.show.blog_home'), blog_root_path, :class => 'home' %>
+ <%= link_to t('blog_home', :scope => 'blog.posts.show'), blog_root_path, :class => 'home' %>
<% if @blog_post.prev.present? -%>
<%= link_to ("&#171; " + truncate(@blog_post.prev.title)).html_safe, @blog_post.prev, :class => 'prev' %>
diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb
index 6d715c3..12978d3 100644
--- a/app/views/blog/posts/_post.html.erb
+++ b/app/views/blog/posts/_post.html.erb
@@ -8,11 +8,12 @@
<h1><%= @blog_post.title %></h1>
<section class='details'>
<time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'>
- <%= t('blog.shared.posts.created_at', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
- </time><%= "#{t('blog.posts.show.by')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
+ <%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %>
+ </time>
+ <%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>.
<% if (categories = @blog_post.categories).any? %>
<aside class='filed_in'>
- <%= t('blog.posts.show.filed_in') %>
+ <%= t('filed_in', :scope => 'blog.posts.show') %>
<% categories.each_with_index do |category, index| %>
<%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
<% end %>
diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb
index 97b8af2..cc763a8 100644
--- a/app/views/blog/posts/show.html.erb
+++ b/app/views/blog/posts/show.html.erb
@@ -10,7 +10,7 @@
<%= render :partial => "comment", :collection => comments %>
<% else %>
<p>
- <%= t('blog.shared.comments.none') %>.
+ <%= t('none', :scope => 'blog.shared.comments') %>.
</p>
<% end %>
diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb
index 2281691..0f65e1d 100644
--- a/app/views/blog/shared/_post.html.erb
+++ b/app/views/blog/shared/_post.html.erb
@@ -4,8 +4,9 @@
<h1><%= link_to post.title, blog_post_url(post) %></h1>
<section class='details'>
<time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'>
- <%= t('blog.shared.posts.created_at', :when => l(post.published_at.to_date, :format => :short)) %>
- </time><%= "#{t('blog.posts.show.by')} #{post.author.username}" if post.author.present? %>.
+ <%= t('created_at', :scope => 'blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %>
+ </time>
+ <%= "#{t('by', :scope => 'blog.posts.show')} #{post.author.username}" if post.author.present? %>.
<% if (categories = post.categories).any? %>
<aside class='filed_in'>
<%= t('filed_in', :scope => 'blog.posts.show') %>
@@ -25,14 +26,14 @@
</section>
<footer>
<p>
- <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
+ <%= link_to t('read_more', :scope => 'blog.shared.posts'), blog_post_url(post) %>
</p>
<aside class='comment_count'>
<% if BlogPost.comments_allowed? %>
<% if post.comments.any? %>
- (<%= pluralize(post.comments.approved.count, t('blog.shared.comments.singular')) %>)
+ (<%= pluralize(post.comments.approved.count, t('singular', :scope => 'blog.shared.comments')) %>)
<% else %>
- (<%= t('blog.shared.comments.none') %>)
+ (<%= t('none', :scope => 'blog.shared.comments') %>)
<% end %>
<% end %>
</aside>