From c1e5a83f157195af94cf7de59db474d6bf2f812d Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Mon, 18 Jul 2011 23:37:38 +0200 Subject: [PATCH] Fix for issue #1603 - use different i18n string for comment likes count --- app/views/comments/_comment.html.haml | 2 +- app/views/likes/_likes_container.haml | 10 ++++++++-- app/views/shared/_stream_element.html.haml | 2 +- config/locales/diaspora/en.yml | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 909398112..64c537d47 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -21,7 +21,7 @@ = comment.created_at ? timeago(comment.created_at) : timeago(Time.now) .likes - = render "likes/likes_container", :target_id => comment.id, :likes_count => comment.likes_count + = render "likes/likes_container", :target_id => comment.id, :likes_count => comment.likes_count, :target_type => "Comment" - unless (defined?(@commenting_disabled) && @commenting_disabled) %span.like_action diff --git a/app/views/likes/_likes_container.haml b/app/views/likes/_likes_container.haml index 0a8ea4de0..ef278ac05 100644 --- a/app/views/likes/_likes_container.haml +++ b/app/views/likes/_likes_container.haml @@ -6,9 +6,15 @@ - if likes_count > 0 = image_tag('icons/heart.svg') - if defined?(likes_index_link) && likes_index_link - = link_to t('likes.likes.people_like_this', :count => likes_count), post_likes_path(target_id), :class => "expand_likes" + - if target_type == "Comment" + = link_to t('likes.likes.people_like_this_comment', :count => likes_count), post_likes_path(target_id), :class => "expand_likes" + - else + = link_to t('likes.likes.people_like_this', :count => likes_count), post_likes_path(target_id), :class => "expand_likes" - else - = t('likes.likes.people_like_this', :count => likes_count) + - if target_type == "Comment" + = t('likes.likes.people_like_this_comment', :count => likes_count) + - else + = t('likes.likes.people_like_this', :count => likes_count) %span.hidden.likes_list /= render 'likes/likes', :likes => likes diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index 0c1d4769a..b20f01815 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -56,6 +56,6 @@ = link_to t('comments.new_comment.comment'), '#', :class => 'focus_comment_textarea' .likes.on_post - = render "likes/likes_container", :target_id => post.id, :likes_count => post.likes_count, :current_user => current_user, :likes_index_link => true + = render "likes/likes_container", :target_id => post.id, :likes_count => post.likes_count, :current_user => current_user, :likes_index_link => true, :target_type => "Post" = render "comments/comments", :post => post, :current_user => current_user, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index b08d09126..21337e7d9 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -316,6 +316,12 @@ en: few: "%{count} likes" many: "%{count} likes" other: "%{count} likes" + people_like_this_comment: + zero: "no likes" + one: "%{count} like" + few: "%{count} likes" + many: "%{count} likes" + other: "%{count} likes" people_dislike_this: zero: "no dislikes" one: "%{count} dislike"