diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index e722797bf..e6be832d3 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -1,6 +1,6 @@ module NotificationsHelper def object_link(note) - target_type = note.translation_key + target_type = note.popup_translation_key if note.instance_of?(Notifications::Mentioned) post = Mention.find(note.target_id).post if post @@ -8,10 +8,6 @@ module NotificationsHelper else "#{translation(target_type)} #{t('notifications.deleted')} #{t('notifications.post')}" end - elsif note.instance_of?(Notifications::RequestAccepted) - translation(target_type) - elsif note.instance_of?(Notifications::NewRequest) - translation(target_type) elsif note.instance_of?(Notifications::CommentOnPost) post = Post.where(:id => note.target_id).first if post @@ -26,11 +22,13 @@ module NotificationsHelper else t('notifications.also_commented_deleted') end + else #Notifications::NewRequest, Notifications::RequestAccepted, Notifications::Liked, etc. + translation(target_type) end end def translation(target_type, post_author = nil) - t("notifications.#{target_type}", :post_author => post_author) + t("#{target_type}", :post_author => post_author) end diff --git a/app/models/notifications/also_commented.rb b/app/models/notifications/also_commented.rb index f31341cf5..61b1346d3 100644 --- a/app/models/notifications/also_commented.rb +++ b/app/models/notifications/also_commented.rb @@ -2,7 +2,7 @@ class Notifications::AlsoCommented < Notification def mail_job Job::MailAlsoCommented end - def translation_key - 'also_commented' + def popup_translation_key + 'notifications.also_commented' end end diff --git a/app/models/notifications/comment_on_post.rb b/app/models/notifications/comment_on_post.rb index 096b9d885..7235daadb 100644 --- a/app/models/notifications/comment_on_post.rb +++ b/app/models/notifications/comment_on_post.rb @@ -2,7 +2,7 @@ class Notifications::CommentOnPost < Notification def mail_job Job::MailCommentOnPost end - def translation_key - 'comment_on_post' + def popup_translation_key + 'notifications.comment_on_post' end end diff --git a/app/models/notifications/liked.rb b/app/models/notifications/liked.rb index 1039edbc9..8b32b9eb5 100644 --- a/app/models/notifications/liked.rb +++ b/app/models/notifications/liked.rb @@ -2,7 +2,7 @@ class Notifications::Liked < Notification def mail_job Job::MailLiked end - def translation_key - 'liked' + def popup_translation_key + 'notifications.liked' end end diff --git a/app/models/notifications/mentioned.rb b/app/models/notifications/mentioned.rb index 34cdb44c0..e7a2d3e75 100644 --- a/app/models/notifications/mentioned.rb +++ b/app/models/notifications/mentioned.rb @@ -2,7 +2,7 @@ class Notifications::Mentioned < Notification def mail_job Job::MailMentioned end - def translation_key - 'mentioned' + def popup_translation_key + 'notifications.mentioned' end end diff --git a/app/models/notifications/new_request.rb b/app/models/notifications/new_request.rb index 0f80bd656..9c440fee5 100644 --- a/app/models/notifications/new_request.rb +++ b/app/models/notifications/new_request.rb @@ -2,7 +2,7 @@ class Notifications::NewRequest < Notification def mail_job Job::MailRequestReceived end - def translation_key - 'new_request' + def popup_translation_key + 'notifications.new_request' end end diff --git a/app/models/notifications/private_message.rb b/app/models/notifications/private_message.rb index 3044816c8..394442cba 100644 --- a/app/models/notifications/private_message.rb +++ b/app/models/notifications/private_message.rb @@ -2,8 +2,8 @@ class Notifications::PrivateMessage < Notification def mail_job Job::MailPrivateMessage end - def translation_key - 'private_message' + def popup_translation_key + 'notifications.private_message' end def self.make_notification(recipient, target, actor, notification_type) n = notification_type.new(:target => target, diff --git a/app/models/notifications/request_accepted.rb b/app/models/notifications/request_accepted.rb index 226c57f7a..4486a5021 100644 --- a/app/models/notifications/request_accepted.rb +++ b/app/models/notifications/request_accepted.rb @@ -2,7 +2,7 @@ class Notifications::RequestAccepted < Notification def mail_job Job::MailRequestAcceptance end - def translation_key - 'request_accepted' + def popup_translation_key + 'notifications.request_accepted' end end diff --git a/app/views/notifier/liked.html.haml b/app/views/notifier/liked.html.haml index 5b52c3db4..a9b3bac35 100644 --- a/app/views/notifier/liked.html.haml +++ b/app/views/notifier/liked.html.haml @@ -2,11 +2,12 @@ = t('notifier.hello', :name => @receiver.profile.first_name) %p = t('.liked', :name => "#{@sender.name} (#{@sender.diaspora_handle})") + = @like.post.text %br = link_to t('.sign_in'), status_message_url(@like.post) %br - = t('notifier.love') + = t('notifier.love') %br = t('notifier.diaspora') diff --git a/app/views/notifier/liked.text.haml b/app/views/notifier/liked.text.haml index 1a8e523d8..754ff34fc 100644 --- a/app/views/notifier/liked.text.haml +++ b/app/views/notifier/liked.text.haml @@ -1,7 +1,6 @@ != t('notifier.hello', :name => @receiver.profile.first_name) -!= t('.liked', :name => "#{@sender.name} (#{@sender.diaspora_handle})") +!= t('notifier.liked.liked', :name => "#{@sender.name} (#{@sender.diaspora_handle})") +!= @like.post.text -!= link_to t('.sign_in'), status_message_url(@like.post) - -!= t('notifier.love') +!= t('notifier.love') != t('notifier.diaspora') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index fd6f7959c..993bceeb3 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -290,6 +290,7 @@ en: comment_on_post: "commented on your" also_commented: "also commented on %{post_author}'s" mentioned: "has mentioned you in a " + liked: "has just liked your post" post: "post." deleted: "deleted" also_commented_deleted: "commented on a deleted post." @@ -343,7 +344,7 @@ en: sign_in: "Sign in to view it." liked: subject: "%{name} has just liked your post" - liked: "%{name} has just liked your post" + liked: "%{name} has just liked your post: " sign_in: "Sign to view it" people: