Add translations for notification types

This commit is contained in:
Andreas Nedbal 2022-07-07 01:15:20 +02:00 committed by Georg Gadinger
parent 52218bf1d0
commit af327b3f08
4 changed files with 30 additions and 28 deletions

View File

@ -4,19 +4,18 @@
.media-body .media-body
.notification__heading .notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) } %img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user = t(".heading_html",
answered user: user_screen_name(notification.target.user),
= link_to 'your question', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id) question: link_to(t(".link_text"), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.id)),
= time_tooltip(notification.target) time: time_tooltip(notification.target))
ago
.list-group .list-group
.list-group-item .list-group-item
.media.question-media .media.question-media
.media-body .media-body
%h6.notification__list-heading question %h6.notification__list-heading= t("activerecord.models.question.one")
= markdown notification.target.question.content[0..60] + (notification.target.question.content.length > 60 ? '[...]' : '') = markdown notification.target.question.content[0..60] + (notification.target.question.content.length > 60 ? '[...]' : '')
.list-group-item .list-group-item
.media.question-media .media.question-media
.media-body .media-body
%h6.notification__list-heading answer %h6.notification__list-heading= t("activerecord.models.answer.one")
= markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '') = markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '')

View File

@ -4,25 +4,29 @@
.media-body .media-body
.notification__heading .notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) } %img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user
commented on
- if notification.target.answer.user == current_user - if notification.target.answer.user == current_user
= link_to 'your answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) = t(".active.heading_html",
user: user_screen_name(notification.target.user),
answer: link_to(t(".active.link_text"), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)),
time: time_tooltip(notification.target))
- elsif notification.target.user == notification.target.answer.user - elsif notification.target.user == notification.target.answer.user
= link_to 'their answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) = t(".passive.heading_html",
user: user_screen_name(notification.target.user),
answer: link_to(t(".passive.link_text"), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)),
time: time_tooltip(notification.target))
- else - else
= link_to "#{notification.target.answer.user.screen_name}'s answer", = t(".other.heading_html",
show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id) user: user_screen_name(notification.target.user),
= time_tooltip(notification.target) answer: link_to(t(".other.link_text", user: user_screen_name(notification.target.answer.user)), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.answer.id)),
ago time: time_tooltip(notification.target))
.list-group .list-group
.list-group-item .list-group-item
.media.question-media .media.question-media
.media-body .media-body
%h6.notification__list-heading answer %h6.notification__list-heading= t("activerecord.models.answer.one")
= markdown notification.target.answer.content[0..60] + (notification.target.answer.content.length > 60 ? '[...]' : '') = markdown notification.target.answer.content[0..60] + (notification.target.answer.content.length > 60 ? '[...]' : '')
.list-group-item .list-group-item
.media.question-media .media.question-media
.media-body .media-body
%h6.notification__list-heading comment %h6.notification__list-heading= t("activerecord.models.comment.one")
= markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '') = markdown notification.target.content[0..60] + (notification.target.content.length > 60 ? '[...]' : '')

View File

@ -5,4 +5,4 @@
%h6.media-heading.notification__user %h6.media-heading.notification__user
= user_screen_name notification.target.source = user_screen_name notification.target.source
.notification__text .notification__text
= raw t('views.notifications.relationship.body', time: time_ago_in_words(notification.target.created_at)) = t(".heading_html", time: time_ago_in_words(notification.target.created_at))

View File

@ -4,20 +4,19 @@
.media-body .media-body
.notification__heading .notification__heading
%img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) } %img.avatar-xs{ src: notification.target.user.profile_picture.url(:small) }
= user_screen_name notification.target.user
smiled
- if notification.target.parent_type == 'Answer' - if notification.target.parent_type == 'Answer'
= link_to 'your answer', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.parent.id) = t(".#{notification.target.parent_type.downcase}.heading_html",
user: user_screen_name(notification.target.user),
type: link_to(t(".#{notification.target.parent_type.downcase}.link_text"), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.parent.id)),
time: time_tooltip(notification.target))
- elsif notification.target.parent_type == 'Comment' - elsif notification.target.parent_type == 'Comment'
= link_to 'your comment', show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.parent.answer.id) = t(".#{notification.target.parent_type.downcase}.heading_html",
= time_tooltip(notification.target) user: user_screen_name(notification.target.user),
ago type: link_to(t(".#{notification.target.parent_type.downcase}.link_text"), show_user_answer_path(username: notification.target.user.screen_name, id: notification.target.parent.answer.id)),
time: time_tooltip(notification.target))
.list-group .list-group
.list-group-item .list-group-item
.media.question-media .media.question-media
.media-body .media-body
- if notification.target.parent_type == 'Answer' %h6.notification__list-heading= t("activerecord.models.#{notification.target.parent_type.downcase}.one")
%h6.notification__list-heading answer
- elsif notification.target.parent_type == 'Comment'
%h6.notification__list-heading comment
= markdown notification.target.parent.content[0..60] + (notification.target.parent.content.length > 60 ? '[...]' : '') = markdown notification.target.parent.content[0..60] + (notification.target.parent.content.length > 60 ? '[...]' : '')