summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rwxr-xr-xapp/controllers/apiController.php6
-rwxr-xr-xapp/controllers/configureController.php28
-rwxr-xr-xapp/controllers/entryController.php10
-rwxr-xr-xapp/controllers/feedController.php44
-rwxr-xr-xapp/controllers/indexController.php12
5 files changed, 46 insertions, 54 deletions
diff --git a/app/controllers/apiController.php b/app/controllers/apiController.php
index bc08386b5..025908f3e 100755
--- a/app/controllers/apiController.php
+++ b/app/controllers/apiController.php
@@ -20,11 +20,11 @@ class apiController extends ActionController {
$notes = $e->notes ();
if ($notes == '') {
$feed = $e->feed (true);
- $notes = 'Article publié initialement sur <a href="' . $feed->website () . '">' . $feed->name () . '</a>';
if($author != '') {
- $notes .= ' par ' . $author;
+ $notes = Translate::t ('article_published_on_author', $feed->website (), $feed->name (), $author);
+ } else {
+ $notes = Translate::t ('article_published_on', $feed->website (), $feed->name ());
}
- $notes .= ', mis en favoris dans <a href="https://github.com/marienfressinaud/FreshRSS">FreshRSS</a>';
}
$id = $e->id ();
diff --git a/app/controllers/configureController.php b/app/controllers/configureController.php
index 18a56c066..7e73fd2ba 100755
--- a/app/controllers/configureController.php
+++ b/app/controllers/configureController.php
@@ -5,7 +5,7 @@ class configureController extends ActionController {
if (login_is_conf ($this->view->conf) && !is_logged ()) {
Error::error (
403,
- array ('error' => array ('Vous n\'avez pas le droit d\'accéder à cette page'))
+ array ('error' => array (Translate::t ('access denied')))
);
}
}
@@ -48,7 +48,7 @@ class configureController extends ActionController {
// notif
$notif = array (
'type' => 'good',
- 'content' => 'Les catégories ont été mises à jour'
+ 'content' => Translate::t ('categories_updated')
);
Session::_param ('notification', $notif);
@@ -58,7 +58,7 @@ class configureController extends ActionController {
$this->view->categories = $catDAO->listCategories ();
$this->view->defaultCategory = $catDAO->getDefault ();
- View::prependTitle ('Gestion des catégories - ');
+ View::prependTitle (Translate::t ('categories_management') . ' - ');
}
public function feedAction () {
@@ -80,7 +80,7 @@ class configureController extends ActionController {
if (!$this->view->flux) {
Error::error (
404,
- array ('error' => array ('La page que vous cherchez n\'existe pas'))
+ array ('error' => array (Translate::t ('page_not_found')))
);
} else {
$catDAO = new CategoryDAO ();
@@ -102,12 +102,12 @@ class configureController extends ActionController {
$notif = array (
'type' => 'good',
- 'content' => 'Le flux a été mis à jour'
+ 'content' => Translate::t ('feed_updated')
);
} else {
$notif = array (
'type' => 'bad',
- 'content' => 'Une erreur est survenue lors de la mise à jour'
+ 'content' => Translate::t ('error_occurred_update')
);
}
@@ -115,10 +115,10 @@ class configureController extends ActionController {
Request::forward (array ('c' => 'configure', 'a' => 'feed', 'params' => array ('id' => $id)), true);
}
- View::prependTitle ('Gestion des flux RSS - ' . $this->view->flux->name () . ' - ');
+ View::prependTitle (Translate::t ('rss_feed_management') . ' - ' . $this->view->flux->name () . ' - ');
}
} else {
- View::prependTitle ('Gestion des flux RSS - ');
+ View::prependTitle (Translate::t ('rss_feed_management') . ' - ');
}
}
@@ -167,21 +167,21 @@ class configureController extends ActionController {
// notif
$notif = array (
'type' => 'good',
- 'content' => 'La configuration a été mise à jour'
+ 'content' => Translate::t ('configuration_updated')
);
Session::_param ('notification', $notif);
Request::forward (array ('c' => 'configure', 'a' => 'display'), true);
}
- View::prependTitle ('Gestion générale et affichage - ');
+ View::prependTitle (Translate::t ('general_and_reading_management') . ' - ');
}
public function importExportAction () {
$this->view->req = Request::param ('q');
if ($this->view->req == 'export') {
- View::_title ('feeds_opml.xml');
+ View::_title ('feeds.opml');
$this->view->_useLayout (false);
header('Content-Type: text/xml; charset=utf-8');
@@ -212,7 +212,7 @@ class configureController extends ActionController {
$this->view->feeds = $feedDAO->listFeeds ();
$this->view->flux = false;
- View::prependTitle ('Importation et exportation OPML - ');
+ View::prependTitle (Translate::t ('import_export_opml') . ' - ');
}
public function shortcutAction () {
@@ -251,13 +251,13 @@ class configureController extends ActionController {
// notif
$notif = array (
'type' => 'good',
- 'content' => 'Les raccourcis ont été mis à jour'
+ 'content' => Translate::t ('shortcuts_updated')
);
Session::_param ('notification', $notif);
Request::forward (array ('c' => 'configure', 'a' => 'shortcut'), true);
}
- View::prependTitle ('Gestion des raccourcis - ');
+ View::prependTitle (Translate::t ('shortcuts_management') . ' - ');
}
}
diff --git a/app/controllers/entryController.php b/app/controllers/entryController.php
index e3c4fe165..2ce260297 100755
--- a/app/controllers/entryController.php
+++ b/app/controllers/entryController.php
@@ -5,7 +5,7 @@ class entryController extends ActionController {
if (login_is_conf ($this->view->conf) && !is_logged ()) {
Error::error (
403,
- array ('error' => array ('Vous n\'avez pas le droit d\'accéder à cette page'))
+ array ('error' => array (Translate::t ('access denied')))
);
}
@@ -63,7 +63,7 @@ class entryController extends ActionController {
// notif
$notif = array (
'type' => 'good',
- 'content' => 'Les flux ont été marqués comme lu'
+ 'content' => Translate::t ('feeds_marked_read')
);
Session::_param ('notification', $notif);
} else {
@@ -130,12 +130,12 @@ class entryController extends ActionController {
if ($entryDAO->updateEntry ($id, $values)) {
$notif = array (
'type' => 'good',
- 'content' => 'Modifications enregistrées'
+ 'content' => Translate::t ('updated')
);
} else {
$notif = array (
'type' => 'bad',
- 'content' => 'Une erreur est survenue'
+ 'content' => Translate::t ('error_occured')
);
}
Session::_param ('notification', $notif);
@@ -157,7 +157,7 @@ class entryController extends ActionController {
if ($not_found) {
Error::error (
404,
- array ('error' => array ('La page que vous cherchez n\'existe pas'))
+ array ('error' => array (Translate::t ('page_not_found')))
);
} else {
$this->view->entry = $entry;
diff --git a/app/controllers/feedController.php b/app/controllers/feedController.php
index c67609d57..1232ddff4 100755
--- a/app/controllers/feedController.php
+++ b/app/controllers/feedController.php
@@ -10,7 +10,7 @@ class feedController extends ActionController {
if (login_is_conf ($this->view->conf) && !is_logged ()) {
Error::error (
403,
- array ('error' => array ('Vous n\'avez pas le droit d\'accéder à cette page'))
+ array ('error' => array (Translate::t ('access_denied')))
);
} else {
if (Request::isPost ()) {
@@ -37,7 +37,7 @@ class feedController extends ActionController {
if ($feedDAO->searchByUrl ($values['url'])) {
$notif = array (
'type' => 'bad',
- 'content' => 'Vous êtes déjà abonné à <em>' . $feed->name () . '</em>'
+ 'content' => Translate::t ('already_subscribed', $feed->name ())
);
Session::_param ('notification', $notif);
} elseif ($feedDAO->addFeed ($values)) {
@@ -52,7 +52,7 @@ class feedController extends ActionController {
// notif
$notif = array (
'type' => 'good',
- 'content' => 'Le flux <em>' . $feed->name () . '</em> a bien été ajouté'
+ 'content' => Translate::t ('feed_added', $feed->name ())
);
Session::_param ('notification', $notif);
$params['id'] = $feed->id ();
@@ -60,7 +60,7 @@ class feedController extends ActionController {
// notif
$notif = array (
'type' => 'bad',
- 'content' => '<em>' . $feed->name () . '</em> n\' a pas pu être ajouté'
+ 'content' => Translate::t ('feed_not_added', $feed->name ())
);
Session::_param ('notification', $notif);
}
@@ -68,22 +68,14 @@ class feedController extends ActionController {
Log::record ($e->getMessage (), Log::ERROR);
$notif = array (
'type' => 'bad',
- 'content' => 'Un problème interne a été rencontré, le flux n\'a pas pu être ajouté'
- );
- Session::_param ('notification', $notif);
- } catch (FileNotExistException $e) {
- Log::record ($e->getMessage (), Log::ERROR);
- // notif
- $notif = array (
- 'type' => 'bad',
- 'content' => 'Un problème de configuration a empêché l\'ajout du flux. Voir les logs pour plus d\'informations'
+ 'content' => Translate::t ('internal_problem_feed')
);
Session::_param ('notification', $notif);
} catch (Exception $e) {
// notif
$notif = array (
'type' => 'bad',
- 'content' => 'L\'url <em>' . $url . '</em> est invalide'
+ 'content' => Translate::t ('invalid_url', $url)
);
Session::_param ('notification', $notif);
}
@@ -144,18 +136,18 @@ class feedController extends ActionController {
$feed = reset ($feeds);
$notif = array (
'type' => 'good',
- 'content' => '<em>' . $feed->name () . '</em> a été mis à jour'
+ 'content' => Translate::t ('feed_actualized', $feed->name ())
);
$url['params'] = array ('get' => 'f_' . $feed->id ());
} elseif ($i > 0) {
$notif = array (
'type' => 'good',
- 'content' => $i . ' flux ont été mis à jour'
+ 'content' => Translate::t ('n_feeds_actualized', $i)
);
} else {
$notif = array (
'type' => 'bad',
- 'content' => 'Aucun flux n\'a pu être mis à jour'
+ 'content' => Translate::t ('no_feed_actualized')
);
}
@@ -165,7 +157,7 @@ class feedController extends ActionController {
} else {
$notif = array (
'type' => 'good',
- 'content' => 'Les flux ont été mis à jour'
+ 'content' => Translate::t ('feeds_actualized')
);
Session::_param ('notification', $notif);
$this->view->_useLayout (false);
@@ -176,7 +168,7 @@ class feedController extends ActionController {
if (login_is_conf ($this->view->conf) && !is_logged ()) {
Error::error (
403,
- array ('error' => array ('Vous n\'avez pas le droit d\'accéder à cette page'))
+ array ('error' => array (Translate::t ('access_denied')))
);
} else {
$entryDAO = new EntryDAO ();
@@ -219,9 +211,9 @@ class feedController extends ActionController {
}
if ($error) {
- $res = 'Les flux ont été importés mais des erreurs sont survenus';
+ $res = Translate::t ('feeds_imported_with_errors');
} else {
- $res = 'Les flux ont été importés';
+ $res = Translate::t ('feeds_imported');
}
$notif = array (
'type' => 'good',
@@ -240,7 +232,7 @@ class feedController extends ActionController {
if (login_is_conf ($this->view->conf) && !is_logged ()) {
Error::error (
403,
- array ('error' => array ('Vous n\'avez pas le droit d\'accéder à cette page'))
+ array ('error' => array (Translate::t ('access_denied')))
);
} else {
$type = Request::param ('type', 'feed');
@@ -251,24 +243,24 @@ class feedController extends ActionController {
if ($feedDAO->deleteFeedByCategory ($id)) {
$notif = array (
'type' => 'good',
- 'content' => 'La catégorie a été vidée'
+ 'content' => Translate::t ('category_emptied')
);
} else {
$notif = array (
'type' => 'bad',
- 'content' => 'Un problème est survenu'
+ 'content' => Translate::t ('error_occured')
);
}
} else {
if ($feedDAO->deleteFeed ($id)) {
$notif = array (
'type' => 'good',
- 'content' => 'Le flux a été supprimé'
+ 'content' => Translate::t ('feed_deleted')
);
} else {
$notif = array (
'type' => 'bad',
- 'content' => 'Un problème est survenu'
+ 'content' => Translate::t ('error_occured')
);
}
}
diff --git a/app/controllers/indexController.php b/app/controllers/indexController.php
index 8fa911631..dfdcfde42 100755
--- a/app/controllers/indexController.php
+++ b/app/controllers/indexController.php
@@ -35,13 +35,13 @@ class indexController extends ActionController {
// Récupère les flux par catégorie, favoris ou tous
if ($this->get['type'] == 'all') {
$entries = $entryDAO->listEntries ($this->mode, $search, $order);
- View::prependTitle ('Vos flux RSS - ');
+ View::prependTitle (Translate::t ('your_rss_feeds') . ' - ');
} elseif ($this->get['type'] == 'favoris') {
$entries = $entryDAO->listFavorites ($this->mode, $search, $order);
- View::prependTitle ('Vos favoris - ');
+ View::prependTitle (Translate::t ('your_favorites') . ' - ');
} elseif ($this->get['type'] == 'public') {
$entries = $entryDAO->listPublic ($this->mode, $search, $order);
- View::prependTitle ('Public - ');
+ View::prependTitle (Translate::t ('public') . ' - ');
} elseif ($this->get != false) {
if ($this->get['type'] == 'c') {
$cat = $catDAO->searchById ($this->get['filter']);
@@ -72,7 +72,7 @@ class indexController extends ActionController {
if ($error) {
Error::error (
404,
- array ('error' => array ('La page que vous cherchez n\'existe pas'))
+ array ('error' => array (Translate::t ('page_not_found')))
);
} else {
$this->view->mode = $this->mode;
@@ -93,7 +93,7 @@ class indexController extends ActionController {
}
public function aboutAction () {
- View::prependTitle ('À propos - ');
+ View::prependTitle (Translate::t ('about') . ' - ');
}
public function changeModeAction () {
@@ -143,7 +143,7 @@ class indexController extends ActionController {
} else {
$res = array ();
$res['status'] = 'failure';
- $res['reason'] = 'L\'identifiant est invalide';
+ $res['reason'] = Translate::t ('invalid_login');
}
$this->view->res = json_encode ($res);