Unverified Commit de795bd4 authored by Benjamin Rousselière's avatar Benjamin Rousselière Committed by Jerome Boucher
Browse files

feat/14478 : add translations

parent 314dc927
......@@ -112,7 +112,7 @@ class ArchiveTransfer extends abstractMessage
{
foreach ($params as $name => $param) {
if (!isset($confParams[$name])) {
$this->sendError("404", "The sent parameters don't match the configuration parameters");
$this->sendError("404", 'The parameter %1$s is unknown in the configuration', [$name]);
break;
}
$confParam = $confParams[$name];
......@@ -126,31 +126,43 @@ class ArchiveTransfer extends abstractMessage
}
if (isset($confParam["required"]) && $confParam["required"] && $param == '') {
$this->sendError("404", "The parameter $name is required");
$this->sendError("404", 'The parameter %1$s is required', [$name]);
continue;
}
if ($param == '') {
continue;
}
switch ($confParam["type"]) {
case 'number':
if (!is_numeric($param)) {
$this->sendError("405", "The parameter $name needs to be a number");
$this->sendError("405", 'The parameter %1$s needs to be a number', [$name]);
}
break;
case 'boolean':
if ($param !== true && $param !== false) {
$this->sendError("405", "The parameter $name needs to be a boolean");
$this->sendError("405", 'The parameter %1$s needs to be a boolean', [$name]);
}
break;
case 'enum':
if (!in_array($param, $confParam["enumNames"])) {
$this->sendError("405", "The parameter $name is not in the given list");
$this->sendError("405", 'The parameter %1$s is not in the given list', [$name]);
}
break;
case 'organization':
$this->orgController->getOrgByRegNumber($param);
try {
$this->orgController->getOrgByRegNumber($param);
} catch (\Exception $e) {
$this->sendError("404", 'Organization identified by %1$s was not found', [$param]);
}
break;
case 'archivalProfile':
$this->archivalProfileController->getByReference($param);
try {
$this->archivalProfileController->getByReference($param);
} catch (\Exception $e) {
$this->sendError("404", 'Archival profile identified by %1$s was not found', [$param]);
}
break;
}
}
......
......@@ -569,17 +569,26 @@ msgstr "Le nom du zip et de ses fichiers ne correspondent pas"
msgid "The sent parameters don't match the configuration parameters"
msgstr "Les paramètres envoyés ne correspondent pas avec les paramètres de la configuration"
msgid "The parameter"
msgstr "Le paramètre"
msgid "The parameter %1$s needs to be a number"
msgstr "Le paramètre %1$s doit être un nombre"
msgid "needs to be a number"
msgstr "doit être un nombre"
msgid "The parameter %1$s needs to be a boolean"
msgstr "Le paramètre %1$s doit être un booléen"
msgid "needs to be a boolean"
msgstr "doit être un booléen"
msgid "The parameter %1$s is not in the given list"
msgstr "Le paramètre %1$s n'est pas dans la liste donnée"
msgid "is not in the list"
msgstr "n'est pas dans la liste"
msgid "The parameter %1$s is required"
msgstr "Le paramètre %1$s est requis"
msgid "The parameter %1$s is unknown in the configuration"
msgstr "Le paramètre %1$s n'est pas indiqué dans la configuration"
msgid "Organization identified by %1$s was not found"
msgstr "L'organisation identifiée par %1$s n'a pas été trouvé"
msgid "Archival profile identified by %1$s was not found"
msgstr "Le profil d'archive identifié par %1$s n'a pas été trouvé"
msgid "Malformed XML"
msgstr "Fichier XML malformé"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment