From a673257eefda08d93d77c8c1e438376e8c0eaa83 Mon Sep 17 00:00:00 2001 From: Ariel Zavala Date: Thu, 16 Sep 2010 15:11:21 -0400 Subject: [PATCH] Added localization to photos views --- app/views/photos/_photo.haml | 2 +- app/views/photos/edit.html.haml | 4 ++-- app/views/photos/new.html.haml | 6 +++--- app/views/photos/show.html.haml | 12 ++++++------ config/locales/en.yml | 8 ++++++++ 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index f0a3f2c83..47ddfef3e 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -21,5 +21,5 @@ .info = link_to(how_long_ago(post), photo_path(post)) \-- - = link_to "show comments (#{post.comments.count})", '#', :class => "show_post_comments" + = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" = render "comments/comments", :post => post diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index f695f850d..1f36ae99f 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -6,7 +6,7 @@ %h1.big_text .back = link_to "⇧ #{@album.name}", album_path(@album) - = "Editing #{@photo.image}" + = "#{t('.editing')} #{@photo.image}" %div{:id => @photo.id} @@ -22,5 +22,5 @@ = link_to "⇧ #{@album.name}", album_path(@album) -if current_user.owns? @album .button.right - = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete + = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index a8814d770..1fdf71a84 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -3,12 +3,12 @@ -# the COPYRIGHT file. -- title "New Photo" +- title t('.new_photo') = form_for( @photo, :html => {:multipart => true}) do |f| = f.error_messages %p = f.file_field :image - = f.submit 'post it!', :class => 'button' + = f.submit t('.post_it'), :class => 'button' -%p= link_to "Back to List", photos_path +%p= link_to t('.back_to_list'), photos_path diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 654bea892..21ce72181 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -25,15 +25,15 @@ %h1 = @photo.image - = link_to "<< prev", url_to_prev(@photo, @album) + = link_to "<< #{t('.prev')}", url_to_prev(@photo, @album) | - = link_to "full size", @photo.url + = link_to "#{t('.full_size')}", @photo.url | - = link_to "next >>", url_to_next(@photo, @album) + = link_to "#{t('.next')} >>", url_to_next(@photo, @album) .right -if current_user.owns? @album - = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" + = link_to t('.edit_photo'), edit_photo_path(@photo), :class => "button" %div{:id => @photo.id} @@ -48,9 +48,9 @@ -if current_user.owns? @album .right - = link_to 'Delete Photo', @photo, :confirm => 'Are you sure?', :method => :delete, :class => 'button' + = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete, :class => 'button' %h4{:class => "show_post_comments"} - = "comments (#{@photo.comments.count})" + = "#{t('.comments')} (#{@photo.comments.count})" = render "comments/comments", :post => @photo diff --git a/config/locales/en.yml b/config/locales/en.yml index 975e40eef..bfcf69939 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -80,5 +80,13 @@ en: comments: "comments" edit: editing: "Editing" + are_you_sure: "Are you sure?" + delete_photo: "Delete Photo" + photo: + show_comments: "show comments" + new: + new_photo: "New Photo" + back_to_list: "Back to List" + post_it: "post it!"