From fb3cda8ac9f7c8895ed33d7db432a92b063a7198 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 29 Oct 2014 11:08:31 +0100 Subject: Fix limits in import OPML files See https://github.com/marienfressinaud/FreshRSS/issues/680 --- app/Controllers/importExportController.php | 55 +++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 12 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index ab277e688..514077bbd 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -176,19 +176,43 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { */ private function addOpmlElements($opml_elements, $parent_cat = null) { $error = false; + + $nb_feeds = count($this->feedDAO->listFeeds()); + $nb_cats = count($this->catDAO->listCategories(false)); + $limits = Minz_Configuration::limits(); + foreach ($opml_elements as $elt) { - $res = false; + $is_error = false; if (isset($elt['xmlUrl'])) { // If xmlUrl exists, it means it is a feed - $res = $this->addFeedOpml($elt, $parent_cat); + if ($nb_feeds >= $limits['max_feeds']) { + Minz_Log::warning(_t('sub.feeds.over_max', + $limits['max_feeds'])); + $is_error = true; + continue; + } + + $is_error = $this->addFeedOpml($elt, $parent_cat); + if (!$is_error) { + $nb_feeds += 1; + } } else { // No xmlUrl? It should be a category! - $res = $this->addCategoryOpml($elt, $parent_cat); + $limit_reached = ($nb_cats >= $limits['max_categories']); + if ($limit_reached) { + Minz_Log::warning(_t('sub.categories.over_max', + $limits['max_categories'])); + } + + $is_error = $this->addCategoryOpml($elt, $parent_cat, $limit_reached); + if (!$is_error) { + $nb_cats += 1; + } } - if (!$error && $res) { + if (!$error && $is_error) { // oops: there is at least one error! - $error = $res; + $error = $is_error; } } @@ -203,16 +227,18 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { * @return boolean true if an error occured, false else. */ private function addFeedOpml($feed_elt, $parent_cat) { + $default_cat = $this->catDAO->getDefault(); if (is_null($parent_cat)) { // This feed has no parent category so we get the default one - $parent_cat = $this->catDAO->getDefault()->name(); + $parent_cat = $default_cat->name(); } $cat = $this->catDAO->searchByName($parent_cat); - if (!$cat) { + if (is_null($cat)) { // If there is not $cat, it means parent category does not exist in - // database. It should not happened! - return true; + // database. + // If it happens, take the default category. + $cat = $default_cat; } // We get different useful information @@ -253,14 +279,19 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { * * @param array $cat_elt an OPML element (must be a category element). * @param string $parent_cat the name of the parent category. + * @param boolean $cat_limit_reached indicates if category limit has been reached. + * if yes, category is not added (but we try for feeds!) * @return boolean true if an error occured, false else. */ - private function addCategoryOpml($cat_elt, $parent_cat) { + private function addCategoryOpml($cat_elt, $parent_cat, $cat_limit_reached) { // Create a new Category object $cat = new FreshRSS_Category(Minz_Helper::htmlspecialchars_utf8($cat_elt['text'])); - $id = $this->catDAO->addCategoryObject($cat); - $error = ($id === false); + $error = true; + if (!$cat_limit_reached) { + $id = $this->catDAO->addCategoryObject($cat); + $error = ($id === false); + } if (isset($cat_elt['@outlines'])) { // Our cat_elt contains more categories or more feeds, so we -- cgit v1.2.3 From d20b5a127fe95f91b55f3ae9391365c67f96c4cc Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 29 Oct 2014 11:47:51 +0100 Subject: Fix limit in import Json files See https://github.com/marienfressinaud/FreshRSS/issues/680 --- app/Controllers/importExportController.php | 28 +++++++++++++++++++++++++--- app/Models/FeedDAO.php | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 514077bbd..8028af8ed 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -327,12 +327,34 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $error = false; $article_to_feed = array(); + $nb_feeds = count($this->feedDAO->listFeeds()); + $limits = Minz_Configuration::limits(); + // First, we check feeds of articles are in DB (and add them if needed). foreach ($article_object['items'] as $item) { - $feed = $this->addFeedJson($item['origin'], $google_compliant); + $key = $google_compliant ? 'htmlUrl' : 'feedUrl'; + $feed = new FreshRSS_Feed($item['origin'][$key]); + $feed = $this->feedDAO->searchByUrl($feed->url()); + if (is_null($feed)) { - $error = true; - } else { + // Feed does not exist in DB,we should to try to add it. + if ($nb_feeds >= $limits['max_feeds']) { + // Oops, no more place! + Minz_Log::warning(_t('sub.feeds.over_max', $limits['max_feeds'])); + } else { + $feed = $this->addFeedJson($item['origin'], $google_compliant); + } + + if (is_null($feed)) { + // Still null? It means something went wrong. + $error = true; + } else { + // Nice! Increase the counter. + $nb_feeds += 1; + } + } + + if (!is_null($feed)) { $article_to_feed[$item['id']] = $feed->id(); } } diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 852de6e36..74597c730 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -191,7 +191,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo { $res = $stm->fetchAll(PDO::FETCH_ASSOC); $feed = current(self::daoToFeed($res)); - if (isset($feed)) { + if (isset($feed) && $feed !== false) { return $feed; } else { return null; -- cgit v1.2.3 From 58deab37cdd97e93ac25aba574a32befe1db2243 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 30 Oct 2014 19:57:08 +0100 Subject: Fix Minz_Error::error() -> use default values --- app/Controllers/authController.php | 3 +-- app/Controllers/categoryController.php | 5 +---- app/Controllers/configureController.php | 5 +---- app/Controllers/entryController.php | 5 +---- app/Controllers/feedController.php | 10 ++-------- app/Controllers/importExportController.php | 5 +---- app/Controllers/statsController.php | 29 +++++++++++++---------------- app/Controllers/subscriptionController.php | 10 ++-------- app/Controllers/updateController.php | 5 +---- app/Controllers/userController.php | 8 ++------ 10 files changed, 25 insertions(+), 60 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 491be8d8a..44496cd3e 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -19,8 +19,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { */ public function indexAction() { if (!FreshRSS_Auth::hasAccess('admin')) { - Minz_Error::error(403, - array('error' => array(_t('access_denied')))); + Minz_Error::error(403); } Minz_View::prependTitle(_t('gen.title.authentication') . ' · '); diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 609284559..50b1d841a 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -13,10 +13,7 @@ class FreshRSS_category_Controller extends Minz_ActionController { */ public function firstAction() { if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } $catDAO = new FreshRSS_CategoryDAO(); diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index deb8cc849..1c8ac9111 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -11,10 +11,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { */ public function firstAction() { if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } } diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index d11f3a520..b4beed619 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -11,10 +11,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { */ public function firstAction() { if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } // If ajax request, we do not print layout diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 8563b1c0f..9990a852c 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -20,10 +20,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $action = Minz_Request::actionName(); if ($action !== 'actualize' || !(Minz_Configuration::allowAnonymousRefresh() || $token_is_ok)) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } } } @@ -442,10 +439,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { } else { Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' . 'in the category `' . $cat_id . '`'); - Minz_Error::error( - 404, - array('error' => array(_t('error_occurred'))) - ); + Minz_Error::error(404); } } diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 8028af8ed..4e2dbd157 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -11,10 +11,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { */ public function firstAction() { if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } require_once(LIB_PATH . '/lib_opml.php'); diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index 0e3430fcc..18fbca6df 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -5,6 +5,19 @@ */ class FreshRSS_stats_Controller extends Minz_ActionController { + /** + * This action is called before every other action in that class. It is + * the common boiler plate for every action. It is triggered by the + * underlying framework. + */ + public function firstAction() { + if (!FreshRSS_Auth::hasAccess()) { + Minz_Error::error(403); + } + + Minz_View::prependTitle(_t('stats') . ' · '); + } + /** * This action handles the statistic main page. * @@ -111,20 +124,4 @@ class FreshRSS_stats_Controller extends Minz_ActionController { $this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id); $this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id); } - - /** - * This action is called before every other action in that class. It is - * the common boiler plate for every action. It is triggered by the - * underlying framework. - */ - public function firstAction() { - if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, array('error' => array(_t('access_denied'))) - ); - } - - Minz_View::prependTitle(_t('stats') . ' · '); - } - } diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index a89168eb3..67b95eba6 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -11,10 +11,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { */ public function firstAction() { if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } $catDAO = new FreshRSS_CategoryDAO(); @@ -71,10 +68,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); if ($id === false || !isset($this->view->feeds[$id])) { - Minz_Error::error( - 404, - array('error' => array(_t('page_not_found'))) - ); + Minz_Error::error(404); return; } diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 4ef5357ea..0896b13ac 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -4,10 +4,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { public function firstAction() { $current_user = Minz_Session::param('currentUser', ''); if (!FreshRSS_Auth::hasAccess('admin')) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } invalidateHttpCache(); diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 39db1d879..5050571a9 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -15,10 +15,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { */ public function firstAction() { if (!FreshRSS_Auth::hasAccess()) { - Minz_Error::error( - 403, - array('error' => array(_t('access_denied'))) - ); + Minz_Error::error(403); } } @@ -88,8 +85,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { */ public function manageAction() { if (!FreshRSS_Auth::hasAccess('admin')) { - Minz_Error::error(403, - array('error' => array(_t('access_denied')))); + Minz_Error::error(403); } Minz_View::prependTitle(_t('gen.title.user_management') . ' · '); -- cgit v1.2.3 From 7ef4d6c033d6d12a644b6cf39940591901fdcb3b Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 7 Dec 2014 14:39:02 +0100 Subject: Fix entry_before_insert hook The hook must be called also in: - feedController->addAction() - importExportController->importJson() See https://github.com/FreshRSS/FreshRSS/issues/252 --- app/Controllers/feedController.php | 13 ++++++++++--- app/Controllers/importExportController.php | 6 ++++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index dce79c57a..0a7edbee3 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -174,10 +174,17 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feedDAO->beginTransaction(); foreach ($entries as $entry) { // Entries are added without any verification. + $entry->_feed($feed->id()); + $entry->_id(min(time(), $entry->date(true)) . uSecString()); + $entry->_isRead($is_read); + + $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry); + if (is_null($entry)) { + // An extension has returned a null value, there is nothing to insert. + continue; + } + $values = $entry->toArray(); - $values['id_feed'] = $feed->id(); - $values['id'] = min(time(), $entry->date(true)) . uSecString(); - $values['is_read'] = $is_read; $entryDAO->addEntry($values, $prepared_statement); } $feedDAO->updateLastUpdate($feed->id()); diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 4e2dbd157..c67b30431 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -385,6 +385,12 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $entry->_id(min(time(), $entry->date(true)) . uSecString()); $entry->_tags($tags); + $entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry); + if (is_null($entry)) { + // An extension has returned a null value, there is nothing to insert. + continue; + } + $values = $entry->toArray(); $id = $this->entryDAO->addEntry($values, $prepared_statement); -- cgit v1.2.3 From 188b517daa174ce494f31dec02ae2cff122488ff Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Mon, 8 Dec 2014 13:05:56 +0100 Subject: Add a feed_before_insert hook See https://github.com/FreshRSS/FreshRSS/issues/252 --- app/Controllers/feedController.php | 6 ++++++ app/Controllers/importExportController.php | 30 ++++++++++++++++++++---------- lib/Minz/ExtensionManager.php | 1 + 3 files changed, 27 insertions(+), 10 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 0a7edbee3..7dda3840e 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -138,6 +138,12 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed->_category($cat); $feed->_httpAuth($http_auth); + // Call the extension hook + $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); + if (is_null($feed)) { + Minz_Request::bad(_t('feed_not_added', $feed->name()), $url_redirect); + } + $values = array( 'url' => $feed->url(), 'category' => $feed->category(), diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index c67b30431..52df5bf8b 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -259,10 +259,16 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $feed->_website($website); $feed->_description($description); - // addFeedObject checks if feed is already in DB so nothing else to - // check here - $id = $this->feedDAO->addFeedObject($feed); - $error = ($id === false); + // Call the extension hook + $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); + if (!is_null($feed)) { + // addFeedObject checks if feed is already in DB so nothing else to + // check here + $id = $this->feedDAO->addFeedObject($feed); + $error = ($id === false); + } else { + $error = true; + } } catch (FreshRSS_Feed_Exception $e) { Minz_Log::warning($e->getMessage()); $error = true; @@ -427,13 +433,17 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $feed->_name($name); $feed->_website($website); - // addFeedObject checks if feed is already in DB so nothing else to - // check here. - $id = $this->feedDAO->addFeedObject($feed); + // Call the extension hook + $feed = Minz_ExtensionManager::callHook('feed_before_insert', $feed); + if (!is_null($feed)) { + // addFeedObject checks if feed is already in DB so nothing else to + // check here. + $id = $this->feedDAO->addFeedObject($feed); - if ($id !== false) { - $feed->_id($id); - $return = $feed; + if ($id !== false) { + $feed->_id($id); + $return = $feed; + } } } catch (FreshRSS_Feed_Exception $e) { Minz_Log::warning($e->getMessage()); diff --git a/lib/Minz/ExtensionManager.php b/lib/Minz/ExtensionManager.php index 5491c7cf6..9e6a3155a 100644 --- a/lib/Minz/ExtensionManager.php +++ b/lib/Minz/ExtensionManager.php @@ -17,6 +17,7 @@ class Minz_ExtensionManager { private static $hook_list = array( 'entry_before_display' => array(), // function($entry) -> Entry | null 'entry_before_insert' => array(), // function($entry) -> Entry | null + 'feed_before_insert' => array(), // function($feed) -> Feed | null ); private static $ext_to_hooks = array(); -- cgit v1.2.3 From 0ee16a7d6acb0c0158272fbbdd9ee876d9fb4a4a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Dec 2014 17:46:05 +0100 Subject: Fix i18n for import/export --- app/Controllers/importExportController.php | 24 ++++++++++++------------ app/i18n/en/feedback.php | 8 ++++++++ app/i18n/en/gen.php | 16 ++-------------- app/i18n/en/sub.php | 11 +++++++++++ app/i18n/fr/feedback.php | 8 ++++++++ app/i18n/fr/gen.php | 16 ++-------------- app/i18n/fr/sub.php | 11 +++++++++++ app/views/importExport/index.phtml | 16 ++++++++-------- 8 files changed, 62 insertions(+), 48 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 4e2dbd157..2360ce53b 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -26,7 +26,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { */ public function indexAction() { $this->view->feeds = $this->feedDAO->listFeeds(); - Minz_View::prependTitle(_t('import_export') . ' · '); + Minz_View::prependTitle(_t('sub.import_export.title') . ' · '); } /** @@ -48,7 +48,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if ($status_file !== 0) { Minz_Log::error('File cannot be uploaded. Error code: ' . $status_file); - Minz_Request::bad(_t('file_cannot_be_uploaded'), + Minz_Request::bad(_t('feedback.import_export.file_cannot_be_uploaded'), array('c' => 'importExport', 'a' => 'index')); } @@ -70,7 +70,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if (!is_resource($zip)) { // zip_open cannot open file: something is wrong Minz_Log::error('Zip archive cannot be imported. Error code: ' . $zip); - Minz_Request::bad(_t('zip_error'), + Minz_Request::bad(_t('feedback.import_export.zip_error'), array('c' => 'importExport', 'a' => 'index')); } @@ -92,7 +92,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { zip_close($zip); } elseif ($type_file === 'zip') { // Zip extension is not loaded - Minz_Request::bad(_t('no_zip_extension'), + Minz_Request::bad(_t('feedback.import_export.no_zip_extension'), array('c' => 'importExport', 'a' => 'index')); } elseif ($type_file !== 'unknown') { $list_files[$type_file][] = file_get_contents($file['tmp_name']); @@ -115,8 +115,8 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // And finally, we get import status and redirect to the home page Minz_Session::_param('actualize_feeds', true); - $content_notif = $error === true ? _t('feeds_imported_with_errors') : - _t('feeds_imported'); + $content_notif = $error === true ? _t('feedback.import_export.feeds_imported_with_errors') : + _t('feedback.import_export.feeds_imported'); Minz_Request::good($content_notif); } @@ -183,7 +183,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if (isset($elt['xmlUrl'])) { // If xmlUrl exists, it means it is a feed if ($nb_feeds >= $limits['max_feeds']) { - Minz_Log::warning(_t('sub.feeds.over_max', + Minz_Log::warning(_t('sub.feed.over_max', $limits['max_feeds'])); $is_error = true; continue; @@ -197,7 +197,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // No xmlUrl? It should be a category! $limit_reached = ($nb_cats >= $limits['max_categories']); if ($limit_reached) { - Minz_Log::warning(_t('sub.categories.over_max', + Minz_Log::warning(_t('sub.category.over_max', $limits['max_categories'])); } @@ -337,7 +337,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // Feed does not exist in DB,we should to try to add it. if ($nb_feeds >= $limits['max_feeds']) { // Oops, no more place! - Minz_Log::warning(_t('sub.feeds.over_max', $limits['max_feeds'])); + Minz_Log::warning(_t('sub.feed.over_max', $limits['max_feeds'])); } else { $feed = $this->addFeedJson($item['origin'], $google_compliant); } @@ -482,7 +482,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $this->exportZip($export_files); } catch (Exception $e) { # Oops, there is no Zip extension! - Minz_Request::bad(_t('export_no_zip_extension'), + Minz_Request::bad(_t('feedback.import_export.export_no_zip_extension'), array('c' => 'importExport', 'a' => 'index')); } } elseif ($nb_files === 1) { @@ -523,14 +523,14 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { $this->view->categories = $this->catDAO->listCategories(); if ($type == 'starred') { - $this->view->list_title = _t('starred_list'); + $this->view->list_title = _t('sub.import_export.starred_list'); $this->view->type = 'starred'; $unread_fav = $this->entryDAO->countUnreadReadFavorites(); $this->view->entries = $this->entryDAO->listWhere( 's', '', FreshRSS_Entry::STATE_ALL, 'ASC', $unread_fav['all'] ); } elseif ($type == 'feed' && !is_null($feed)) { - $this->view->list_title = _t('feed_list', $feed->name()); + $this->view->list_title = _t('sub.import_export.feed_list', $feed->name()); $this->view->type = 'feed/' . $feed->id(); $this->view->entries = $this->entryDAO->listWhere( 'f', $feed->id(), FreshRSS_Entry::STATE_ALL, 'ASC', diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index 2eae1d839..62fac81eb 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -1,6 +1,14 @@ array( + 'export_no_zip_extension' => 'Zip extension is not present on your server. Please try to export files one by one.', + 'feeds_imported' => 'Your feeds have been imported and will now be updated', + 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', + 'file_cannot_be_uploaded' => 'File cannot be uploaded!', + 'no_zip_extension' => 'Zip extension is not present on your server.', + 'zip_error' => 'An error occured during Zip import.', + ), 'login' => array( 'error' => 'Login is invalid', 'success' => 'You are connected', diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index a3c409c31..856c91b3b 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -8,7 +8,9 @@ return array( 'disable' => 'Disable', 'empty' => 'Empty', 'enable' => 'Enable', + 'export' => 'Export', 'filter' => 'Filtrer', + 'import' => 'Import', 'manage' => 'Manage', 'mark_read' => 'Mark as read', 'remove' => 'Remove', @@ -216,26 +218,16 @@ return array( 'dom_is_ok' => 'You have the required library to browse the DOM', 'error_occurred' => 'An error occurred', 'explain_token' => 'Allows to access RSS output of the default user without authentication.
%s?output=rss&token=%s', - 'export' => 'Export', - 'export_no_zip_extension' => 'Zip extension is not present on your server. Please try to export files one by one.', - 'export_opml' => 'Export list of feeds (OPML)', - 'export_starred' => 'Export your favourites', 'favicons_is_ok' => 'Permissions on favicons directory are good', 'feed' => 'Feed', 'feed_actualized' => '%s has been updated', 'feed_added' => 'RSS feed %s has been added', 'feed_deleted' => 'Feed has been deleted', - 'feed_list' => 'List of %s articles', 'feed_not_added' => '%s could not be added', 'feeds' => 'Feeds', 'feeds_actualized' => 'RSS feeds have been updated', - 'feeds_imported' => 'Your feeds have been imported and will now be updated', - 'feeds_imported_with_errors' => 'Your feeds have been imported but some errors occurred', 'feeds_marked_read' => 'Feeds have been marked as read', - 'file_cannot_be_uploaded' => 'File cannot be uploaded!', 'file_is_nok' => 'Check permissions on %s directory. HTTP server must have rights to write into', - 'file_to_import' => 'File to import
(OPML, Json or Zip)', - 'file_to_import_no_zip' => 'File to import
(OPML or Json)', 'finish_installation' => 'Complete installation', 'first_article' => 'Skip to the first article', 'fix_errors_before' => 'Fix errors before skip to the next step.', @@ -251,7 +243,6 @@ return array( 'http_referer_is_nok' => 'Please check that you are not altering your HTTP REFERER.', 'http_referer_is_ok' => 'Your HTTP REFERER is known and corresponds to your server.', 'img_with_lazyload' => 'Use "lazy load" mode to load pictures', - 'import' => 'Import', 'install_not_deleted' => 'Something went wrong; you must delete the file %s manually.', 'installation_is_ok' => 'The installation process was successful.
The final step will now attempt to delete any file and database backup created during the update process.
You may choose to skip this step by deleting ./data/do-install.txt manually.', 'installation_step' => 'Installation — step %d · FreshRSS', @@ -290,7 +281,6 @@ return array( 'no_rss_feed' => 'No RSS feed', 'no_selected_feed' => 'No feed selected.', 'no_update' => 'No update to apply', - 'no_zip_extension' => 'Zip extension is not present on your server.', 'not_read' => '%d unread', 'not_reads' => '%d unread', 'not_yet_implemented' => 'Not yet implemented', @@ -362,7 +352,6 @@ return array( 'show_adaptive' => 'Adjust showing', 'show_all_articles' => 'Show all articles', 'sort_order' => 'Sort order', - 'starred_list' => 'List of favourite articles', 'steps' => 'Steps', 'sticky_post' => 'Stick the article to the top when opened', 'theme' => 'Theme', @@ -398,5 +387,4 @@ return array( 'your_diaspora_pod' => 'Your Diaspora* pod', 'your_shaarli' => 'Your Shaarli', 'your_wallabag' => 'Your wallabag', - 'zip_error' => 'An error occured during Zip import.', ); diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index b8bc3d33d..dbd148dee 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -37,6 +37,17 @@ return array( 'validator' => 'Check the validity of the feed', 'website' => 'Website URL', ), + 'import_export' => array( + 'export' => 'Export', + 'export_opml' => 'Export list of feeds (OPML)', + 'export_starred' => 'Export your favourites', + 'feed_list' => 'List of %s articles', + 'file_to_import' => 'File to import
(OPML, Json or Zip)', + 'file_to_import_no_zip' => 'File to import
(OPML or Json)', + 'import' => 'Import', + 'starred_list' => 'List of favourite articles', + 'title' => 'Import / export', + ), 'menu' => array( 'bookmark' => 'Subscribe (FreshRSS bookmark)', 'import_export' => 'Import / export', diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index 98d3c3eb2..7c4619ebc 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -1,6 +1,14 @@ array( + 'export_no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.', + 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.', + 'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues.', + 'file_cannot_be_uploaded' => 'Le fichier ne peut pas être téléchargé !', + 'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.', + 'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.', + ), 'login' => array( 'error' => 'L’identifiant est invalide', 'success' => 'Vous êtes désormais connecté', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 9d663680c..a8f60979e 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -8,7 +8,9 @@ return array( 'disable' => 'Désactiver', 'empty' => 'Vider', 'enable' => 'Activer', + 'export' => 'Exporter', 'filter' => 'Filtrer', + 'import' => 'Importer', 'manage' => 'Gérer', 'mark_read' => 'Marquer comme lu', 'remove' => 'Supprimer', @@ -216,26 +218,16 @@ return array( 'dom_is_ok' => 'Vous disposez du nécessaire pour parcourir le DOM', 'error_occurred' => 'Une erreur est survenue !', 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.
%s?output=rss&token=%s', - 'export' => 'Exporter', - 'export_no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.', - 'export_opml' => 'Exporter la liste des flux (OPML)', - 'export_starred' => 'Exporter les favoris', 'favicons_is_ok' => 'Les droits sur le répertoire des favicons sont bons', 'feed' => 'Flux', 'feed_actualized' => '%s a été mis à jour.', 'feed_added' => 'Le flux %s a bien été ajouté.', 'feed_deleted' => 'Le flux a été supprimé.', - 'feed_list' => 'Liste des articles de %s', 'feed_not_added' => '%s n’a pas pu être ajouté.', 'feeds' => 'Flux', 'feeds_actualized' => 'Les flux ont été mis à jour.', - 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.', - 'feeds_imported_with_errors' => 'Vos flux ont été importés mais des erreurs sont survenues.', 'feeds_marked_read' => 'Les flux ont été marqués comme lus.', - 'file_cannot_be_uploaded' => 'Le fichier ne peut pas être téléchargé !', 'file_is_nok' => 'Veuillez vérifier les droits sur le répertoire %s. Le serveur HTTP doit être capable d’écrire dedans', - 'file_to_import' => 'Fichier à importer
(OPML, Json ou Zip)', - 'file_to_import_no_zip' => 'Fichier à importer
(OPML ou Json)', 'finish_installation' => 'Terminer l’installation', 'first_article' => 'Passer au premier article', 'fix_errors_before' => 'Veuillez corriger les erreurs avant de passer à l’étape suivante.', @@ -251,7 +243,6 @@ return array( 'http_referer_is_nok' => 'Veuillez vérifier que vous ne modifiez pas votre HTTP REFERER.', 'http_referer_is_ok' => 'Le HTTP REFERER est connu et semble correspondre à votre serveur.', 'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images', - 'import' => 'Importer', 'install_not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier %s à la main.', 'installation_is_ok' => 'L’installation s’est bien passée.
La dernière étape va maintenant tenter de supprimer les fichiers ainsi que d’éventuelles copies de base de données créés durant le processus de mise à jour.
Vous pouvez choisir de sauter cette étape en supprimant ./data/do-install.txt manuellement.', 'installation_step' => 'Installation — étape %d · FreshRSS', @@ -290,7 +281,6 @@ return array( 'no_rss_feed' => 'Aucun flux RSS', 'no_selected_feed' => 'Aucun flux sélectionné.', 'no_update' => 'Aucune mise à jour à appliquer', - 'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.', 'not_read' => '%d non lu', 'not_reads' => '%d non lus', 'not_yet_implemented' => 'Pas encore implémenté', @@ -362,7 +352,6 @@ return array( 'show_adaptive' => 'Adapter l’affichage', 'show_all_articles' => 'Afficher tous les articles', 'sort_order' => 'Ordre de tri', - 'starred_list' => 'Liste des articles favoris', 'steps' => 'Étapes', 'sticky_post' => 'Aligner l’article en haut quand il est ouvert', 'theme' => 'Thème', @@ -398,5 +387,4 @@ return array( 'your_diaspora_pod' => 'Votre pod Diaspora*', 'your_shaarli' => 'Votre Shaarli', 'your_wallabag' => 'Votre wallabag', - 'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.', ); diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index 9d7317db7..a58392ff4 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -37,6 +37,17 @@ return array( 'validator' => 'Vérifier la valididé du flux', 'website' => 'URL du site', ), + 'import_export' => array( + 'export' => 'Exporter', + 'export_opml' => 'Exporter la liste des flux (OPML)', + 'export_starred' => 'Exporter les favoris', + 'feed_list' => 'Liste des articles de %s', + 'file_to_import' => 'Fichier à importer
(OPML, Json ou Zip)', + 'file_to_import_no_zip' => 'Fichier à importer
(OPML ou Json)', + 'import' => 'Importer', + 'starred_list' => 'Liste des articles favoris', + 'title' => 'Importer / exporter', + ), 'menu' => array( 'bookmark' => 'S’abonner (bookmark FreshRSS)', 'import_export' => 'Importer / exporter', diff --git a/app/views/importExport/index.phtml b/app/views/importExport/index.phtml index 36c0eab4e..a64524bf1 100644 --- a/app/views/importExport/index.phtml +++ b/app/views/importExport/index.phtml @@ -1,13 +1,13 @@ partial('aside_subscription'); ?>
- +
- +
@@ -16,24 +16,24 @@
- +
feeds) > 0) { ?>
- +
- +
-- cgit v1.2.3 From c1a3412b97d5f19e6c1102902156b098598e7ce9 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Dec 2014 18:15:41 +0100 Subject: Fix i18n for auth and category controllers --- app/Controllers/authController.php | 36 +++++++++++------------ app/Controllers/categoryController.php | 34 +++++++++++----------- app/Controllers/importExportController.php | 6 ++-- app/i18n/en/feedback.php | 46 ++++++++++++++++++++++++------ app/i18n/en/gen.php | 16 ----------- app/i18n/en/sub.php | 2 -- app/i18n/fr/feedback.php | 46 ++++++++++++++++++++++++------ app/i18n/fr/gen.php | 20 ++----------- app/i18n/fr/sub.php | 2 -- 9 files changed, 114 insertions(+), 94 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 44496cd3e..55481f859 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -22,7 +22,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { Minz_Error::error(403); } - Minz_View::prependTitle(_t('gen.title.authentication') . ' · '); + Minz_View::prependTitle(_t('gen.auth.title') . ' · '); if (Minz_Request::isPost()) { $ok = true; @@ -56,10 +56,10 @@ class FreshRSS_auth_Controller extends Minz_ActionController { invalidateHttpCache(); if ($ok) { - Minz_Request::good(_t('configuration_updated'), + Minz_Request::good(_t('feedback.configuration.updated'), array('c' => 'auth', 'a' => 'index')); } else { - Minz_Request::bad(_t('error_occurred'), + Minz_Request::bad(_t('feedback.configuration.error'), array('c' => 'auth', 'a' => 'index')); } } @@ -123,7 +123,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { } catch(Minz_Exception $e) { // $username is not a valid user, nor the configuration file! Minz_Log::warning('Login failure: ' . $e->getMessage()); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'login')); } @@ -144,14 +144,14 @@ class FreshRSS_auth_Controller extends Minz_ActionController { } // All is good, go back to the index. - Minz_Request::good(_t('feedback.login.success'), + Minz_Request::good(_t('feedback.auth.login.success'), array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Password mismatch for' . ' user=' . $username . ', nonce=' . $nonce . ', c=' . $challenge); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'login')); } } elseif (Minz_Configuration::unsafeAutologinEnabled()) { @@ -183,11 +183,11 @@ class FreshRSS_auth_Controller extends Minz_ActionController { Minz_Session::_param('passwordHash', $s); FreshRSS_Auth::giveAccess(); - Minz_Request::good(_t('feedback.login.success'), + Minz_Request::good(_t('feedback.auth.login.success'), array('c' => 'index', 'a' => 'index')); } else { Minz_Log::warning('Unsafe password mismatch for user ' . $username); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'login')); } } @@ -261,7 +261,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { $res = array(); $res['status'] = 'failure'; - $res['reason'] = _t('invalid_login'); + $res['reason'] = _t('feedback.auth.login.invalid'); } header('Content-Type: application/json; charset=UTF-8'); @@ -275,7 +275,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { public function logoutAction() { invalidateHttpCache(); FreshRSS_Auth::removeAccess(); - Minz_Request::good(_t('feedback.logout.success'), + Minz_Request::good(_t('feedback.auth.logout.success'), array('c' => 'index', 'a' => 'index')); } @@ -285,7 +285,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { * After reseting, form auth is set by default. */ public function resetAction() { - Minz_View::prependTitle(_t('auth_reset') . ' · '); + Minz_View::prependTitle(_t('feedback.auth.title_reset') . ' · '); Minz_View::appendScript(Minz_Url::display( '/scripts/bcrypt.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/bcrypt.min.js') @@ -296,8 +296,8 @@ class FreshRSS_auth_Controller extends Minz_ActionController { if (Minz_Configuration::authType() != 'persona') { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('auth_not_persona') + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.auth.not_persona') ); $this->view->no_form = true; return; @@ -308,8 +308,8 @@ class FreshRSS_auth_Controller extends Minz_ActionController { if (!$conf->passwordHash) { $this->view->message = array( 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('auth_no_password_set') + 'title' => _t('gen.short.damn'), + 'body' => _t('feedback.auth.no_password_set') ); $this->view->no_form = true; return; @@ -331,9 +331,9 @@ class FreshRSS_auth_Controller extends Minz_ActionController { $ok = Minz_Configuration::writeFile(); if ($ok) { - Minz_Request::good(_t('auth_form_set')); + Minz_Request::good(_t('feedback.auth.form.set')); } else { - Minz_Request::bad(_t('auth_form_not_set'), + Minz_Request::bad(_t('feedback.auth.form.not_set'), array('c' => 'auth', 'a' => 'reset')); } } else { @@ -341,7 +341,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController { ' user=' . $username . ', nonce=' . $nonce . ', c=' . $challenge); - Minz_Request::bad(_t('invalid_login'), + Minz_Request::bad(_t('feedback.auth.login.invalid'), array('c' => 'auth', 'a' => 'reset')); } } diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 50b1d841a..5f1beae90 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -34,7 +34,7 @@ class FreshRSS_category_Controller extends Minz_ActionController { $this->view->categories = $catDAO->listCategories(false); if (count($this->view->categories) >= $limits['max_categories']) { - Minz_Request::bad(_t('sub.categories.over_max', $limits['max_categories']), + Minz_Request::bad(_t('feedback.sub.category.over_max', $limits['max_categories']), $url_redirect); } @@ -43,13 +43,13 @@ class FreshRSS_category_Controller extends Minz_ActionController { $cat_name = Minz_Request::param('new-category'); if (!$cat_name) { - Minz_Request::bad(_t('category_no_name'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); } $cat = new FreshRSS_Category($cat_name); if ($catDAO->searchByName($cat->name()) != null) { - Minz_Request::bad(_t('category_name_exists'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.name_exists'), $url_redirect); } $values = array( @@ -58,9 +58,9 @@ class FreshRSS_category_Controller extends Minz_ActionController { ); if ($catDAO->addCategory($values)) { - Minz_Request::good(_t('category_created', $cat->name()), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.created', $cat->name()), $url_redirect); } else { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } } @@ -84,11 +84,11 @@ class FreshRSS_category_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); $name = Minz_Request::param('name', ''); if (strlen($name) <= 0) { - Minz_Request::bad(_t('category_no_name'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); } if ($catDAO->searchById($id) == null) { - Minz_Request::bad(_t('category_not_exist'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.not_exist'), $url_redirect); } $cat = new FreshRSS_Category($name); @@ -97,9 +97,9 @@ class FreshRSS_category_Controller extends Minz_ActionController { ); if ($catDAO->updateCategory($id, $values)) { - Minz_Request::good(_t('category_updated'), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); } else { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } } @@ -125,26 +125,26 @@ class FreshRSS_category_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); if (!$id) { - Minz_Request::bad(_t('category_no_id'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_id'), $url_redirect); } if ($id === $default_category->id()) { - Minz_Request::bad(_t('category_not_delete_default'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.not_delete_default'), $url_redirect); } if ($feedDAO->changeCategory($id, $default_category->id()) === false) { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } if ($catDAO->deleteCategory($id) === false) { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } // Remove related queries. FreshRSS_Context::$conf->remove_query_by_get('c_' . $id); FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('category_deleted'), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.deleted'), $url_redirect); } Minz_Request::forward($url_redirect, true); @@ -166,7 +166,7 @@ class FreshRSS_category_Controller extends Minz_ActionController { $id = Minz_Request::param('id'); if (!$id) { - Minz_Request::bad(_t('category_no_id'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.no_id'), $url_redirect); } // List feeds to remove then related user queries. @@ -181,9 +181,9 @@ class FreshRSS_category_Controller extends Minz_ActionController { } FreshRSS_Context::$conf->save(); - Minz_Request::good(_t('category_emptied'), $url_redirect); + Minz_Request::good(_t('feedback.sub.category.emptied'), $url_redirect); } else { - Minz_Request::bad(_t('error_occurred'), $url_redirect); + Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } } diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 2360ce53b..f29051f34 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -183,7 +183,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { if (isset($elt['xmlUrl'])) { // If xmlUrl exists, it means it is a feed if ($nb_feeds >= $limits['max_feeds']) { - Minz_Log::warning(_t('sub.feed.over_max', + Minz_Log::warning(_t('feedback.sub.feed.over_max', $limits['max_feeds'])); $is_error = true; continue; @@ -197,7 +197,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // No xmlUrl? It should be a category! $limit_reached = ($nb_cats >= $limits['max_categories']); if ($limit_reached) { - Minz_Log::warning(_t('sub.category.over_max', + Minz_Log::warning(_t('feedback.sub.category.over_max', $limits['max_categories'])); } @@ -337,7 +337,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { // Feed does not exist in DB,we should to try to add it. if ($nb_feeds >= $limits['max_feeds']) { // Oops, no more place! - Minz_Log::warning(_t('sub.feed.over_max', $limits['max_feeds'])); + Minz_Log::warning(_t('feedback.sub.feed.over_max', $limits['max_feeds'])); } else { $feed = $this->addFeedJson($item['origin'], $google_compliant); } diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index 62fac81eb..148ec1acc 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -1,6 +1,25 @@ array( + 'form' => array( + 'not_set' => 'A problem occured during authentication system configuration. Please retry later.', + 'set' => 'Form is now your default authentication system.', + ), + 'login' => array( + 'invalid' => 'Login is invalid', + 'success' => 'You are connected', + ), + 'logout' => array( + 'success' => 'You are disconnected', + ), + 'no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', + 'not_persona' => 'Only Persona system can be reset.', + ), + 'configuration' => array( + 'updated' => 'Configuration has been updated', + 'error' => 'An error occurred during configuration saving', + ), 'import_export' => array( 'export_no_zip_extension' => 'Zip extension is not present on your server. Please try to export files one by one.', 'feeds_imported' => 'Your feeds have been imported and will now be updated', @@ -9,16 +28,25 @@ return array( 'no_zip_extension' => 'Zip extension is not present on your server.', 'zip_error' => 'An error occured during Zip import.', ), - 'login' => array( - 'error' => 'Login is invalid', - 'success' => 'You are connected', - ), - 'logout' => array( - 'success' => 'You are disconnected', - ), 'sub' => array( - 'error_occurred' => 'Feed cannot be updated', - 'feed_updated' => 'Feed has been updated', + 'category' => array( + 'created' => 'Category %s has been created.', + 'deleted' => 'Category has been deleted.', + 'emptied' => 'Category has been emptied', + 'error' => 'Category cannot be updated', + 'name_exists' => 'Category name already exists.', + 'no_id' => 'You must precise the id of the category.', + 'no_name' => 'Category name cannot be empty.', + 'not_delete_default' => 'You cannot delete the default category!', + 'not_exist' => 'The category does not exist!', + 'over_max' => 'You have reached your limit of categories (%d)', + 'updated' => 'Category has been updated.', + ), + 'feed' => array( + 'error' => 'Feed cannot be updated', + 'over_max' => 'You have reached your limit of feeds (%d)', + 'updated' => 'Feed has been updated', + ), ), 'user_profile' => array( 'updated' => 'Your profile has been modified', diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index 856c91b3b..48bda04a1 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -148,11 +148,7 @@ return array( 'articles_per_page' => 'Number of articles per page', 'articles_to_display' => 'Articles to display', 'auth_form' => 'Web form (traditional, requires JavaScript)', - 'auth_form_not_set' => 'A problem occured during authentication system configuration. Please retry later.', - 'auth_form_set' => 'Form is now your default authentication system.', - 'auth_no_password_set' => 'Administrator password hasn’t been set. This feature isn’t available.', 'auth_none' => 'None (dangerous)', - 'auth_not_persona' => 'Only Persona system can be reset.', 'auth_persona' => 'Mozilla Persona (modern, requires JavaScript)', 'auth_reset' => 'Authentication reset', 'auth_token' => 'Authentication token', @@ -181,21 +177,11 @@ return array( 'categories_management' => 'Categories management', 'categories_updated' => 'Categories have been updated', 'categorize' => 'Store in a category', - 'category_created' => 'Category %s has been created.', - 'category_deleted' => 'Category has been deleted.', - 'category_emptied' => 'Category has been emptied', - 'category_name_exists' => 'Category name already exists.', - 'category_no_id' => 'You must precise the id of the category.', - 'category_no_name' => 'Category name cannot be empty.', - 'category_not_delete_default' => 'You cannot delete the default category!', - 'category_not_exist' => 'The category does not exist!', 'category_number' => 'Category n°%d', - 'category_updated' => 'Category has been updated.', 'change_value' => 'You should change this value by any other', 'checks' => 'Checks', 'choose_language' => 'Choose a language for FreshRSS', 'collapse_article' => 'Collapse', - 'configuration_updated' => 'Configuration has been updated', 'congratulations' => 'Congratulations!', 'content_width' => 'Content width', 'create' => 'Create', @@ -216,7 +202,6 @@ return array( 'do_not_change_if_doubt' => 'Don’t change if you doubt about it', 'dom_is_nok' => 'You lack a required library to browse the DOM (php-xml package)', 'dom_is_ok' => 'You have the required library to browse the DOM', - 'error_occurred' => 'An error occurred', 'explain_token' => 'Allows to access RSS output of the default user without authentication.
%s?output=rss&token=%s', 'favicons_is_ok' => 'Permissions on favicons directory are good', 'feed' => 'Feed', @@ -247,7 +232,6 @@ return array( 'installation_is_ok' => 'The installation process was successful.
The final step will now attempt to delete any file and database backup created during the update process.
You may choose to skip this step by deleting ./data/do-install.txt manually.', 'installation_step' => 'Installation — step %d · FreshRSS', 'internal_problem_feed' => 'The RSS feed could not be added. Check FressRSS logs for details.', - 'invalid_login' => 'Login is invalid', 'invalid_url' => 'URL %s is invalid', 'is_admin' => 'is administrator', 'javascript_for_shortcuts' => 'JavaScript must be enabled in order to use shortcuts', diff --git a/app/i18n/en/sub.php b/app/i18n/en/sub.php index dbd148dee..14268c72c 100644 --- a/app/i18n/en/sub.php +++ b/app/i18n/en/sub.php @@ -6,7 +6,6 @@ return array( 'add' => 'Add a category', 'empty' => 'Empty category', 'new' => 'New category', - 'over_max' => 'You have reached your limit of categories (%d)', ), 'feed' => array( 'add' => 'Add a RSS feed', @@ -29,7 +28,6 @@ return array( 'keep_history' => 'Minimum number of articles to keep', 'moved_category_deleted' => 'When you delete a category, their feeds are automatically classified under %s.', 'number_entries' => '%d articles', - 'over_max' => 'You have reached your limit of feeds (%d)', 'stats' => 'Statistics', 'title' => 'Title', 'ttl' => 'Do not automatically refresh more often than', diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index 7c4619ebc..d79d3eccd 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -1,6 +1,25 @@ array( + 'form' => array( + 'not_set' => 'Un problème est survenu lors de la configuration de votre système d’authentification. Veuillez réessayer plus tard.', + 'set' => 'Le formulaire est désormais votre système d’authentification.', + ), + 'login' => array( + 'invalid' => 'L’identifiant est invalide', + 'success' => 'Vous êtes désormais connecté', + ), + 'logout' => array( + 'success' => 'Vous avez été déconnecté', + ), + 'no_password_set' => 'Aucun mot de passe administrateur n’a été précisé. Cette fonctionnalité n’est pas disponible.', + 'not_persona' => 'Seul le système d’authentification Persona peut être réinitialisé.', + ), + 'configuration' => array( + 'updated' => 'La configuration a été mise à jour', + 'error' => 'Une erreur est survenue en sauvegardant la configuration', + ), 'import_export' => array( 'export_no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur. Veuillez essayer d’exporter les fichiers un par un.', 'feeds_imported' => 'Vos flux ont été importés et vont maintenant être actualisés.', @@ -9,16 +28,25 @@ return array( 'no_zip_extension' => 'L’extension Zip n’est pas présente sur votre serveur.', 'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.', ), - 'login' => array( - 'error' => 'L’identifiant est invalide', - 'success' => 'Vous êtes désormais connecté', - ), - 'logout' => array( - 'success' => 'Vous avez été déconnecté', - ), 'sub' => array( - 'error_occurred' => 'Le flux n’a pas pu être modifié', - 'feed_updated' => 'Le flux a été mis à jour', + 'category' => array( + 'created' => 'La catégorie %s a été créée.', + 'deleted' => 'La catégorie a été supprimée.', + 'emptied' => 'La catégorie a été vidée.', + 'error' => 'La catégorie n’a pas pu être modifiée', + 'name_exists' => 'Une catégorie possède déjà ce nom.', + 'no_id' => 'Vous devez préciser l’id de la catégorie.', + 'no_name' => 'Vous devez préciser un nom pour la catégorie.', + 'not_delete_default' => 'Vous ne pouvez pas supprimer la catégorie par défaut !', + 'not_exist' => 'Cette catégorie n’existe pas !', + 'over_max' => 'Vous avez atteint votre limite de catégories (%d)', + 'updated' => 'La catégorie a été mise à jour.', + ), + 'feed' => array( + 'error' => 'Le flux n’a pas pu être modifié', + 'over_max' => 'Vous avez atteint votre limite de flux (%d)', + 'updated' => 'Le flux a été mis à jour', + ), ), 'user_profile' => array( 'updated' => 'Votre profil a été mis à jour', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index a8f60979e..55941c39d 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -21,6 +21,8 @@ return array( 'auth' => array( 'login' => 'Connexion', 'logout' => 'Déconnexion', + 'title' => 'Authentification', + 'title_reset' => 'Réinitialisation de l’authentification', ), 'date' => array( 'Apr' => '\\a\\v\\r\\i\\l', @@ -124,7 +126,6 @@ return array( 'yes' => 'Oui', ), 'title' => array( - 'authentication' => 'Authentification', 'check_install' => 'Vérification de l’installation', 'user_management' => 'Gestion des utilisateurs', 'user_profile' => 'Profil', @@ -148,13 +149,8 @@ return array( 'articles_per_page' => 'Nombre d’articles par page', 'articles_to_display' => 'Articles à afficher', 'auth_form' => 'Formulaire (traditionnel, requiert JavaScript)', - 'auth_form_not_set' => 'Un problème est survenu lors de la configuration de votre système d’authentification. Veuillez réessayer plus tard.', - 'auth_form_set' => 'Le formulaire est désormais votre système d’authentification.', - 'auth_no_password_set' => 'Aucun mot de passe administrateur n’a été précisé. Cette fonctionnalité n’est pas disponible.', 'auth_none' => 'Aucune (dangereux)', - 'auth_not_persona' => 'Seul le système d’authentification Persona peut être réinitialisé.', 'auth_persona' => 'Mozilla Persona (moderne, requiert JavaScript)', - 'auth_reset' => 'Réinitialisation de l’authentification', 'auth_token' => 'Jeton d’identification', 'auth_type' => 'Méthode d’authentification', 'auth_will_reset' => 'Le système d’authentification va être réinitialisé : un formulaire sera utilisé à la place de Persona.', @@ -181,21 +177,11 @@ return array( 'categories_management' => 'Gestion des catégories', 'categories_updated' => 'Les catégories ont été mises à jour.', 'categorize' => 'Ranger dans une catégorie', - 'category_created' => 'La catégorie %s a été créée.', - 'category_deleted' => 'La catégorie a été supprimée.', - 'category_emptied' => 'La catégorie a été vidée.', - 'category_name_exists' => 'Une catégorie possède déjà ce nom.', - 'category_no_id' => 'Vous devez préciser l’id de la catégorie.', - 'category_no_name' => 'Vous devez préciser un nom pour la catégorie.', - 'category_not_delete_default' => 'Vous ne pouvez pas supprimer la catégorie par défaut !', - 'category_not_exist' => 'Cette catégorie n’existe pas !', 'category_number' => 'Catégorie n°%d', - 'category_updated' => 'La catégorie a été mise à jour.', 'change_value' => 'Vous devriez changer cette valeur par n’importe quelle autre', 'checks' => 'Vérifications', 'choose_language' => 'Choisissez la langue pour FreshRSS', 'collapse_article' => 'Refermer', - 'configuration_updated' => 'La configuration a été mise à jour.', 'congratulations' => 'Félicitations !', 'content_width' => 'Largeur du contenu', 'create' => 'Créer', @@ -216,7 +202,6 @@ return array( 'do_not_change_if_doubt' => 'Laissez tel quel dans le doute', 'dom_is_nok' => 'Il manque une librairie pour parcourir le DOM (paquet php-xml)', 'dom_is_ok' => 'Vous disposez du nécessaire pour parcourir le DOM', - 'error_occurred' => 'Une erreur est survenue !', 'explain_token' => 'Permet d’accéder à la sortie RSS de l’utilisateur par défaut sans besoin de s’authentifier.
%s?output=rss&token=%s', 'favicons_is_ok' => 'Les droits sur le répertoire des favicons sont bons', 'feed' => 'Flux', @@ -247,7 +232,6 @@ return array( 'installation_is_ok' => 'L’installation s’est bien passée.
La dernière étape va maintenant tenter de supprimer les fichiers ainsi que d’éventuelles copies de base de données créés durant le processus de mise à jour.
Vous pouvez choisir de sauter cette étape en supprimant ./data/do-install.txt manuellement.', 'installation_step' => 'Installation — étape %d · FreshRSS', 'internal_problem_feed' => 'Le flux ne peut pas être ajouté. Consulter les logs de FreshRSS pour plus de détails.', - 'invalid_login' => 'L’identifiant est invalide !', 'invalid_url' => 'L’url %s est invalide.', 'is_admin' => 'est administrateur', 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', diff --git a/app/i18n/fr/sub.php b/app/i18n/fr/sub.php index a58392ff4..0257c8b4d 100644 --- a/app/i18n/fr/sub.php +++ b/app/i18n/fr/sub.php @@ -6,7 +6,6 @@ return array( 'add' => 'Ajouter une catégorie', 'empty' => 'Catégorie vide', 'new' => 'Nouvelle catégorie', - 'over_max' => 'Vous avez atteint votre limite de catégories (%d)', ), 'feed' => array( 'add' => 'Ajouter un flux RSS', @@ -29,7 +28,6 @@ return array( 'keep_history' => 'Nombre minimum d’articles à conserver', 'moved_category_deleted' => 'Lors de la suppression d’une catégorie, ses flux seront automatiquement classés dans %s.', 'number_entries' => '%d articles', - 'over_max' => 'Vous avez atteint votre limite de flux (%d)', 'stats' => 'Statistiques', 'title' => 'Titre', 'ttl' => 'Ne pas automatiquement rafraîchir plus souvent que', -- cgit v1.2.3 From 7f4ca35fc331ca4ce5e097d574e99417da0ef73e Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 17 Dec 2014 17:21:41 +0100 Subject: Fix i18n strings for sharing Fix https://github.com/FreshRSS/FreshRSS/issues/728 --- app/Controllers/entryController.php | 2 -- app/Controllers/importExportController.php | 2 -- app/views/index/normal.phtml | 8 ++++++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/Controllers/importExportController.php') diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index c894ae9aa..aae08c413 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -34,8 +34,6 @@ class FreshRSS_entry_Controller extends Minz_ActionController { * - nextGet (default: $get) * - idMax (default: 0) * - is_read (default: true) - * - * @todo nextGet system should not be present here... or should be? */ public function readAction() { $id = Minz_Request::param('id'); diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index f29051f34..6eefa0f6f 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -125,8 +125,6 @@ class FreshRSS_importExport_Controller extends Minz_ActionController { * * Itis a *very* basic guess file type function. Only based on filename. * That's could be improved but should be enough for what we have to do. - * - * @todo move into lib_rss.php */ private function guessFileType($filename) { if (substr_compare($filename, '.zip', -4) === 0) { diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index 3a27a702b..66111397c 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -140,10 +140,14 @@ if (!empty($this->entries)) {
@@ -39,9 +39,9 @@
@@ -49,7 +49,7 @@
@@ -58,7 +58,7 @@
@@ -68,7 +68,7 @@
@@ -78,7 +78,7 @@
@@ -88,7 +88,7 @@
@@ -98,7 +98,7 @@
@@ -108,7 +108,7 @@
@@ -118,7 +118,7 @@
@@ -129,19 +129,19 @@
@@ -151,7 +151,7 @@
diff --git a/app/views/configure/sharing.phtml b/app/views/configure/sharing.phtml index ffe3c039b..f5c133f07 100644 --- a/app/views/configure/sharing.phtml +++ b/app/views/configure/sharing.phtml @@ -15,8 +15,8 @@
'> - sharing as $key => $sharing) { ?> - shares[$sharing['type']]; ?> + sharing as $key => $sharing) { ?> + shares[$sharing['type']]; ?>