From 241999f72a89f91e67223519991bd0c0cdf24a0b Mon Sep 17 00:00:00 2001 From: Raphael Sofaer <raphael@joindiaspora.com> Date: Fri, 22 Jul 2011 17:58:52 -0700 Subject: [PATCH] MS RS translated reshares --- app/helpers/reshares_helper.rb | 4 ++++ app/views/reshares/_reshare.haml | 6 +++--- app/views/shared/_stream_element.html.haml | 2 +- config/locales/diaspora/en.yml | 10 ++++++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/helpers/reshares_helper.rb b/app/helpers/reshares_helper.rb index 8c6cf0ea6f..6ba1a02417 100644 --- a/app/helpers/reshares_helper.rb +++ b/app/helpers/reshares_helper.rb @@ -6,4 +6,8 @@ module ResharesHelper escape_javascript(t('reshares.create.failure')) end end + + def reshare_link post + link_to t("reshares.reshare.reshare", :count => post.reshares.size), reshares_path(:root_guid => post.guid), :method => :post, :remote => true, :confirm => t('reshares.reshare.reshare_confirmation', :author => post.author.name, :text => post.text) + end end diff --git a/app/views/reshares/_reshare.haml b/app/views/reshares/_reshare.haml index 1c773cdca7..c504e292c7 100644 --- a/app/views/reshares/_reshare.haml +++ b/app/views/reshares/_reshare.haml @@ -9,7 +9,7 @@ .content .right - = link_to "Show Original", post_path(post) + = link_to t("show_original"), post_path(post) %span.from = person_link(post.author, :class => "hovercardable") @@ -19,7 +19,7 @@ = render 'status_messages/status_message', :post => post, :photos => post.photos - if defined?(current_user) && current_user && (post.author_id != current_user.person.id) && (post.public?) && !reshare?(post) %span.reshare_action - = link_to "Reshare", reshares_path(:root_guid => post.guid), :method => :post, :remote => true, :confirm => "Reshare: #{post.author.name} - #{post.text}?" + = reshare_link(post) - else - Original post deleted by author + = t('.deleted') diff --git a/app/views/shared/_stream_element.html.haml b/app/views/shared/_stream_element.html.haml index bb5de8f9c3..5de61e8121 100644 --- a/app/views/shared/_stream_element.html.haml +++ b/app/views/shared/_stream_element.html.haml @@ -61,7 +61,7 @@ - if (post.author_id != current_user.person.id) && (post.public?) && !reshare?(post) · %span.reshare_action - = link_to "#{(post.reshares.size unless post.reshares.size == 0)} Reshare", reshares_path(:root_guid => post.guid), :method => :post, :remote => true, :confirm => "Reshare: #{post.author.name} - #{post.text}?" + = reshare_link(post) · = link_to t('comments.new_comment.comment'), '#', :class => 'focus_comment_textarea' diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 3ca403ccf3..24a291caf7 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -582,6 +582,16 @@ en: many: "%{count} new requests!" other: "%{count} new requests!" reshares: + reshare: + reshare: + zero: "Reshare" + one: "1 Reshare" + few: "%{count} Reshares" + many: "%{count} Reshares" + other: "%{count} Reshares" + show_original: "Show Original" + reshare_confirmation: "Reshare %{author} - %{text}?" + deleted: "Original post deleted by author." create: failure: "There was an error resharing this post." services: -- GitLab