Display an error message if the feed already exists + sync locales

This commit is contained in:
Frederic Guillot 2015-04-10 20:48:09 -04:00
parent 578f9cbf14
commit 892fb517ae
12 changed files with 36 additions and 33 deletions

View File

@ -161,10 +161,13 @@ Router\action('subscribe', function() {
$values += array('url' => trim($url), 'download_content' => 0, 'rtl' => 0, 'cloak_referrer' => 0);
$feed_id = Model\Feed\create($values['url'], $values['download_content'], $values['rtl'], $values['cloak_referrer']);
if ($feed_id) {
if ($feed_id > 0) {
Session\flash(t('Subscription added successfully.'));
Response\redirect('?action=feed-items&feed_id='.$feed_id);
}
else if ($feed_id === -2) {
Session\flash_error(t('This subscription already exists.'));
}
else {
Session\flash_error(t('Unable to find a subscription.'));
}

View File

@ -5,6 +5,7 @@ return array(
'attachment' => 'المرفقات',
'When there is nothing to read, redirect me to this page' => ':عندما تكون كل العناوين قد تمت قرائتها قم بتحويلي مباشرة إلى',
'There is nothing new to read, enjoy your favorites articles!' => 'ليس هناك شيء جديد للقراءة، ! إستمتع بقراءة مالديك في مفضلاتك',
// 'There is nothing new to read, enjoy your previous readings!' => '',
'Immediately' => 'حالاً',
'(error occurred during the last check)' => '(هناك خطأ خلال عملية التحديث الأخيره)',
'The feed id is required' => 'تغذية الخلاصات مطلوب',
@ -37,8 +38,7 @@ return array(
'Subscribe with Miniflux' => 'للإشتراك بواسطة ميني فلكس',
'Drag and drop this link to your bookmarks' => 'سحب وإسقاط هذا الرابط إلى المواقع في مفضلاتك',
'Download full content' => 'تحميل المحتوى كاملاً',
'Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.' =>
' يرجى ملاحظة أن عملية تحميل المحتوى كاملاً ستكون بطيئةً ، و ذلك لإن برنامج ميني فلكس يقوم بإستخراج المحتوى من الموقع الأصلي. وعليه، يجب إستخدام هذه الخاصية فقط للمواقع التي لا تقدم خلاصلات بمحتوى كامل يرجى ملاحظة أن هذه الخاصية قد لا تعمل بشكل جيد مع بعض المواقع الإلكترونية',
'Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.' => ' يرجى ملاحظة أن عملية تحميل المحتوى كاملاً ستكون بطيئةً ، و ذلك لإن برنامج ميني فلكس يقوم بإستخراج المحتوى من الموقع الأصلي. وعليه، يجب إستخدام هذه الخاصية فقط للمواقع التي لا تقدم خلاصلات بمحتوى كامل يرجى ملاحظة أن هذه الخاصية قد لا تعمل بشكل جيد مع بعض المواقع الإلكترونية',
'No message' => 'لا توجد رسائل',
'flush messages' => 'مسح التنبيهات و رسائل الخطأ',
'API endpoint:' => 'API endpoint (خاص بالمطورين): ',
@ -230,4 +230,5 @@ return array(
'Enable debug mode' => 'تفعيل وضح التصحيح',
'Original link marks article as read' => 'تحويل العنوان إلى مقروء بمجرد النقر على الرابط الأصلي للعنوان',
'Cloak the image referrer' => 'Cloak the image referrer',
// 'This subscription already exists.' => '',
);

View File

@ -230,4 +230,5 @@ return array(
'Enable debug mode' => 'Povolit ladící režim',
'Original link marks article as read' => 'Původní odkaz označí článek za přečtený',
'Cloak the image referrer' => 'Zamaskovat původce obrázků',
// 'This subscription already exists.' => '',
);

View File

@ -230,4 +230,5 @@ return array(
// 'Enable debug mode' => '',
// 'Original link marks article as read' => '',
// 'Cloak the image referrer' => '',
// 'This subscription already exists.' => '',
);

View File

@ -204,7 +204,7 @@ return array(
'Miniflux API' => 'API Miniflux',
'menu' => 'menú',
'Default' => 'Por defecto',
//'Value required' => 'Valor requerido',
// 'Value required' => '',
'Must be an integer' => 'Tiene que ser un número entero',
'Remove automatically unread items' => 'Eliminar automáticamente artículos sin leer',
'Toggle RTL mode' => 'Activar modo RTL',
@ -217,7 +217,7 @@ return array(
'Instapaper' => 'Instapaper',
'Pinboard' => 'Pinboard',
'Send bookmarks to Instapaper' => 'Enviar marcadores a Instapaper',
//'Authentication' => 'Autentificación',
// 'Authentication' => '',
'Reading' => 'Leyendo',
'Application' => 'Aplicación',
'Enable image proxy' => 'Activar proxy de imágenes',
@ -229,5 +229,6 @@ return array(
'Nothing to show. Enable the debug mode to see log messages.' => 'Nada que mostrar. Active el modo de depuración para ver los mensages del log',
'Enable debug mode' => 'Activar modo de depuración',
'Original link marks article as read' => 'Link original marca artículo cómo leído',
//'Cloak the image referrer' => '',
// 'Cloak the image referrer' => '',
// 'This subscription already exists.' => '',
);

View File

@ -230,4 +230,5 @@ return array(
'Enable debug mode' => 'Activer le mode debug',
'Original link marks article as read' => 'Marquer les articles comme lu lors d\'un clic sur le lien original',
'Cloak the image referrer' => 'Falsifier le référent pour les images',
'This subscription already exists.' => 'Cet abonnement existe déjà.',
);

View File

@ -230,4 +230,5 @@ return array(
// 'Enable debug mode' => '',
// 'Original link marks article as read' => '',
// 'Cloak the image referrer' => '',
// 'This subscription already exists.' => '',
);

View File

@ -230,4 +230,5 @@ return array(
// 'Enable debug mode' => '',
// 'Original link marks article as read' => '',
// 'Cloak the image referrer' => '',
// 'This subscription already exists.' => '',
);

View File

@ -1,21 +1,20 @@
<?php
return array(
'plural' => function($n) { return (($n%10==1 && $n%100!=11) ? 0 : (($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20)) ? 1 : 2)); },
'plural' => function($n) { return (($n%10==1 && $n%100!=11) ? 0 : (($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20)) ? 1 : 2)); },
'attachment' => 'приложена датотека',
'When there is nothing to read, redirect me to this page' => 'Када нема ничег за читање, проследи ме на страницу',
'There is nothing new to read, enjoy your favorites articles!' => 'Нема ничег новог за читање, уживајте у омиљеним чланцима !',
'There is nothing new to read, enjoy your previous articles!' => 'Нема ничег новог за читање, уживајте у претходним чланцима !',
// 'There is nothing new to read, enjoy your previous readings!' => '',
'Immediately' => 'Одмах',
'(error occurred during the last check)' => '(дошло је до грешке током претходне провере)',
'The feed id is required' => 'Потребан је идентификациони код feed-a',
'The title is required' => 'Потребан је наслов',
'The site URL is required' => 'Потребан је УРЛ сајта',
'The feed URL is required' => 'Потребан је УРЛ feed-a',
// 'The site url is required' => '',
// 'The feed url is required' => '',
'or' => 'или',
'edit' => 'уреди',
'cancel' => 'поништи',
'Edit' => 'Уреди',
'Feed URL' => 'УРЛ feed-a',
'Website URL' => 'УРЛ сајта',
'Title' => 'Наслов',
@ -35,20 +34,18 @@ return array(
'Go to history' => 'Види историју',
'Go to subscriptions' => 'Види претплате',
'Go to preferences' => 'Види опције',
'Bookmarklet:' => 'Букмарклет :',
'Bookmarklet' => 'Букмарклет',
'Subscribe with Miniflux' => 'Претплати се Минифлуксом',
'Drag and drop this link to your bookmarks' => 'Превуците ову везу омиљене сајтове вашег интернет прегледача',
'Download full content' => 'Скини пун садржај',
'Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.' =>
'Скидање пуног садржаја је спорије зато што Минифлукс мора да преузме садржај са самог сајта. Ову опцију бисте требали користити за сајтове који приказују само сижеа. Опција не ради на свим сајтовима',
'Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.' => 'Скидање пуног садржаја је спорије зато што Минифлукс мора да преузме садржај са самог сајта. Ову опцију бисте требали користити за сајтове који приказују само сижеа. Опција не ради на свим сајтовима',
'No message' => 'Нема поруке',
'flush messages' => 'исчисти све поруке',
'API' => 'АПИ',
'API endpoint:' => 'УРЛ АПИ-ja : ',
'API username:' => 'Корисничко име за АПИ: ',
'API token:' => 'Кључ за АПИ : ',
'Generate new tokens' => 'Генериши нове кључеве',
'Bookmarks RSS Feed:' => 'RSS feed омиљених претплата:',
'Bookmark RSS Feed' => 'RSS feed омиљених чланака',
'updated just now' => 'ажурирано управо сада',
'checked at' => 'проверено',
'never updated after creation' => 'никад ажурирано после стварања',
@ -92,7 +89,7 @@ return array(
'Download the entire database' => 'Преузми целу базу података',
'(Gzip compressed Sqlite file)' => '(Датотека Sqlite компресована у Gzip формату)',
'Keyboard shortcuts' => 'Пречице на тастатури',
'Previous item' => 'Претходна ставка',
'Previous item' => 'Претходна ставка',
'Next item' => 'Следећа ставка',
'Mark as read or unread' => 'Означи прочитаним или непрочитаним',
'Open original link' => 'Отвори оригинални линк',
@ -233,6 +230,5 @@ return array(
'Enable debug mode' => 'Активирај мод за дебаговање',
'Original link marks article as read' => 'Клик на оригиналну везу обележава чланак прочитаним',
'Cloak the image referrer' => 'Прикривај рефератора слика',
'Bookmarklet' => 'Букмарклет',
'Bookmark RSS Feed' => 'RSS feed омиљених чланака',
// 'This subscription already exists.' => '',
);

View File

@ -1,21 +1,20 @@
<?php
return array(
'plural' => function($n) { return (($n%10==1 && $n%100!=11) ? 0 : (($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20)) ? 1 : 2)); },
'plural' => function($n) { return (($n%10==1 && $n%100!=11) ? 0 : (($n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20)) ? 1 : 2)); },
'attachment' => 'priložena datoteka',
'When there is nothing to read, redirect me to this page' => 'Kada nema ničeg za čitanje, prosledi me na stranicu',
'There is nothing new to read, enjoy your favorites articles!' => 'Nema ničeg novog za čitanje, uživajte u omiljenim člancima !',
'There is nothing new to read, enjoy your previous articles!' => 'Nema ničeg novog za čitanje, uživajte u prethodnim člancima !',
// 'There is nothing new to read, enjoy your previous readings!' => '',
'Immediately' => 'Odmah',
'(error occurred during the last check)' => '(došlo je do greške tokom prethodne provere)',
'The feed id is required' => 'Potreban je identifikacioni kod feed-a',
'The title is required' => 'Potreban je naslov',
'The site URL is required' => 'Potreban je URL sajta',
'The feed URL is required' => 'Potreban je URL feed-a',
// 'The site url is required' => '',
// 'The feed url is required' => '',
'or' => 'ili',
'edit' => 'uredi',
'cancel' => 'poništi',
'Edit' => 'Uredi',
'Feed URL' => 'URL feed-a',
'Website URL' => 'URL sajta',
'Title' => 'Naslov',
@ -35,20 +34,18 @@ return array(
'Go to history' => 'Vidi istoriju',
'Go to subscriptions' => 'Vidi pretplate',
'Go to preferences' => 'Vidi opcije',
'Bookmarklet:' => 'Bukmarklet :',
'Bookmarklet' => 'Bukmarklet',
'Subscribe with Miniflux' => 'Pretplati se Minifluxom',
'Drag and drop this link to your bookmarks' => 'Prevucite ovu vezu omiljene sajtove vašeg internet pregledača',
'Download full content' => 'Skini pun sadržaj',
'Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.' =>
'Skidanje punog sadržaja je sporije zato što Miniflux mora da preuzme sadržaj sa samog sajta. Ovu opciju biste trebali koristiti za sajtove koji prikazuju samo sižea. Opcija ne radi na svim sajtovima',
'Downloading full content is slower because Miniflux grab the content from the original website. You should use that for subscriptions that display only a summary. This feature doesn\'t work with all websites.' => 'Skidanje punog sadržaja je sporije zato što Miniflux mora da preuzme sadržaj sa samog sajta. Ovu opciju biste trebali koristiti za sajtove koji prikazuju samo sižea. Opcija ne radi na svim sajtovima',
'No message' => 'Nema poruke',
'flush messages' => 'isčisti sve poruke',
'API' => 'API',
'API endpoint:' => 'URL API-ja : ',
'API username:' => 'Korisničko ime za API: ',
'API token:' => 'Ključ za API : ',
'Generate new tokens' => 'Generiši nove ključeve',
'Bookmarks RSS Feed:' => 'RSS feed omiljenih pretplata:',
'Bookmark RSS Feed' => 'RSS feed omiljenih članaka',
'updated just now' => 'ažurirano upravo sada',
'checked at' => 'provereno',
'never updated after creation' => 'nikad ažurirano posle stvaranja',
@ -233,6 +230,5 @@ return array(
'Enable debug mode' => 'Aktiviraj mod za debagovanje',
'Original link marks article as read' => 'Klik na originalnu vezu obeležava članak pročitanim',
'Cloak the image referrer' => 'Prikrivaj referatora slika',
'Bookmarklet' => 'Bukmarklet',
'Bookmark RSS Feed' => 'RSS feed omiljenih članaka',
// 'This subscription already exists.' => '',
);

View File

@ -230,4 +230,5 @@ return array(
// 'Enable debug mode' => '',
// 'Original link marks article as read' => '',
// 'Cloak the image referrer' => '',
// 'This subscription already exists.' => '',
);

View File

@ -160,7 +160,7 @@ function create($url, $enable_grabber = false, $force_rtl = false, $cloak_referr
// Feed already there
if ($db->table('feeds')->eq('feed_url', $resource->getUrl())->count()) {
return false;
return -2;
}
// Parse the feed
@ -204,7 +204,7 @@ function create($url, $enable_grabber = false, $force_rtl = false, $cloak_referr
catch (PicoFeedException $e) {}
Config\write_debug();
return false;
return -1;
}
// Refresh all feeds