diff --git a/app/helpers/reshares_helper.rb b/app/helpers/reshares_helper.rb index 8c6cf0ea6f7115745f93eec14b18e3b5718d3905..6ba1a0241790357b0a822ac365e43d6dc3f09d16 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 1c773cdca7401db96e105a83cd65271fba257b7e..c504e292c777f1b57c53af1f81ec007e9e1bc413 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 bb5de8f9c3c2211a1c6d63a8e9e5cd17ee1d56ca..5de61e81218ee387d8cb05a0e1fb41fa493b7aae 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 3ca403ccf3edf6b122ba6efc729e284541377e44..24a291caf74ad97d985b5964eb239bb23afa921a 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: