From 1f51c56c0dcec57eec6242aaee563ac4156ba7b7 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 16 Oct 2023 01:42:42 +0300 Subject: [PATCH] fix time ago strings interpretation --- src/Twig/AppExtension.php | 29 ++++---- translations/messages+intl-icu.cs.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.de.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.en.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.eo.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.es.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.fr.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.he.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.it.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.ka.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.lv.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.pl.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.pt.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.ru.xlf | 102 ++++++++++++-------------- translations/messages+intl-icu.uk.xlf | 102 ++++++++++++-------------- 15 files changed, 672 insertions(+), 785 deletions(-) diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index 50d142d..512e626 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -77,21 +77,21 @@ class AppExtension extends AbstractExtension $values = [ - 365 * 24 * 60 * 60 => $this->translator->trans('year'), - 30 * 24 * 60 * 60 => $this->translator->trans('month'), - 24 * 60 * 60 => $this->translator->trans('day'), - 60 * 60 => $this->translator->trans('hour'), - 60 => $this->translator->trans('minute'), - 1 => $this->translator->trans('second') + 365 * 24 * 60 * 60 => $this->translator->trans('year ago'), + 30 * 24 * 60 * 60 => $this->translator->trans('month ago'), + 24 * 60 * 60 => $this->translator->trans('day ago'), + 60 * 60 => $this->translator->trans('hour ago'), + 60 => $this->translator->trans('minute ago'), + 1 => $this->translator->trans('second ago') ]; $plural = [ - $this->translator->trans('year') => $this->translator->trans('years'), - $this->translator->trans('month') => $this->translator->trans('months'), - $this->translator->trans('day') => $this->translator->trans('days'), - $this->translator->trans('hour') => $this->translator->trans('hours'), - $this->translator->trans('minute') => $this->translator->trans('minutes'), - $this->translator->trans('second') => $this->translator->trans('seconds') + $this->translator->trans('year ago') => $this->translator->trans('years ago'), + $this->translator->trans('month ago') => $this->translator->trans('months ago'), + $this->translator->trans('day ago') => $this->translator->trans('days ago'), + $this->translator->trans('hour ago') => $this->translator->trans('hours ago'), + $this->translator->trans('minute ago') => $this->translator->trans('minutes ago'), + $this->translator->trans('second ago') => $this->translator->trans('seconds ago') ]; foreach ($values as $key => $value) @@ -103,10 +103,9 @@ class AppExtension extends AbstractExtension $round = round($result); return sprintf( - '%s %s %s', + '%s %s', $round, - $round > 1 ? $plural[$value] : $value, - $this->translator->trans('ago') + $round > 1 ? $plural[$value] : $value ); } } diff --git a/translations/messages+intl-icu.cs.xlf b/translations/messages+intl-icu.cs.xlf index 440916e..6d443b2 100644 --- a/translations/messages+intl-icu.cs.xlf +++ b/translations/messages+intl-icu.cs.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.de.xlf b/translations/messages+intl-icu.de.xlf index 034a5fb..65f9d0f 100644 --- a/translations/messages+intl-icu.de.xlf +++ b/translations/messages+intl-icu.de.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.en.xlf b/translations/messages+intl-icu.en.xlf index d8598c5..645cd13 100644 --- a/translations/messages+intl-icu.en.xlf +++ b/translations/messages+intl-icu.en.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.eo.xlf b/translations/messages+intl-icu.eo.xlf index 1eed2b9..22c47ad 100644 --- a/translations/messages+intl-icu.eo.xlf +++ b/translations/messages+intl-icu.eo.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.es.xlf b/translations/messages+intl-icu.es.xlf index d0e57b1..a134173 100644 --- a/translations/messages+intl-icu.es.xlf +++ b/translations/messages+intl-icu.es.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.fr.xlf b/translations/messages+intl-icu.fr.xlf index 36af0d9..d1dbedb 100644 --- a/translations/messages+intl-icu.fr.xlf +++ b/translations/messages+intl-icu.fr.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.he.xlf b/translations/messages+intl-icu.he.xlf index 6dc280a..55a8c0d 100644 --- a/translations/messages+intl-icu.he.xlf +++ b/translations/messages+intl-icu.he.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.it.xlf b/translations/messages+intl-icu.it.xlf index b03fca9..717e893 100644 --- a/translations/messages+intl-icu.it.xlf +++ b/translations/messages+intl-icu.it.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.ka.xlf b/translations/messages+intl-icu.ka.xlf index 828a7d9..8986d66 100644 --- a/translations/messages+intl-icu.ka.xlf +++ b/translations/messages+intl-icu.ka.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.lv.xlf b/translations/messages+intl-icu.lv.xlf index a3c4133..898de96 100644 --- a/translations/messages+intl-icu.lv.xlf +++ b/translations/messages+intl-icu.lv.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.pl.xlf b/translations/messages+intl-icu.pl.xlf index c74e06b..d901ba2 100644 --- a/translations/messages+intl-icu.pl.xlf +++ b/translations/messages+intl-icu.pl.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.pt.xlf b/translations/messages+intl-icu.pt.xlf index 372cc58..71b3a04 100644 --- a/translations/messages+intl-icu.pt.xlf +++ b/translations/messages+intl-icu.pt.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.ru.xlf b/translations/messages+intl-icu.ru.xlf index c9eeb09..24642b6 100644 --- a/translations/messages+intl-icu.ru.xlf +++ b/translations/messages+intl-icu.ru.xlf @@ -149,58 +149,6 @@ now now - - year - year - - - month - month - - - day - day - - - hour - hour - - - minute - minute - - - second - second - - - years - years - - - months - months - - - days - days - - - hours - hours - - - minutes - minutes - - - seconds - seconds - - - ago - ago - Keyword, file, hash... Keyword, file, hash... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent protocol version 1 - - Contains - Contains + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago diff --git a/translations/messages+intl-icu.uk.xlf b/translations/messages+intl-icu.uk.xlf index c62b505..95a2405 100644 --- a/translations/messages+intl-icu.uk.xlf +++ b/translations/messages+intl-icu.uk.xlf @@ -149,58 +149,6 @@ now щойно - - year - рік - - - month - місяць - - - day - день - - - hour - година - - - minute - хвилина - - - second - секунда - - - years - роки - - - months - місяці - - - days - дні - - - hours - години - - - minutes - хвилини - - - seconds - секунди - - - ago - тому - Keyword, file, hash... Ключове слово, файл, хеш... @@ -697,9 +645,53 @@ BitTorrent protocol version 1 BitTorrent протокол версії 1 - - Contains - Містить + + year ago + year ago + + + month ago + month ago + + + day ago + day ago + + + hour ago + hour ago + + + minute ago + minute ago + + + second ago + second ago + + + years ago + years ago + + + months ago + months ago + + + days ago + days ago + + + hours ago + hours ago + + + minutes ago + minutes ago + + + seconds ago + seconds ago