-
Notifications
+
{{ $t("notifications.title")}}
@@ -49,27 +49,28 @@
class="mr-2 rounded-circle shadow-sm"
:src="n.account.avatar"
width="32"
+
height="32"
onerror="this.onerror=null;this.src='/storage/avatars/default.png';">
@@ -146,11 +147,11 @@
- We cannot display this notification at this time.
+ {{ $t("notifications.cannotDisplay")}}
- {{timeAgo(n.created_at)}}
+ {{timeAgo(n.created_at)}}
diff --git a/resources/assets/js/spa.js b/resources/assets/js/spa.js
index 73bd22f2e..0d74c6dc8 100644
--- a/resources/assets/js/spa.js
+++ b/resources/assets/js/spa.js
@@ -697,40 +697,36 @@ window.App.util = {
}
return new Intl.NumberFormat(locale, { notation: notation , compactDisplay: "short" }).format(count);
}),
- timeAgo: function(ts) {
- const date = new Date(ts);
- const now = new Date();
-
- const seconds = Math.floor((now - date) / 1000);
-
- const secondsInYear = 60 * 60 * 24 * 365.25;
- let interval = Math.floor(seconds / secondsInYear);
- if (interval >= 1) {
- return interval + "y";
- }
-
- interval = Math.floor(seconds / (60 * 60 * 24 * 7));
- if (interval >= 1) {
- return interval + "w";
- }
-
- interval = Math.floor(seconds / (60 * 60 * 24));
- if (interval >= 1) {
- return interval + "d";
- }
-
- interval = Math.floor(seconds / (60 * 60));
- if (interval >= 1) {
- return interval + "h";
- }
-
- interval = Math.floor(seconds / 60);
- if (interval >= 1) {
- return interval + "m";
- }
-
- return Math.floor(seconds) + "s";
- },
+ timeAgo: (function(ts) {
+ let date = new Date(ts);
+ let now = new Date();
+ let seconds = Math.floor((now - date) / 1000);
+ let interval = Math.floor(seconds / 31536000);
+ if (interval >= 1) {
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-interval, 'year');
+ }
+ interval = Math.floor(seconds / 2592000);
+ if (interval >= 1) {
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-interval, 'month');
+ }
+ interval = Math.floor(seconds / 604800);
+ if (interval >= 1) {
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-interval, 'week');
+ }
+ interval = Math.floor(seconds / 86400);
+ if (interval >= 1) {
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-interval, 'day');
+ }
+ interval = Math.floor(seconds / 3600);
+ if (interval >= 1) {
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-interval, 'hour');
+ }
+ interval = Math.floor(seconds / 60);
+ if (interval >= 1) {
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-interval, 'minute');
+ }
+ return new Intl.RelativeTimeFormat(i18n.locale, { numeric: 'auto', style: 'short' }).format(-seconds, 'second');
+ }),
timeAhead: (function(ts, short = true) {
let date = Date.parse(ts);
let diff = date - Date.parse(new Date());
diff --git a/resources/lang/en/web.php b/resources/lang/en/web.php
index 3acde415b..d20781257 100644
--- a/resources/lang/en/web.php
+++ b/resources/lang/en/web.php
@@ -104,6 +104,23 @@ return [
'post' => 'post',
'story' => 'story',
'noneFound' => 'No notifications found',
+ 'youRecent' => 'You recent',
+ 'hasUnlisted' => 'has been unlisted',
+ 'cannotDisplay' => 'We cannot display this notification at this time.',
+ 'followRequest' => 'Follow Requests',
+ 'filteringResults' => 'Filtering results may not include older notifications',
+ 'mentions' => 'Mentions',
+ 'mentionsDescription' => 'Replies to your posts and posts you were mentioned in',
+ 'likes' => 'Likes',
+ 'likesDescription' => 'Accounts that liked your posts',
+ 'followers' => 'Followers',
+ 'followersDescription' => 'Accounts that followed you',
+ 'reblogs' => 'Reblogs',
+ 'reblogsDescription' => 'Accounts that shared or reblogged your posts',
+ 'dms' => 'DMs',
+ 'dmsDescription' => 'Direct messages you have with other accounts',
+ 'accept' => 'Accept',
+ 'reject' => 'Reject'
],
'post' => [
diff --git a/resources/lang/pt/web.php b/resources/lang/pt/web.php
index 6b6c8aded..2051d7a23 100644
--- a/resources/lang/pt/web.php
+++ b/resources/lang/pt/web.php
@@ -79,30 +79,44 @@ return [
'requests' => 'Pedidos'
],
- 'notifications' => [
- 'liked' => 'gostou do seu',
- 'commented' => 'comentou no seu',
- 'reacted' => 'reagiu ao seu',
- 'shared' => 'partilhou o teu',
- 'tagged' => 'etiquetou-te numa publicação',
-
- 'updatedA' => 'atualizou uma',
- 'sentA' => 'enviou uma',
-
- 'followed' => 'seguiu-te',
- 'mentioned' => 'mencionou-te',
- 'you' => 'tu',
-
- 'yourApplication' => 'O teu pedido de adesão',
- 'applicationApproved' => 'foi aprovado!',
- 'applicationRejected' => 'foi rejeitado. Podes voltar a candidatar-te dentro de 6 meses.',
-
- 'dm' => 'md',
- 'groupPost' => 'publicação de grupo',
- 'modlog' => 'histórico de moderação',
- 'post' => 'publicação',
- 'story' => 'estória',
- 'noneFound' => 'Nenhuma notificação encontrada',
+ 'notifications' => [
+ 'title' => 'Notificações',
+ 'liked' => 'curtiu sua',
+ 'commented' => 'comentou na sua',
+ 'reacted' => 'reagiu à sua',
+ 'shared' => 'compartilhou a sua',
+ 'tagged' => 'marcou você numa publicação',
+ 'updatedA' => 'atualizou',
+ 'sentA' => 'enviou um',
+ 'followed' => 'seguiu',
+ 'mentioned' => 'mencionou',
+ 'you' => 'você',
+ 'yourApplication' => 'A sua candidatura para se juntar',
+ 'applicationApproved' => 'foi aprovada!',
+ 'applicationRejected' => 'foi rejeitada. Você pode inscrever-se novamente em 6 meses.',
+ 'dm' => 'mensagem direta',
+ 'groupPost' => 'publicação de grupo',
+ 'modlog' => 'histórico de moderação',
+ 'post' => 'publicação',
+ 'story' => 'estória',
+ 'noneFound' => 'Nenhuma notificação encontrada',
+ 'youRecent' => 'Você recente',
+ 'hasUnlisted' => 'foi removida da lista',
+ 'cannotDisplay' => 'Não podemos exibir esta notificação no momento.',
+ 'followRequest' => 'Pedidos de Seguimento',
+ 'filteringResults' => 'Os resultados do filtro podem não incluir notificações mais antigas',
+ 'mentions' => 'Menções',
+ 'mentionsDescription' => 'Respostas às suas publicações e publicações em que você foi mencionado',
+ 'likes' => 'Curtidas',
+ 'likesDescription' => 'Contas que curtiram das suas publicações',
+ 'followers' => 'Seguidores',
+ 'followersDescription' => 'Contas que seguiram você',
+ 'reblogs' => 'Reblogs',
+ 'reblogsDescription' => 'Contas que compartilharam ou reblogaram suas publicações',
+ 'dms' => 'DMs',
+ 'dmsDescription' => 'Mensagens diretas que você tem com outras contas',
+ 'accept' => 'Aceitar',
+ 'reject' => 'Rejeitar'
],
'post' => [