mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-24 12:08:33 -04:00
Let's begin the big refactoring!
Minz_Translate::t\s? replaces by _t See https://github.com/marienfressinaud/FreshRSS/issues/655
This commit is contained in:
1 parent
5a9b08e084
commit
6c8b36f04e
27 files changed
+256
-258
No files matched your search
@@ -5,7 +5,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
|
||||
if (!$this->view->loginOk) {
|
||||
Minz_Error::error (
|
||||
403,
|
||||
array ('error' => array (Minz_Translate::t ('access_denied')))
|
||||
array ('error' => array (_t('access_denied')))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
|
||||
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('feeds_marked_read')
|
||||
'content' => _t('feeds_marked_read')
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
} else {
|
||||
@@ -111,7 +111,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
|
||||
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('optimization_complete')
|
||||
'content' => _t('optimization_complete')
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
}
|
||||
@@ -155,7 +155,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
|
||||
|
||||
$notif = array(
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t('purge_completed', $nbTotal)
|
||||
'content' => _t('purge_completed', $nbTotal)
|
||||
);
|
||||
Minz_Session::_param('notification', $notif);
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@ class FreshRSS_error_Controller extends Minz_ActionController {
|
||||
if ($this->view->errorMessage == '') {
|
||||
switch(Minz_Request::param('code')) {
|
||||
case 403:
|
||||
$this->view->errorMessage = Minz_Translate::t('forbidden_access');
|
||||
$this->view->errorMessage = _t('forbidden_access');
|
||||
break;
|
||||
case 404:
|
||||
default:
|
||||
$this->view->errorMessage = Minz_Translate::t('page_not_found');
|
||||
$this->view->errorMessage = _t('page_not_found');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
) {
|
||||
Minz_Error::error (
|
||||
403,
|
||||
array ('error' => array (Minz_Translate::t ('access_denied')))
|
||||
array ('error' => array (_t('access_denied')))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
// on est déjà abonné à ce flux
|
||||
$notif = array (
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t ('already_subscribed', $feed->name ())
|
||||
'content' => _t('already_subscribed', $feed->name ())
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
} else {
|
||||
@@ -93,7 +93,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
// problème au niveau de la base de données
|
||||
$notif = array (
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t ('feed_not_added', $feed->name ())
|
||||
'content' => _t('feed_not_added', $feed->name ())
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
} else {
|
||||
@@ -131,7 +131,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
// ok, ajout terminé
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('feed_added', $feed->name ())
|
||||
'content' => _t('feed_added', $feed->name ())
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
|
||||
@@ -143,14 +143,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
|
||||
$notif = array (
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t ('invalid_url', $url)
|
||||
'content' => _t('invalid_url', $url)
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
} catch (FreshRSS_Feed_Exception $e) {
|
||||
Minz_Log::record ($e->getMessage (), Minz_Log::WARNING);
|
||||
$notif = array (
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
|
||||
'content' => _t('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
} catch (Minz_FileNotExistException $e) {
|
||||
@@ -158,7 +158,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
|
||||
$notif = array (
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t ('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
|
||||
'content' => _t('internal_problem_feed', Minz_Url::display(array('a' => 'logs')))
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
} else {
|
||||
|
||||
// GET request so we must ask confirmation to user
|
||||
Minz_View::prependTitle(Minz_Translate::t('add_rss_feed') . ' · ');
|
||||
Minz_View::prependTitle(_t('add_rss_feed') . ' · ');
|
||||
$this->view->categories = $this->catDAO->listCategories(false);
|
||||
$this->view->feed = new FreshRSS_Feed($url);
|
||||
try {
|
||||
@@ -186,9 +186,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
// Already subscribe so we redirect to the feed configuration page
|
||||
$notif = array(
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t(
|
||||
'already_subscribed', $feed->name()
|
||||
)
|
||||
'content' => _t('already_subscribed', $feed->name())
|
||||
);
|
||||
Minz_Session::_param('notification', $notif);
|
||||
|
||||
@@ -210,7 +208,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
$n = $feedDAO->truncate($id);
|
||||
$notif = array(
|
||||
'type' => $n === false ? 'bad' : 'good',
|
||||
'content' => Minz_Translate::t ('n_entries_deleted', $n)
|
||||
'content' => _t('n_entries_deleted', $n)
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
invalidateHttpCache();
|
||||
@@ -336,19 +334,19 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
$feed = reset ($feeds);
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('feed_actualized', $feed->name ())
|
||||
'content' => _t('feed_actualized', $feed->name ())
|
||||
);
|
||||
} elseif ($flux_update > 1) {
|
||||
// plusieurs flux on été mis à jour
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('n_feeds_actualized', $flux_update)
|
||||
'content' => _t('n_feeds_actualized', $flux_update)
|
||||
);
|
||||
} else {
|
||||
// aucun flux n'a été mis à jour, oups
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('no_feed_to_refresh')
|
||||
'content' => _t('no_feed_to_refresh')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -370,7 +368,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
|
||||
// ressenti utilisateur
|
||||
$notif = array (
|
||||
'type' => 'good',
|
||||
'content' => Minz_Translate::t ('feeds_actualized')
|
||||
'content' => _t('feeds_actualized')
|
||||
);
|
||||
Minz_Session::_param ('notification', $notif);
|
||||
// et on désactive le layout car ne sert à rien
|
||||
|
||||
@@ -14,7 +14,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
if ($output === 'rss' && !$token_is_ok) {
|
||||
Minz_Error::error (
|
||||
403,
|
||||
array ('error' => array (Minz_Translate::t ('access_denied')))
|
||||
array ('error' => array (_t('access_denied')))
|
||||
);
|
||||
return;
|
||||
} elseif ($output !== 'rss') {
|
||||
@@ -62,7 +62,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
Minz_Log::record ('Not found [' . $getType . '][' . $getId . ']', Minz_Log::DEBUG);
|
||||
Minz_Error::error (
|
||||
404,
|
||||
array ('error' => array (Minz_Translate::t ('page_not_found')))
|
||||
array ('error' => array (_t('page_not_found')))
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
|
||||
Minz_Error::error (
|
||||
404,
|
||||
array ('error' => array (Minz_Translate::t ('page_not_found')))
|
||||
array ('error' => array (_t('page_not_found')))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -158,12 +158,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
private function checkAndProcessType ($getType, $getId) {
|
||||
switch ($getType) {
|
||||
case 'a':
|
||||
$this->view->currentName = Minz_Translate::t ('your_rss_feeds');
|
||||
$this->view->currentName = _t('your_rss_feeds');
|
||||
$this->nb_not_read_cat = $this->view->nb_not_read;
|
||||
$this->view->get_c = $getType;
|
||||
return true;
|
||||
case 's':
|
||||
$this->view->currentName = Minz_Translate::t ('your_favorites');
|
||||
$this->view->currentName = _t('your_favorites');
|
||||
$this->nb_not_read_cat = $this->view->nb_favorites['unread'];
|
||||
$this->view->get_c = $getType;
|
||||
return true;
|
||||
@@ -202,18 +202,18 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
}
|
||||
|
||||
public function aboutAction () {
|
||||
Minz_View::prependTitle (Minz_Translate::t ('about') . ' · ');
|
||||
Minz_View::prependTitle (_t('about') . ' · ');
|
||||
}
|
||||
|
||||
public function logsAction () {
|
||||
if (!$this->view->loginOk) {
|
||||
Minz_Error::error (
|
||||
403,
|
||||
array ('error' => array (Minz_Translate::t ('access_denied')))
|
||||
array ('error' => array (_t('access_denied')))
|
||||
);
|
||||
}
|
||||
|
||||
Minz_View::prependTitle (Minz_Translate::t ('logs') . ' · ');
|
||||
Minz_View::prependTitle (_t('logs') . ' · ');
|
||||
|
||||
if (Minz_Request::isPost ()) {
|
||||
FreshRSS_LogDAO::truncate();
|
||||
@@ -279,7 +279,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
} else {
|
||||
$res = array ();
|
||||
$res['status'] = 'failure';
|
||||
$res['reason'] = $reason == '' ? Minz_Translate::t ('invalid_login') : $reason;
|
||||
$res['reason'] = $reason == '' ? _t('invalid_login') : $reason;
|
||||
Minz_Log::record ('Persona: ' . $res['reason'], Minz_Log::WARNING);
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
if (!$ok) {
|
||||
$notif = array(
|
||||
'type' => 'bad',
|
||||
'content' => Minz_Translate::t('invalid_login')
|
||||
'content' => _t('invalid_login')
|
||||
);
|
||||
Minz_Session::_param('notification', $notif);
|
||||
}
|
||||
@@ -403,7 +403,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
} elseif (!Minz_Configuration::canLogIn()) {
|
||||
Minz_Error::error (
|
||||
403,
|
||||
array ('error' => array (Minz_Translate::t ('access_denied')))
|
||||
array ('error' => array (_t('access_denied')))
|
||||
);
|
||||
}
|
||||
invalidateHttpCache();
|
||||
|
||||
@@ -120,11 +120,11 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
|
||||
public function firstAction() {
|
||||
if (!$this->view->loginOk) {
|
||||
Minz_Error::error(
|
||||
403, array('error' => array(Minz_Translate::t('access_denied')))
|
||||
403, array('error' => array(_t('access_denied')))
|
||||
);
|
||||
}
|
||||
|
||||
Minz_View::prependTitle(Minz_Translate::t('stats') . ' · ');
|
||||
Minz_View::prependTitle(_t('stats') . ' · ');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
|
||||
if (!$this->view->loginOk) {
|
||||
Minz_Error::error(
|
||||
403,
|
||||
array('error' => array(Minz_Translate::t('access_denied')))
|
||||
array('error' => array(_t('access_denied')))
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
|
||||
|
||||
$notif = array(
|
||||
'type' => $ok ? 'good' : 'bad',
|
||||
'content' => Minz_Translate::t($ok ? 'configuration_updated' : 'error_occurred')
|
||||
'content' => _t($ok ? 'configuration_updated' : 'error_occurred')
|
||||
);
|
||||
Minz_Session::_param('notification', $notif);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
|
||||
|
||||
$notif = array(
|
||||
'type' => $ok ? 'good' : 'bad',
|
||||
'content' => Minz_Translate::t($ok ? 'user_created' : 'error_occurred', $new_user_name)
|
||||
'content' => _t($ok ? 'user_created' : 'error_occurred', $new_user_name)
|
||||
);
|
||||
Minz_Session::_param('notification', $notif);
|
||||
}
|
||||
@@ -194,7 +194,7 @@ class FreshRSS_users_Controller extends Minz_ActionController {
|
||||
|
||||
$notif = array(
|
||||
'type' => $ok ? 'good' : 'bad',
|
||||
'content' => Minz_Translate::t($ok ? 'user_deleted' : 'error_occurred', $username)
|
||||
'content' => _t($ok ? 'user_deleted' : 'error_occurred', $username)
|
||||
);
|
||||
Minz_Session::_param('notification', $notif);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user