A free, self-hostable news aggregator…
Translate non-English code comments and identifiers (#9383)
Inverle0addf32b36bc
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.phpindex de6830813..d2e57c2dc 100644--- a/app/Controllers/indexController.php+++ b/app/Controllers/indexController.php@@ -468,10 +468,10 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {}$this->view->logSearch = $search;- //gestion pagination+ // Pagination handling$page = Minz_Request::paramInt('page') ?: 1;$this->view->logsPaginator = new Minz_Paginator($logs);- $this->view->logsPaginator->_nbItemsPerPage(50);+ $this->view->logsPaginator->_itemsPerPage(50);$this->view->logsPaginator->_currentPage($page);}}diff --git a/app/Models/Entry.php b/app/Models/Entry.phpindex 6480ad1e4..a78cc71d1 100644--- a/app/Models/Entry.php+++ b/app/Models/Entry.php@@ -1067,7 +1067,7 @@ class FreshRSS_Entry extends Minz_Model {* @return bool True if the content was modified, false otherwise*/public function loadCompleteContent(bool $force = false): bool {- // Gestion du contenu+ // Content handling// Trying to fetch full article content even when feeds do not propose it$feed = $this->feed();if ($feed === null) {@@ -1077,7 +1077,7 @@ class FreshRSS_Entry extends Minz_Model {$entryDAO = FreshRSS_Factory::createEntryDao();$entry = $force ? null : $entryDAO->searchByGuid($this->feedId, $this->guid);if ($entry !== null) {- // l’article existe déjà en BDD, en se contente de recharger ce contenu+ // The article already exists in the database, so simply reload its content$this->content = $entry->content(false);} else {try {@@ -1104,7 +1104,7 @@ class FreshRSS_Entry extends Minz_Model {return true;}} catch (Exception $e) {- // rien à faire, on garde l’ancien contenu(requête a échoué)+ // Nothing to do: the request failed, so keep the previous contentMinz_Log::warning($e->getMessage());}}diff --git a/app/Models/Feed.php b/app/Models/Feed.phpindex 675c814ae..f00456666 100644--- a/app/Models/Feed.php+++ b/app/Models/Feed.php@@ -657,7 +657,7 @@ class FreshRSS_Feed extends Minz_Model {$this->hubUrl = empty($links[0]) ? '' : (FreshRSS_http_Util::checkUrl($links[0]) ?: '');if ($loadDetails) {- // si on a utilisé l’auto-discover, notre url va avoir changé+ // If auto-discovery was used, the URL has changed$subscribe_url = $simplePie->subscribe_url(false) ?? '';if ($this->name(true) === '') {diff --git a/app/Models/View.php b/app/Models/View.phpindex 630a8c2ff..700ae61cf 100644--- a/app/Models/View.php+++ b/app/Models/View.php@@ -121,7 +121,7 @@ class FreshRSS_View extends Minz_View {// Logspublic int $currentPage;public Minz_Paginator $logsPaginator;- public int $nbPage;+ public int $pageCount;public string $logSearch = '';// RSS viewdiff --git a/app/install.php b/app/install.phpindex 1a104a4b5..ee9b28efb 100644--- a/app/install.php+++ b/app/install.php@@ -23,14 +23,14 @@ if (isset($_GET['step']) && is_numeric($_GET['step'])) {}if (STEP === 2 && isset($_POST['type'])) {- Minz_Session::_param('bd_type', $_POST['type']);+ Minz_Session::_param('db_type', $_POST['type']);}function param(string $key, string $default = ''): string {return isset($_POST[$key]) && is_string($_POST[$key]) ? trim($_POST[$key]) : $default;}-// gestion internationalisation+// Internationalizationfunction initTranslate(): void {Minz_Translate::init();$available_languages = Minz_Translate::availableLanguages();@@ -52,7 +52,7 @@ function get_best_language(): string {}-/*** SAUVEGARDES ***/+/*** SAVE OPERATIONS ***/function saveLanguage(): bool {if (!empty($_POST)) {if (!isset($_POST['language'])) {@@ -84,13 +84,13 @@ function saveStep1(): void {'auth_type' => FreshRSS_Context::systemConf()->auth_type,'default_user' => Minz_User::name() ?? '','passwordHash' => FreshRSS_Context::userConf()->passwordHash,- 'bd_type' => FreshRSS_Context::systemConf()->db['type'] ?? '',- 'bd_host' => FreshRSS_Context::systemConf()->db['host'] ?? '',- 'bd_user' => FreshRSS_Context::systemConf()->db['user'] ?? '',- 'bd_password' => FreshRSS_Context::systemConf()->db['password'] ?? '',- 'bd_base' => FreshRSS_Context::systemConf()->db['base'] ?? '',- 'bd_prefix' => FreshRSS_Context::systemConf()->db['prefix'] ?? '',- 'bd_error' => false,+ 'db_type' => FreshRSS_Context::systemConf()->db['type'] ?? '',+ 'db_host' => FreshRSS_Context::systemConf()->db['host'] ?? '',+ 'db_user' => FreshRSS_Context::systemConf()->db['user'] ?? '',+ 'db_password' => FreshRSS_Context::systemConf()->db['password'] ?? '',+ 'db_base' => FreshRSS_Context::systemConf()->db['base'] ?? '',+ 'db_prefix' => FreshRSS_Context::systemConf()->db['prefix'] ?? '',+ 'db_error' => false,]);header('Location: index.php?step=4');@@ -99,13 +99,13 @@ function saveStep1(): void {function saveStep2(): void {if (!empty($_POST)) {- if (Minz_Session::paramString('bd_type') === 'sqlite') {+ if (Minz_Session::paramString('db_type') === 'sqlite') {Minz_Session::_params([- 'bd_base' => false,- 'bd_host' => false,- 'bd_user' => false,- 'bd_password' => false,- 'bd_prefix' => false,+ 'db_base' => false,+ 'db_host' => false,+ 'db_user' => false,+ 'db_password' => false,+ 'db_prefix' => false,]);} else {if (empty($_POST['type']) || !is_string($_POST['type']) ||@@ -114,14 +114,14 @@ function saveStep2(): void {empty($_POST['base']) || !is_string($_POST['base']) ||!is_string($_POST['pass'] ?? null) || !is_string($_POST['prefix'] ?? null)) {- Minz_Session::_param('bd_error', 'Missing parameters!');+ Minz_Session::_param('db_error', 'Missing parameters!');} else {Minz_Session::_params([- 'bd_base' => substr($_POST['base'], 0, 64),- 'bd_host' => $_POST['host'],- 'bd_user' => $_POST['user'],- 'bd_password' => $_POST['pass'],- 'bd_prefix' => substr($_POST['prefix'], 0, 16),+ 'db_base' => substr($_POST['base'], 0, 64),+ 'db_host' => $_POST['host'],+ 'db_user' => $_POST['user'],+ 'db_password' => $_POST['pass'],+ 'db_prefix' => substr($_POST['prefix'], 0, 16),]);}}@@ -133,12 +133,12 @@ function saveStep2(): void {'base_url' => $base_url,'default_user' => '_','db' => [- 'type' => Minz_Session::paramString('bd_type'),- 'host' => Minz_Session::paramString('bd_host'),- 'user' => Minz_Session::paramString('bd_user'),- 'password' => Minz_Session::paramString('bd_password'),- 'base' => Minz_Session::paramString('bd_base'),- 'prefix' => Minz_Session::paramString('bd_prefix'),+ 'type' => Minz_Session::paramString('db_type'),+ 'host' => Minz_Session::paramString('db_host'),+ 'user' => Minz_Session::paramString('db_user'),+ 'password' => Minz_Session::paramString('db_password'),+ 'base' => Minz_Session::paramString('db_base'),+ 'prefix' => Minz_Session::paramString('db_prefix'),'pdo_options' => [],],'pubsubhubbub_enabled' => Minz_Request::serverIsPublic($base_url),@@ -176,12 +176,12 @@ function saveStep2(): void {$error = initDb();Minz_User::change();if ($error != '') {- Minz_Session::_param('bd_error', $error);+ Minz_Session::_param('db_error', $error);} else {$ok = true;}} catch (Exception $ex) {- Minz_Session::_param('bd_error', $ex->getMessage());+ Minz_Session::_param('db_error', $ex->getMessage());$ok = false;}if (!$ok) {@@ -189,10 +189,10 @@ function saveStep2(): void {}if ($ok) {- Minz_Session::_param('bd_error');+ Minz_Session::_param('db_error');header('Location: index.php?step=3');- } elseif (Minz_Session::paramString('bd_error') == '') {- Minz_Session::_param('bd_error', 'Unknown error!');+ } elseif (Minz_Session::paramString('db_error') == '') {+ Minz_Session::_param('db_error', 'Unknown error!');}}invalidateHttpCache();@@ -243,7 +243,7 @@ function saveStep3(): bool {$databaseDAO = FreshRSS_Factory::createDatabaseDAO(Minz_User::INTERNAL_USER);if (!$databaseDAO->testTyping()) {$message = 'Invalid PDO driver behaviour for selected database type!';- if (Minz_Session::paramString('bd_type') === 'mysql') {+ if (Minz_Session::paramString('db_type') === 'mysql') {$message .= ' MySQL requires mysqlnd.';}throw new Exception($message);@@ -261,7 +261,7 @@ function saveStep3(): bool {]);} catch (Exception $e) {- Minz_Session::_param('bd_error', $e->getMessage());+ Minz_Session::_param('db_error', $e->getMessage());$ok = false;}if (!$ok) {@@ -276,7 +276,7 @@ function saveStep3(): bool {return true;}-/*** VÉRIFICATIONS ***/+/*** CHECKS ***/function checkStep(): void {$s0 = checkStep0();$s1 = checkRequirements();@@ -337,14 +337,14 @@ function freshrss_already_installed(): bool {function checkStep2(): array {$conf = is_writable(join_path(DATA_PATH, 'config.php'));- $bd = Minz_Session::paramString('bd_type') != '';- $conn = Minz_Session::paramString('bd_error') == '';+ $db = Minz_Session::paramString('db_type') != '';+ $conn = Minz_Session::paramString('db_error') == '';return [- 'bd' => $bd ? 'ok' : 'ko',+ 'db' => $db ? 'ok' : 'ko','conn' => $conn ? 'ok' : 'ko','conf' => $conf ? 'ok' : 'ko',- 'all' => $bd && $conn && $conf ? 'ok' : 'ko',+ 'all' => $db && $conn && $conf ? 'ok' : 'ko',];}@@ -552,7 +552,7 @@ function printStep2(): void {<p class="alert alert-success"><span class="alert-head"><?= _t('gen.short.ok') ?></span> <?= _t('install.bdd.conf.ok') ?></p><?php } elseif ($s2['conn'] == 'ko') { ?><p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('install.bdd.conf.ko'),- (empty($_SESSION['bd_error']) || !is_string($_SESSION['bd_error']) ? '' : ' ' . $_SESSION['bd_error']) ?></p>+ (empty($_SESSION['db_error']) || !is_string($_SESSION['db_error']) ? '' : ' ' . $_SESSION['db_error']) ?></p><?php } ?><h2><?= _t('install.bdd.conf') ?></h2>@@ -563,19 +563,19 @@ function printStep2(): void {<select name="type" id="type" tabindex="1"><?php if (extension_loaded('pdo_sqlite')) {?><option value="sqlite"- <?= ($_SESSION['bd_type'] ?? null) === 'sqlite' ? 'selected="selected"' : '' ?>>+ <?= ($_SESSION['db_type'] ?? null) === 'sqlite' ? 'selected="selected"' : '' ?>>SQLite</option><?php }?><?php if (extension_loaded('pdo_mysql')) {?><option value="mysql"- <?= ($_SESSION['bd_type'] ?? null) === 'mysql' ? 'selected="selected"' : '' ?>>+ <?= ($_SESSION['db_type'] ?? null) === 'mysql' ? 'selected="selected"' : '' ?>>MySQL / MariaDB</option><?php }?><?php if (extension_loaded('pdo_pgsql')) {?><option value="pgsql"- <?= ($_SESSION['bd_type'] ?? null) === 'pgsql' ? 'selected="selected"' : '' ?>>+ <?= ($_SESSION['db_type'] ?? null) === 'pgsql' ? 'selected="selected"' : '' ?>>PostgreSQL</option><?php }?>@@ -585,17 +585,17 @@ function printStep2(): void {<div id="mysql"><?php- $bd_base = is_string($_SESSION['bd_base'] ?? null) ? $_SESSION['bd_base'] : null;- $bd_host = is_string($_SESSION['bd_host'] ?? null) ? $_SESSION['bd_host'] : null;- $bd_password = is_string($_SESSION['bd_password'] ?? null) ? $_SESSION['bd_password'] : null;- $bd_prefix = is_string($_SESSION['bd_prefix'] ?? null) ? $_SESSION['bd_prefix'] : null;- $bd_user = is_string($_SESSION['bd_user'] ?? null) ? $_SESSION['bd_user'] : null;+ $db_base = is_string($_SESSION['db_base'] ?? null) ? $_SESSION['db_base'] : null;+ $db_host = is_string($_SESSION['db_host'] ?? null) ? $_SESSION['db_host'] : null;+ $db_password = is_string($_SESSION['db_password'] ?? null) ? $_SESSION['db_password'] : null;+ $db_prefix = is_string($_SESSION['db_prefix'] ?? null) ? $_SESSION['db_prefix'] : null;+ $db_user = is_string($_SESSION['db_user'] ?? null) ? $_SESSION['db_user'] : null;?><div class="form-group"><label class="group-name" for="host"><?= _t('install.bdd.host') ?></label><div class="group-controls"><input type="text" id="host" name="host" pattern="[0-9A-Z\/a-z_.\-]{1,64}(:[0-9]{2,5})?" value="<?=- $bd_host ?? $system_default_config->db['host'] ?? '' ?>" tabindex="2" />+ $db_host ?? $system_default_config->db['host'] ?? '' ?>" tabindex="2" /></div></div>@@ -603,7 +603,7 @@ function printStep2(): void {<label class="group-name" for="user"><?= _t('install.bdd.username') ?></label><div class="group-controls"><input type="text" id="user" name="user" maxlength="64" pattern="[0-9A-Za-z@_.\-]{1,64}" value="<?=- $bd_user ?? '' ?>" tabindex="3" />+ $db_user ?? '' ?>" tabindex="3" /></div></div>@@ -612,7 +612,7 @@ function printStep2(): void {<div class="group-controls"><div class="stick"><input type="password" id="pass" name="pass" value="<?=- $bd_password ?? '' ?>" tabindex="4" autocomplete="off" />+ $db_password ?? '' ?>" tabindex="4" autocomplete="off" /><a class="btn toggle-password" data-toggle="pass" tabindex="5"><?= FreshRSS_Themes::icon('key') ?></a></div></div>@@ -622,7 +622,7 @@ function printStep2(): void {<label class="group-name" for="base"><?= _t('install.bdd') ?></label><div class="group-controls"><input type="text" id="base" name="base" maxlength="64" pattern="[0-9A-Za-z_\-]{1,64}" value="<?=- $bd_base ?? '' ?>" tabindex="6" />+ $db_base ?? '' ?>" tabindex="6" /></div></div>@@ -630,7 +630,7 @@ function printStep2(): void {<label class="group-name" for="prefix"><?= _t('install.bdd.prefix') ?></label><div class="group-controls"><input type="text" id="prefix" name="prefix" maxlength="16" pattern="[0-9A-Za-z_]{1,16}" value="<?=- $bd_prefix ?? $system_default_config->db['prefix'] ?? '' ?>" tabindex="7" />+ $db_prefix ?? $system_default_config->db['prefix'] ?? '' ?>" tabindex="7" /></div></div></div>diff --git a/app/views/helpers/logs_pagination.phtml b/app/views/helpers/logs_pagination.phtmlindex 66600bea0..937d6840e 100644--- a/app/views/helpers/logs_pagination.phtml+++ b/app/views/helpers/logs_pagination.phtml@@ -5,19 +5,19 @@$a = Minz_Request::actionName();$params = array_filter($_GET, 'is_string', ARRAY_FILTER_USE_KEY);?>-<?php if ($this->nbPage > 1) { ?>+<?php if ($this->pageCount > 1) { ?><nav class="nav-pagination nav-list"><div class="pagination-wrapper"><ul class="pagination"><?php- /** @var string $getteur from Minz_Paginator::render() */- $params[$getteur] = 1;+ /** @var string $getter from Minz_Paginator::render() */+ $params[$getter] = 1;?><li class="item pager-first"><a href="<?= Minz_Url::display(['c' => $c, 'a' => $a, 'params' => $params]) ?>">« <?= _t('conf.logs.pagination.first') ?></a></li>- <?php $params[$getteur] = $this->currentPage - 1; ?>+ <?php $params[$getter] = $this->currentPage - 1; ?><li class="item pager-previous"><?php if ($this->currentPage > 1) { ?>@@ -31,8 +31,8 @@<?phpfor ($i = $this->currentPage - 2; $i <= $this->currentPage + 2; $i++) {- if ($i > 0 && $i <= $this->nbPage) {- $params[$getteur] = $i;+ if ($i > 0 && $i <= $this->pageCount) {+ $params[$getter] = $i;if ($i != $this->currentPage) {$class = '';$aria = 'false';@@ -45,19 +45,19 @@}} ?>- <?php if ($this->nbPage > $this->currentPage + 2) { ?>+ <?php if ($this->pageCount > $this->currentPage + 2) { ?><li class="item">…</a></li><?php } ?>- <?php $params[$getteur] = $this->currentPage + 1; ?>+ <?php $params[$getter] = $this->currentPage + 1; ?><li class="item pager-next">- <?php if ($this->currentPage < $this->nbPage) { ?>+ <?php if ($this->currentPage < $this->pageCount) { ?><a href="<?= Minz_Url::display(['c' => $c, 'a' => $a, 'params' => $params]) ?>"><?= _t('conf.logs.pagination.next') ?> ›</a><?php } ?></li>- <?php $params[$getteur] = $this->nbPage; ?>+ <?php $params[$getter] = $this->pageCount; ?><li class="item pager-last"><a href="<?= Minz_Url::display(['c' => $c, 'a' => $a, 'params' => $params]) ?>"><?= _t('conf.logs.pagination.last') ?> »</a></li>diff --git a/cli/db-restore.php b/cli/db-restore.phpindex dc4550b08..5bf9e3018 100755--- a/cli/db-restore.php+++ b/cli/db-restore.php@@ -26,15 +26,15 @@ $ok = false;try {$error = initDb();if ($error != '') {- $_SESSION['bd_error'] = $error;+ $_SESSION['db_error'] = $error;} else {$ok = true;}} catch (Exception $ex) {- $_SESSION['bd_error'] = $ex->getMessage();+ $_SESSION['db_error'] = $ex->getMessage();}if (!$ok) {- fail('FreshRSS database error: ' . (is_string($_SESSION['bd_error'] ?? null) ? $_SESSION['bd_error'] : 'Unknown error'));+ fail('FreshRSS database error: ' . (is_string($_SESSION['db_error'] ?? null) ? $_SESSION['db_error'] : 'Unknown error'));}foreach (FreshRSS_user_Controller::listUsers() as $username) {diff --git a/cli/do-install.php b/cli/do-install.phpindex 63ba333f5..e2ce250cf 100755--- a/cli/do-install.php+++ b/cli/do-install.php@@ -158,17 +158,17 @@ $ok = false;try {$error = initDb();if ($error != '') {- $_SESSION['bd_error'] = $error;+ $_SESSION['db_error'] = $error;} else {$ok = true;}} catch (Exception $ex) {- $_SESSION['bd_error'] = $ex->getMessage();+ $_SESSION['db_error'] = $ex->getMessage();}if (!$ok) {@unlink(join_path(DATA_PATH, 'config.php'));- fail('FreshRSS database error: ' . (is_string($_SESSION['bd_error'] ?? null) ? $_SESSION['bd_error'] : 'Unknown error'));+ fail('FreshRSS database error: ' . (is_string($_SESSION['db_error'] ?? null) ? $_SESSION['db_error'] : 'Unknown error'));}if (!is_string($config['default_user'] ?? null)) {diff --git a/lib/Minz/ActionController.php b/lib/Minz/ActionController.phpindex 9f9fa46b5..e2fd6df81 100644--- a/lib/Minz/ActionController.php+++ b/lib/Minz/ActionController.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**@@ -58,7 +58,7 @@ abstract class Minz_ActionController {}/**- * Getteur+ * Getter*/public function view(): Minz_View {return $this->view;@@ -113,9 +113,9 @@ abstract class Minz_ActionController {}/**- * Méthodes à redéfinir (ou non) par héritage- * firstAction est la première méthode exécutée par le Dispatcher- * lastAction est la dernière+ * Methods that may be overridden by subclasses+ * firstAction is the first method executed by the Dispatcher+ * lastAction is the last method executed by the Dispatcher*/public function init(): void { }public function firstAction(): void { }diff --git a/lib/Minz/Dispatcher.php b/lib/Minz/Dispatcher.phpindex 30e3a5fa8..c83780eb6 100644--- a/lib/Minz/Dispatcher.php+++ b/lib/Minz/Dispatcher.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**diff --git a/lib/Minz/Error.php b/lib/Minz/Error.phpindex 66ffbf5b4..e9f1c2ca7 100644--- a/lib/Minz/Error.php+++ b/lib/Minz/Error.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**@@ -13,13 +13,13 @@ class Minz_Error {public function __construct() {}/**- * Permet de lancer une erreur- * @param int $code le type de l'erreur, par défaut 404 (page not found)- * @param string|array<'error'|'warning'|'notice',list<string>> $logs logs d'erreurs découpés de la forme+ * Raises an error+ * @param int $code the error code, 404 by default (page not found)+ * @param string|array<'error'|'warning'|'notice',list<string>> $logs error logs grouped as follows* > $logs['error']* > $logs['warning']* > $logs['notice']- * @param bool $redirect indique s'il faut forcer la redirection (les logs ne seront pas transmis)+ * @param bool $redirect If true, uses an HTTP redirection, and if false (default), performs an internal dispatcher redirection.*/public static function error(int $code = 404, string|array $logs = [], bool $redirect = true): void {$logs = self::processLogs($logs);diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.phpindex 96db10bc6..b9839e31e 100644--- a/lib/Minz/FrontController.php+++ b/lib/Minz/FrontController.php@@ -30,8 +30,8 @@ class Minz_FrontController {protected Minz_Dispatcher $dispatcher;/**- * Constructeur- * Initialise le dispatcher, met à jour la Request+ * Constructor+ * Initializes the dispatcher and updates the request*/public function __construct() {try {@@ -56,7 +56,7 @@ class Minz_FrontController {}/**- * Démarre l'application (lance le dispatcher et renvoie la réponse)+ * Starts the application (runs the dispatcher and sends the response)*/public function run(): void {try {diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.phpindex 4b72b10af..513e4665f 100644--- a/lib/Minz/Helper.php+++ b/lib/Minz/Helper.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**diff --git a/lib/Minz/Log.php b/lib/Minz/Log.phpindex 1736e9fbe..cae4e5c9e 100644--- a/lib/Minz/Log.php+++ b/lib/Minz/Log.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**diff --git a/lib/Minz/Model.php b/lib/Minz/Model.phpindex f47a29555..5a3223479 100644--- a/lib/Minz/Model.php+++ b/lib/Minz/Model.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**diff --git a/lib/Minz/ModelArray.php b/lib/Minz/ModelArray.phpindex 18c2823bc..c0e850244 100644--- a/lib/Minz/ModelArray.php+++ b/lib/Minz/ModelArray.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**@@ -11,14 +11,14 @@ declare(strict_types=1);*/class Minz_ModelArray {/**- * $filename est le nom du fichier+ * File name*/protected string $filename;/**- * Ouvre le fichier indiqué, charge le tableau dans $array et le $filename- * @param string $filename le nom du fichier à ouvrir contenant un tableau- * Remarque : $array sera obligatoirement un tableau+ * Opens the specified file and loads the array into $array+ * @param string $filename the name of the file containing the array+ * Note: $array is always an array*/public function __construct(string $filename) {$this->filename = $filename;@@ -48,7 +48,7 @@ class Minz_ModelArray {}/**- * Sauve le tableau $array dans le fichier $filename+ * Saves $array to $filename* @param array<string,mixed> $array* @throws Minz_PermissionDeniedException*/diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.phpindex b6bbb41af..a1fceb93a 100644--- a/lib/Minz/ModelPdo.php+++ b/lib/Minz/ModelPdo.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**diff --git a/lib/Minz/Paginator.php b/lib/Minz/Paginator.phpindex ffbf0827c..237ed1ea7 100644--- a/lib/Minz/Paginator.php+++ b/lib/Minz/Paginator.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**@@ -11,47 +11,47 @@ declare(strict_types=1);*/class Minz_Paginator {/**- * @var list<Minz_Model> tableau des éléments à afficher/gérer+ * @var list<Minz_Model> array of items to display or manage*/private array $items = [];/**- * le nombre d'éléments par page+ * Number of items per page*/- private int $nbItemsPerPage = 10;+ private int $itemsPerPage = 10;/**- * page actuelle à gérer+ * Current page*/private int $currentPage = 1;/**- * le nombre de pages de pagination+ * Total number of pages*/- private int $nbPage = 1;+ private int $pageCount = 1;/**- * le nombre d'éléments+ * Number of items*/- private int $nbItems = 0;+ private int $itemCount = 0;/**- * Constructeur- * @param list<Minz_Model> $items les éléments à gérer+ * Constructor+ * @param list<Minz_Model> $items the items to manage*/public function __construct(array $items) {$this->_items($items);- $this->_nbItems(count($this->items(true)));- $this->_nbItemsPerPage($this->nbItemsPerPage);+ $this->_itemCount(count($this->items(true)));+ $this->_itemsPerPage($this->itemsPerPage);$this->_currentPage($this->currentPage);}/**- * Permet d'afficher la pagination- * @param string $view nom du fichier de vue situé dans /app/views/helpers/- * @param string $getteur variable de type $_GET[] permettant de retrouver la page+ * Renders the pagination+ * @param string $view name of the view file located in /app/views/helpers/+ * @param string $getter name of the `$_GET` parameter used for pagination*/- public function render(string $view, string $getteur = 'page'): void {+ public function render(string $view, string $getter = 'page'): void {$view = APP_PATH . '/views/helpers/' . $view;if (file_exists($view)) {@@ -60,19 +60,19 @@ class Minz_Paginator {}/**- * Permet de retrouver la page d'un élément donné- * @param Minz_Model $item l'élément à retrouver- * @return int|false la page à laquelle se trouve l’élément, false si non trouvé+ * Finds the page containing a given item+ * @param Minz_Model $item the item to find+ * @return int|false the page containing the item, false if not found*/public function pageByItem(Minz_Model $item): int|false {$i = 0;do {if ($item === $this->items[$i]) {- return (int)(ceil(($i + 1) / $this->nbItemsPerPage));+ return (int)(ceil(($i + 1) / $this->itemsPerPage));}$i++;- } while ($i < $this->nbItems());+ } while ($i < $this->itemCount());return false;}@@ -90,19 +90,19 @@ class Minz_Paginator {return $i;}$i++;- } while ($i < $this->nbItems());+ } while ($i < $this->itemCount());return false;}/**- * Permet de récupérer un item par sa position- * @param int $pos la position de l'élément- * @return Minz_Model item situé à $pos (dernier item si $pos<0, 1er si $pos>=count($items))+ * Gets the item at a given position+ * @param int $pos the position of the item+ * @return Minz_Model item at $pos (last item if $pos < 0, first if $pos >= count($items))*/public function itemByPosition(int $pos): Minz_Model {if ($pos < 0) {- $pos = $this->nbItems() - 1;+ $pos = $this->itemCount() - 1;}if ($pos >= count($this->items)) {$pos = 0;@@ -112,20 +112,20 @@ class Minz_Paginator {}/**- * GETTEURS+ * Getters*//**- * @param bool $all si à true, retourne tous les éléments sans prendre en compte la pagination+ * @param bool $all if true, returns all items without applying pagination* @return list<Minz_Model>*/public function items(bool $all = false): array {$array = [];- $nbItems = $this->nbItems();+ $itemCount = $this->itemCount();- if ($nbItems <= $this->nbItemsPerPage || $all) {+ if ($itemCount <= $this->itemsPerPage || $all) {$array = $this->items;} else {- $begin = ($this->currentPage - 1) * $this->nbItemsPerPage;+ $begin = ($this->currentPage - 1) * $this->itemsPerPage;$counter = 0;$i = 0;@@ -134,7 +134,7 @@ class Minz_Paginator {$array[] = $item;$counter++;}- if ($counter >= $this->nbItemsPerPage) {+ if ($counter >= $this->itemsPerPage) {break;}$i++;@@ -143,51 +143,51 @@ class Minz_Paginator {return $array;}- public function nbItemsPerPage(): int {- return $this->nbItemsPerPage;+ public function itemsPerPage(): int {+ return $this->itemsPerPage;}public function currentPage(): int {return $this->currentPage;}- public function nbPage(): int {- return $this->nbPage;+ public function pageCount(): int {+ return $this->pageCount;}- public function nbItems(): int {- return $this->nbItems;+ public function itemCount(): int {+ return $this->itemCount;}/**- * SETTEURS+ * Setters*//** @param list<Minz_Model> $items */public function _items(?array $items): void {$this->items = $items ?? [];- $this->_nbPage();+ $this->_pageCount();}- public function _nbItemsPerPage(int $nbItemsPerPage): void {- if ($nbItemsPerPage > $this->nbItems()) {- $nbItemsPerPage = $this->nbItems();+ public function _itemsPerPage(int $itemsPerPage): void {+ if ($itemsPerPage > $this->itemCount()) {+ $itemsPerPage = $this->itemCount();}- if ($nbItemsPerPage < 0) {- $nbItemsPerPage = 0;+ if ($itemsPerPage < 0) {+ $itemsPerPage = 0;}- $this->nbItemsPerPage = $nbItemsPerPage;- $this->_nbPage();+ $this->itemsPerPage = $itemsPerPage;+ $this->_pageCount();}public function _currentPage(int $page): void {- if ($page < 1 || ($page > $this->nbPage && $this->nbPage > 0)) {+ if ($page < 1 || ($page > $this->pageCount && $this->pageCount > 0)) {throw new Minz_CurrentPagePaginationException($page);}$this->currentPage = $page;}- private function _nbPage(): void {- if ($this->nbItemsPerPage > 0) {- $this->nbPage = (int)ceil($this->nbItems() / $this->nbItemsPerPage);+ private function _pageCount(): void {+ if ($this->itemsPerPage > 0) {+ $this->pageCount = (int)ceil($this->itemCount() / $this->itemsPerPage);}}- public function _nbItems(int $value): void {- $this->nbItems = $value;+ public function _itemCount(int $value): void {+ $this->itemCount = $value;}}diff --git a/lib/Minz/Pdo.php b/lib/Minz/Pdo.phpindex b8fe3a4c6..fe0566dae 100644--- a/lib/Minz/Pdo.php+++ b/lib/Minz/Pdo.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*/abstract class Minz_Pdo extends PDO {diff --git a/lib/Minz/PdoMysql.php b/lib/Minz/PdoMysql.phpindex b7fdd08f6..d15a9c478 100644--- a/lib/Minz/PdoMysql.php+++ b/lib/Minz/PdoMysql.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*/class Minz_PdoMysql extends Minz_Pdo {diff --git a/lib/Minz/PdoPgsql.php b/lib/Minz/PdoPgsql.phpindex 4209791c5..0ff55c59e 100644--- a/lib/Minz/PdoPgsql.php+++ b/lib/Minz/PdoPgsql.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*/class Minz_PdoPgsql extends Minz_Pdo {diff --git a/lib/Minz/PdoSqlite.php b/lib/Minz/PdoSqlite.phpindex 73c8ab3eb..3391737b8 100644--- a/lib/Minz/PdoSqlite.php+++ b/lib/Minz/PdoSqlite.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*/class Minz_PdoSqlite extends Minz_Pdo {diff --git a/lib/Minz/Request.php b/lib/Minz/Request.phpindex 71052f5f6..c671baba5 100644--- a/lib/Minz/Request.php+++ b/lib/Minz/Request.php@@ -3,11 +3,11 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**- * Request représente la requête http+ * The Minz_Request class represents the HTTP request*/class Minz_Request {@@ -23,7 +23,7 @@ class Minz_Request {private static array $originalRequest = [];/**- * Getteurs+ * Getters*/public static function controllerName(): string {return self::$controller_name;@@ -232,7 +232,7 @@ class Minz_Request {}/**- * Setteurs+ * Setters*/public static function _controllerName(string $controller_name): void {self::$controller_name = ctype_alnum($controller_name) ? $controller_name : '';@@ -256,7 +256,7 @@ class Minz_Request {}/**- * Initialise la Request+ * Initializes the request*/public static function init(): void {self::_params(array_filter($_GET, 'is_string', ARRAY_FILTER_USE_KEY));diff --git a/lib/Minz/Translate.php b/lib/Minz/Translate.phpindex c4644382a..76b8069a7 100644--- a/lib/Minz/Translate.php+++ b/lib/Minz/Translate.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**diff --git a/lib/Minz/Url.php b/lib/Minz/Url.phpindex bedb09440..5dcf70bbe 100644--- a/lib/Minz/Url.php+++ b/lib/Minz/Url.php@@ -12,7 +12,7 @@ class Minz_Url {* $url['a'] = action* $url['params'] = array of additional parameters* or as a string- * @param string $encoding how to encode & (& ou & pour html)+ * @param string $encoding how to encode & (& or & for HTML)* @param array{c?:string,a?:string,params?:array<string,mixed>} $amend Parameters to add or replace in the URL in its array form* @return string Formatted URL* @throws Minz_ConfigurationException@@ -63,15 +63,15 @@ class Minz_Url {/*** Construct the URI of a URL* @param array{c:string,a:string,params:array<string,mixed>} $url URL as array definition- * @param string $encodage pour indiquer comment encoder les & (& ou & pour html)- * @return string uri sous la forme ?key=value&key2=value2+ * @param string $encoding how to encode & (& or & for HTML)+ * @return string URI in the form ?key=value&key2=value2*/- private static function printUri(array $url, string $encodage): string {+ private static function printUri(array $url, string $encoding): string {$uri = '';$separator = '?';$anchor = '';- if ($encodage === 'html') {+ if ($encoding === 'html') {$and = '&';} else {$and = '&';@@ -79,7 +79,7 @@ class Minz_Url {if (!empty($url['params']) && is_array($url['params']) && !empty($url['params']['#'])) {if (is_string($url['params']['#'])) {- $anchor = '#' . ($encodage === 'html' ? htmlspecialchars($url['params']['#'], ENT_QUOTES, 'UTF-8') : $url['params']['#']);+ $anchor = '#' . ($encoding === 'html' ? htmlspecialchars($url['params']['#'], ENT_QUOTES, 'UTF-8') : $url['params']['#']);}unset($url['params']['#']);}@@ -162,7 +162,7 @@ class Minz_Url {'params' => $get,];- // post-traitement+ // Post-processingunset($url['params']['c']);unset($url['params']['a']);diff --git a/lib/Minz/View.php b/lib/Minz/View.phpindex 74403fdd2..3bbaa68b8 100644--- a/lib/Minz/View.php+++ b/lib/Minz/View.php@@ -3,7 +3,7 @@ declare(strict_types=1);/*** MINZ - Copyright 2011 Marien Fressinaud- * Sous licence AGPL3 <https://www.gnu.org/licenses/>+ * Licensed under AGPL3 <https://www.gnu.org/licenses/>*//**@@ -130,9 +130,9 @@ class Minz_View {* @param string $part the partial element to be added*/public function partial(string $part): void {- $fic_partial = self::LAYOUT_PATH_NAME . '/' . $part . '.phtml';- if (!$this->includeFile($fic_partial)) {- Minz_Log::warning('File not found: `' . $fic_partial . '`');+ $partial_file = self::LAYOUT_PATH_NAME . '/' . $part . '.phtml';+ if (!$this->includeFile($partial_file)) {+ Minz_Log::warning('File not found: `' . $partial_file . '`');}}@@ -141,9 +141,9 @@ class Minz_View {* @param string $helper the element to be displayed*/public function renderHelper(string $helper): void {- $fic_helper = '/views/helpers/' . $helper . '.phtml';- if (!$this->includeFile($fic_helper)) {- Minz_Log::warning('File not found: `' . $fic_helper . '`');+ $helper_file = '/views/helpers/' . $helper . '.phtml';+ if (!$this->includeFile($helper_file)) {+ Minz_Log::warning('File not found: `' . $helper_file . '`');}}diff --git a/p/scripts/install.js b/p/scripts/install.jsindex 0bd54f978..bab481538 100644--- a/p/scripts/install.js+++ b/p/scripts/install.js@@ -71,10 +71,10 @@ function mySqlShowHide() {}}}-const bd_type = document.getElementById('type');-if (bd_type) {+const db_type = document.getElementById('type');+if (db_type) {mySqlShowHide();- bd_type.addEventListener('change', mySqlShowHide);+ db_type.addEventListener('change', mySqlShowHide);}function ask_confirmation(ev) {diff --git a/p/themes/Ansum/_components.css b/p/themes/Ansum/_components.cssindex 519cb4593..1445376d9 100644--- a/p/themes/Ansum/_components.css+++ b/p/themes/Ansum/_components.css@@ -1,7 +1,7 @@/*=== COMPONENTS *//*===============*//*=== Forms */-/* parti dans _forms.css */+/* moved to _forms.css *//*=== Horizontal-list */.horizontal-list {diff --git a/p/themes/Ansum/_components.rtl.css b/p/themes/Ansum/_components.rtl.cssindex ca158794b..967a81317 100644--- a/p/themes/Ansum/_components.rtl.css+++ b/p/themes/Ansum/_components.rtl.css@@ -1,7 +1,7 @@/*=== COMPONENTS *//*===============*//*=== Forms */-/* parti dans _forms.css */+/* moved to _forms.css *//*=== Horizontal-list */.horizontal-list {diff --git a/p/themes/Ansum/metadata.json b/p/themes/Ansum/metadata.jsonindex 923bf7edb..d95cd7d16 100644--- a/p/themes/Ansum/metadata.json+++ b/p/themes/Ansum/metadata.json@@ -1,7 +1,7 @@{"name": "Ansum","author": "Thomas Guesnon",- "description": "Thème sablonneux",+ "description": "Sandy theme","version": 0.2,"files": ["_frss.css", "ansum.css"],"theme-color": "#fbf9f6"diff --git a/p/themes/Flat/metadata.json b/p/themes/Flat/metadata.jsonindex fcdc5f137..032be77b0 100644--- a/p/themes/Flat/metadata.json+++ b/p/themes/Flat/metadata.json@@ -1,7 +1,7 @@{"name": "Flat design","author": "Marien Fressinaud",- "description": "Thème plat pour FreshRSS",+ "description": "Flat theme for FreshRSS","version": 0.2,"files": ["_frss.css", "flat.css"],"theme-color": "#34495e"diff --git a/p/themes/Mapco/metadata.json b/p/themes/Mapco/metadata.jsonindex 680fd3dea..4964dadf2 100644--- a/p/themes/Mapco/metadata.json+++ b/p/themes/Mapco/metadata.json@@ -1,7 +1,7 @@{"name": "Mapco","author": "Thomas Guesnon",- "description": "Thème pour FreshRSS",+ "description": "Theme for FreshRSS","version": 0.2,"files": ["_frss.css", "mapco.css"],"theme-color": "#303136"diff --git a/p/themes/Origine/metadata.json b/p/themes/Origine/metadata.jsonindex 999279b1c..b78e84f24 100644--- a/p/themes/Origine/metadata.json+++ b/p/themes/Origine/metadata.json@@ -1,7 +1,7 @@{"name": "Origine","author": "Marien Fressinaud",- "description": "Le thème par défaut pour FreshRSS",+ "description": "The default theme for FreshRSS","version": 0.2,"files": ["_frss.css", "origine.css"],"theme-color": {"dark": "#1f1f1f", "light": "#f0f0f0"}diff --git a/p/themes/Pafat/metadata.json b/p/themes/Pafat/metadata.jsonindex 941d61d1f..673e21369 100644--- a/p/themes/Pafat/metadata.json+++ b/p/themes/Pafat/metadata.json@@ -1,7 +1,7 @@{"name": "Pafat","author": "Plopoyop",- "description": "Un thème pour FreshRSS",+ "description": "A theme for FreshRSS","version": 0.2,"files": ["_frss.css", "pafat.css"],"theme-color": "#f4f4f4"