From b551b7acdb0e7d60656fa6eea6a2da08be58b43f Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 7 Jul 2022 01:15:43 +0200 Subject: [PATCH] Add translations for notification navigation --- app/views/navigation/main/_notifications.haml | 8 ++-- config/locales/views.en.yml | 43 +++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/app/views/navigation/main/_notifications.haml b/app/views/navigation/main/_notifications.haml index ee192700..75d80928 100644 --- a/app/views/navigation/main/_notifications.haml +++ b/app/views/navigation/main/_notifications.haml @@ -6,16 +6,16 @@ %i.fa.fa-bell-o - else %i.fa.fa-bell - %span.sr-only Notifications + %span.sr-only= t('views.navigation.notifications') %span.badge= notification_count .dropdown-menu.dropdown-menu-right.notification-dropdown - if notifications.count.zero? .dropdown-item.text-center.p-2 %i.fa.fa-bell-o.notification__bell-icon - %p No new notifications. + %p= t(".none") %a.dropdown-item.text-center{ href: notifications_path('all') } %i.fa.fa-fw.fa-chevron-right - Show all notifications + = t(".all") - else - notifications.each do |notification| .dropdown-item @@ -23,4 +23,4 @@ %a.dropdown-item.text-center{ href: notifications_path } %i.fa.fa-fw.fa-chevron-right - Show all new notifications + = t(".new") diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 38b8fd7b..4a6e7961 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -102,6 +102,41 @@ en: permanent: "Permanent" until: "Until %{until}" expired: "Expired at %{until}" + navigation: + main: + notifications: + none: :notifications.index.none + all: "Show all notifications" + new: "Show all new notifications" + notifications: + index: + none_filtered: "No notifications." + none: "No new notifications." + type: + answer: + heading_html: "%{user} answered %{question} %{time} ago" + link_text: "your question" + comment: + heading: "%{user} commented on %{answer} %{time} ago" + active: + heading_html: :notifications.type.comment.heading + link_text: "your answer" + passive: + heading_html: :notifications.type.comment.heading + link_text: "their answer" + other: + heading_html: :notifications.type.comment.heading + link_text: "%{user}'s answer" + reaction: + heading: "%{user} smiled %{type} %{time} ago" + answer: + heading_html: :notifications.type.reaction.heading + link_text: "your answer" + comment: + heading_html: :notifications.type.reaction.heading + link_text: "your comment" + follow: + heading_html: "followed you %{time} ago" services: index: title: "Service Settings" @@ -350,6 +385,14 @@ en: url: "URL:" confirm: "I understand the risk, proceed!" tabs: + notifications: + all: "All notifications" + new: "New notifications" + answer: "Answers" + smile: "Smiles" + comment: "Comments" + commentsmile: "Comment Smiles" + relationship: "Followers" settings: account: "Account" profile: "Profile"