Explorar el Código

More inactive cutoffs (#2831)

* Fill additional cutoffs

* Update phpdoc

* Add translation strings

* Update app/i18n/fr/gen.php

Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>

* Add Dutch translation

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Anton Smirnov hace 6 años
padre
commit
11b6668cbf

+ 19 - 1
app/Controllers/statsController.php

@@ -73,6 +73,9 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
 	 *
 	 * It displays the list of idle feed for different period. The supported
 	 * periods are:
+	 *   - last 5 years
+	 *   - last 3 years
+	 *   - last 2 years
 	 *   - last year
 	 *   - last 6 months
 	 *   - last 3 months
@@ -83,6 +86,9 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
 		$statsDAO = FreshRSS_Factory::createStatsDAO();
 		$feeds = $statsDAO->calculateFeedLastDate();
 		$idleFeeds = array(
+			'last_5_year' => array(),
+			'last_3_year' => array(),
+			'last_2_year' => array(),
 			'last_year' => array(),
 			'last_6_month' => array(),
 			'last_3_month' => array(),
@@ -101,13 +107,25 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
 		$last6Month->modify('-6 month');
 		$lastYear = clone $now;
 		$lastYear->modify('-1 year');
+		$last2Year = clone $now;
+		$last2Year->modify('-2 year');
+		$last3Year = clone $now;
+		$last3Year->modify('-3 year');
+		$last5Year = clone $now;
+		$last5Year->modify('-5 year');
 
 		foreach ($feeds as $feed) {
 			$feedDate->setTimestamp($feed['last_date']);
 			if ($feedDate >= $lastWeek) {
 				continue;
 			}
-			if ($feedDate < $lastYear) {
+			if ($feedDate < $last5Year) {
+				$idleFeeds['last_5_year'][] = $feed;
+			} elseif ($feedDate < $last3Year) {
+				$idleFeeds['last_3_year'][] = $feed;
+			} elseif ($feedDate < $last2Year) {
+				$idleFeeds['last_2_year'][] = $feed;
+			} elseif ($feedDate < $lastYear) {
 				$idleFeeds['last_year'][] = $feed;
 			} elseif ($feedDate < $last6Month) {
 				$idleFeeds['last_6_month'][] = $feed;

+ 3 - 0
app/i18n/cz/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\Č\\e\\r\\v\\e\\n',
 		'jun' => 'čer',
 		'june' => 'Čer',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Minulé tři měsíce',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Minulých šest měsíců',
 		'last_month' => 'Minulý měsíc',
 		'last_week' => 'Minulý týden',

+ 3 - 0
app/i18n/de/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\i',
 		'jun' => 'Jun',
 		'june' => 'Juni',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Letzte drei Monate',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Letzte sechs Monate',
 		'last_month' => 'Letzter Monat',
 		'last_week' => 'Letzte Woche',

+ 3 - 0
app/i18n/en/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\e',
 		'jun' => 'June',
 		'june' => 'June',
+		'last_2_year' => 'Last two years',
 		'last_3_month' => 'Last three months',
+		'last_3_year' => 'Last three years',
+		'last_5_year' => 'Last five years',
 		'last_6_month' => 'Last six months',
 		'last_month' => 'Last month',
 		'last_week' => 'Last week',

+ 3 - 0
app/i18n/es/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\i\\o',
 		'jun' => 'jun',
 		'june' => 'junio',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Últimos tres meses',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Últimos seis meses',
 		'last_month' => 'Mes pasado',
 		'last_week' => 'Semana pasada',

+ 3 - 0
app/i18n/fr/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\j\\u\\i\\n',
 		'jun' => 'juin',
 		'june' => 'juin',
+		'last_2_year' => 'Depuis deux ans',
 		'last_3_month' => 'Depuis les trois derniers mois',
+		'last_3_year' => 'Depuis trois ans',
+		'last_5_year' => 'Depuis cinq ans',
 		'last_6_month' => 'Depuis les six derniers mois',
 		'last_month' => 'Depuis le mois dernier',
 		'last_week' => 'Depuis la semaine dernière',

+ 3 - 0
app/i18n/he/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\e',	// TODO - Translation
 		'jun' => 'jun',
 		'june' => 'Jun',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'בשלושת החודשים האחרונים',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'בששת החודשים האחרונים',
 		'last_month' => 'בחודש שעבר',
 		'last_week' => 'בשבוע שעבר',

+ 3 - 0
app/i18n/it/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\G\\i\\u\\g\\n\\o',
 		'jun' => 'jun',
 		'june' => 'giugno',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Ultimi 3 mesi',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Ultimi 6 mesi',
 		'last_month' => 'Ultimo mese',
 		'last_week' => 'Ultima settimana',

+ 3 - 0
app/i18n/kr/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\e',
 		'jun' => '6월',
 		'june' => '6월',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => '최근 3 개월',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => '최근 6 개월',
 		'last_month' => '최근 한 달',
 		'last_week' => '최근 한 주',

+ 5 - 2
app/i18n/nl/gen.php

@@ -73,8 +73,11 @@ return array(
 		'Jun' => '\\J\\u\\n\\i',
 		'jun' => 'jun',
 		'june' => 'Jun',
-		'last_3_month' => 'Laatste drie maanden',
-		'last_6_month' => 'Laatste zes maanden',
+		'last_2_year' => 'Afgelopen twee jaar',
+		'last_3_month' => 'Afgelopen drie maanden',
+		'last_3_year' => 'Afgelopen drie jaar',
+		'last_5_year' => 'Afgelopen vijf jaar',
+		'last_6_month' => 'Afgelopen zes maanden',
 		'last_month' => 'Vorige maand',
 		'last_week' => 'Vorige week',
 		'last_year' => 'Vorig jaar',

+ 3 - 0
app/i18n/oc/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\j\\u\\n\\h',
 		'jun' => 'junh',
 		'june' => 'junh',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Dempuèi los darrièrs tres meses',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Dempuèi los darrièrs sièis meses',
 		'last_month' => 'Dempuèi lo mes passat',
 		'last_week' => 'Dempuèi la setmana passada',

+ 3 - 0
app/i18n/pt-br/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\h\\o',
 		'jun' => 'jun',
 		'june' => 'Jun',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Últimos três meses',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Últimos seis meses',
 		'last_month' => 'Últimos mês',
 		'last_week' => 'Última semana',

+ 3 - 0
app/i18n/ru/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\u\\n\\e',	// TODO - Translation
 		'jun' => 'jun',
 		'june' => 'Jun',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Last three months',	// TODO - Translation
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Last six months',	// TODO - Translation
 		'last_month' => 'Last month',	// TODO - Translation
 		'last_week' => 'Last week',	// TODO - Translation

+ 3 - 0
app/i18n/sk/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\J\\ú\\n',
 		'jun' => 'Jún',
 		'june' => 'Jún',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Posledné 3 mesiace',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Posledných 6 mesiacov',
 		'last_month' => 'Posledný mesiac',
 		'last_week' => 'Posledný týždeň',

+ 3 - 0
app/i18n/tr/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\H\\a\\z\\i\\r\\a\\n',
 		'jun' => 'haz',
 		'june' => 'Haz',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => 'Son 3 ay',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => 'Son 6 ay',
 		'last_month' => 'Geçen ay',
 		'last_week' => 'Geçen hafta',

+ 3 - 0
app/i18n/zh-cn/gen.php

@@ -73,7 +73,10 @@ return array(
 		'Jun' => '\\六\\月',
 		'jun' => '六月',
 		'june' => '六月',
+		'last_2_year' => 'Last two years',	// TODO - Translation
 		'last_3_month' => '最近三个月',
+		'last_3_year' => 'Last three years',	// TODO - Translation
+		'last_5_year' => 'Last five years',	// TODO - Translation
 		'last_6_month' => '最近六个月',
 		'last_month' => '上月',
 		'last_week' => '上周',