diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index d7b82512c..ba4a029be 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2146,23 +2146,28 @@ class AdminControllerCore extends Controller foreach ($rules['required'] as $field) if (($value = Tools::getValue($field)) == false && (string)$value != '0') if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), $field, $class_name).' '. - $this->l('is required'); + $this->errors[] = sprintf( + $this->l('The field %s is required.'), + call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) + ); /* Checking for multilingual required fields */ foreach ($rules['requiredLang'] as $field_lang) if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty)) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name).' '. - $this->l('is required at least in').' '.$default_language->name; + $this->errors[] = sprintf( + $this->l('The field %s is required at least in %s.'), + call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), + $default_language->name + ); /* Checking for maximum fields sizes */ foreach ($rules['size'] as $field => $max_length) if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), $field, $class_name).' '. - $this->l('is too long').' ('.$max_length.' '.$this->l('chars max').')'; + $this->errors[] = sprintf( + $this->l('The field %s is too long (%d chars max).'), + call_user_func(array($class_name, 'displayFieldName'), $field, $class_name), + $max_length + ); /* Checking for maximum multilingual fields size */ foreach ($rules['sizeLang'] as $field_lang => $max_length) @@ -2170,9 +2175,12 @@ class AdminControllerCore extends Controller { $field_lang = Tools::getValue($field_lang.'_'.$language['id_lang']); if ($field_lang !== false && Tools::strlen($field_lang) > $max_length) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name).' ('.$language['name'].') '. - $this->l('is too long').' ('.$max_length.' '.$this->l('chars max, html chars including').')'; + $this->errors[] = sprintf( + $this->l('The field %s (%s) is too long (%d chars max, html chars including).'), + call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), + $language['name'], + $max_length + ); } /* Overload this method for custom checking */ $this->_childValidation(); @@ -2181,21 +2189,24 @@ class AdminControllerCore extends Controller foreach ($rules['validate'] as $field => $function) if (($value = Tools::getValue($field)) !== false && ($field != 'passwd')) if (!Validate::$function($value) && !empty($value)) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), $field, $class_name).' '. - $this->l('is invalid'); + $this->errors[] = sprintf( + $this->l('The field %s is invalid.'), + call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) + ); /* Checking for passwd_old validity */ if (($value = Tools::getValue('passwd')) != false) { if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value)) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name).' '. - $this->l('is invalid'); + $this->errors[] = sprintf( + $this->l('The field %s is invalid.'), + call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) + ); elseif ($class_name == 'Customer' && !Validate::isPasswd($value)) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name). - ' '.$this->l('is invalid'); + $this->errors[] = sprintf( + $this->l('The field %s is invalid.'), + call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) + ); } /* Checking for multilingual fields validity */ @@ -2203,9 +2214,11 @@ class AdminControllerCore extends Controller foreach ($languages as $language) if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value)) if (!Validate::$function($value)) - $this->errors[] = $this->l('the field'). - ' '.call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name).' ('.$language['name'].') '. - $this->l('is invalid'); + $this->errors[] = sprintf( + $this->l('The field %s (%s) is invalid.'), + call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), + $language['name'] + ); } /** diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 9edc06eae..30a8d656d 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -620,10 +620,8 @@ $_LANGADM['AdminContactsd3b206d196cd6be3a2764c1fb90b200f'] = 'Supprimer la séle $_LANGADM['AdminContactse25f0ecd41211b01c83e5fec41df4fe7'] = 'Supprimer les éléments sélectionnés ?'; $_LANGADM['AdminContactsf16b5952df8d25ea30b25ff95ee8fedf'] = 'Association de la boutique :'; $_LANGADM['AdminContactsfca1f01db55feb7e6c92c4a7914ef990'] = 'Ce message sera enregistré dans l\'onglet SAV'; -$_LANGADM['AdminController01f8544c8fd4628bc686502e8b727d95'] = 'le champ'; $_LANGADM['AdminController050a0d11da7943317186f76a36b14a6c'] = 'Pas de nouvelle commande passée sur votre boutique'; $_LANGADM['AdminController07213a0161f52846ab198be103b5ab43'] = 'erreurs'; -$_LANGADM['AdminController0a5fa53f3f20f67f98bd6c3b16df059d'] = 'est requis'; $_LANGADM['AdminController0c6992101fe78e4f1ae3f391c485de29'] = 'Pack de localisation importé avec succès'; $_LANGADM['AdminController12c500ed0b7879105fb46af0f246be87'] = 'commandes'; $_LANGADM['AdminController13348442cc6a27032d2b4aa28b75a5d3'] = 'Recherche'; @@ -631,13 +629,16 @@ $_LANGADM['AdminController151648106e4bf98297882ea2ea1c4b0e'] = 'Mise à jour ré $_LANGADM['AdminController16c64b6f203dd2b0a840184ef902a704'] = 'Module greffé sur le point d\'accroche avec succès'; $_LANGADM['AdminController18bbc44b29f81d10ca41aa4a1e4347d7'] = 'Si activé, ce message de confirmation va s\'afficher (facultatif)'; $_LANGADM['AdminController1a9c46c5de112e3cb217e0ec5576d499'] = 'Derniers clients'; +$_LANGADM['AdminController1db42fe276d1e486f898061325ea2e95'] = 'Le champ %s est trop long (%d caractères maximum).'; $_LANGADM['AdminController2aa80a00e1c76b0c14ef567e0e322a0e'] = 'Module réinitialisé avec succès'; $_LANGADM['AdminController2c76ba09452e3da727ed4e65cf2f2593'] = 'Langue copiée avec succès'; $_LANGADM['AdminController2d30a5364e7af9ab4e119dc77551e317'] = 'Sélection de l\'image par défaut enregistrée'; +$_LANGADM['AdminController2deae2efe4b65df80c188a31fed3cc17'] = 'Le champ %s est requis.'; $_LANGADM['AdminController2df9f8b8654e79c091ab5f33c9e1b67b'] = 'Envoi réussi'; $_LANGADM['AdminController307fbef4087f1a9de65a595be1418670'] = 'Association d\'une image et d\'une boutique modifiée'; $_LANGADM['AdminController3879149292f9af4469cec013785d6dfd'] = 'avertissements'; $_LANGADM['AdminController399574be0ed95657dfac0e8d38374c62'] = 'par adresse IP'; +$_LANGADM['AdminController3d2496e596f4cbc8045e689d94f77cbd'] = 'Le champ %s n\'est pas valable.'; $_LANGADM['AdminController3dd9c50a1e72020b9cc83e92aa7d07b9'] = 'Temps de chargement :'; $_LANGADM['AdminController3e937d04c1c83492260a33d926ca587c'] = 'Outil de suivi des bugs'; $_LANGADM['AdminController40606a2d55f7c33c732f1d3c1b5b1e66'] = 'Module supprimé'; @@ -656,16 +657,15 @@ $_LANGADM['AdminController53cd939ae14e33855274e17a3c411fdd'] = 'Pour des raisons $_LANGADM['AdminController56deca22a707214865f7ea3ae6391d67'] = 'factures'; $_LANGADM['AdminController5bdc90e9608e48cc15f38ff360cd234a'] = 'Message affiché sur le bouton de validation (obligatoire)'; $_LANGADM['AdminController6175b106e638d4dd873cb3ff96724392'] = 'Miniatures régénérées avec succès'; +$_LANGADM['AdminController61a527877fd75dcb99981d3767639465'] = 'Le champ %s est requis au moins pour %s.'; $_LANGADM['AdminController630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste'; $_LANGADM['AdminController6357d3551190ec7e79371a8570121d3a'] = 'Il y a'; $_LANGADM['AdminController6b5ed001b03b7e1788ba881c15a08633'] = 'Module(s) installé(s) avec succès'; -$_LANGADM['AdminController70f4b635847038d056e33959821a7a66'] = 'caractères maximum'; $_LANGADM['AdminController77181afe06241c54ef771a23ee6da8f4'] = 'Derniers messages'; $_LANGADM['AdminController795aa39f13629841edad6c04d3aca405'] = 'Images déplacées avec succès'; $_LANGADM['AdminController7b83d3f08fa392b79e3f553b585971cd'] = 'avertissement'; $_LANGADM['AdminController7cfc3f369b8123e1c2d22a37b31a49a7'] = 'Module téléchargé'; $_LANGADM['AdminController7dce122004969d56ae2e0245cb754d35'] = 'Modifier'; -$_LANGADM['AdminController7e47a344b06d82a8836cbee2748a79e6'] = 'est requis au moins pour'; $_LANGADM['AdminController84b4d8c8cdd02488c0f868e97b22a3c2'] = 'Création réussie'; $_LANGADM['AdminController8524de963f07201e5c086830d370797f'] = 'Chargement en cours...'; $_LANGADM['AdminController855d2bf59043b81e76bc931e685a4f58'] = 'par nom'; @@ -674,7 +674,6 @@ $_LANGADM['AdminController87a2663d841b78f01c27c0edb4f50b76'] = 'Suppression réu $_LANGADM['AdminController87d6ef331c17f4e5d4e539e2098bf01a'] = 'Configuration multi-boutique pour'; $_LANGADM['AdminController8a3cfd894d57e33c55400fc9d76aa08a'] = 'Cliquez ici pour en savoir plus'; $_LANGADM['AdminController9469a4605b719b91e2cdac9e3bbf460d'] = 'Traductions ajoutées avec succès'; -$_LANGADM['AdminController998b344cff693ad388a14ba89b1523c7'] = 'n\'est pas valable'; $_LANGADM['AdminController9cf0de095c0d4c49d3b37ca76b50124e'] = 'Mise à jour réussie'; $_LANGADM['AdminControllera1acc250773be8550f5758190e1db93a'] = 'Mise à jour de l\'état réussie'; $_LANGADM['AdminControllera2eda4e1c4dfc9bade7150b878c57a46'] = 'Voir tous les messages'; @@ -684,12 +683,13 @@ $_LANGADM['AdminControllera92269f5f14ac147a821728c23204c0b'] = 'Cacher l\'averti $_LANGADM['AdminControllerab2f2e57bccf2066528b0c585993dcda'] = 'Pas de nouveau client inscrit sur votre boutique'; $_LANGADM['AdminControllerad0750ccecf0c31c43ce46ea7e665ea5'] = 'Voir toutes les commandes'; $_LANGADM['AdminControllerad3737feaf28ed81b4073c7113f6228e'] = 'Message envoyé au client'; +$_LANGADM['AdminControllerb3b8213b916d6a8db074f1dfbb672039'] = 'Le champ %s (%s) n\'est pas valable.'; $_LANGADM['AdminControllerb67e1893643264d0ef97fe16b1eef59d'] = 'La zone a été bien assignée à la sélection'; +$_LANGADM['AdminControllerb6a8fad0f2d6b9808ce18b7e53e6e140'] = 'Le champ %s (%s) est trop long (%d caractères max, HTML inclus).'; $_LANGADM['AdminControllerb73a47387ac1a23b17154c3b1e93fb71'] = 'Pas de nouveau message envoyé sur votre boutique'; $_LANGADM['AdminControllerb85b9d2e7e1153bd3d5a4bb0f57d347b'] = 'Duplication réussie'; $_LANGADM['AdminControllerbbaff12800505b22a853e8b7f4eb6a22'] = 'Contact'; $_LANGADM['AdminControllerbea715e8641867e000b491b04f4f9d3c'] = 'Module(s) désinstallé(s) avec succès'; -$_LANGADM['AdminControllerbee83fbebb6a50869091c78685f2b7f7'] = 'caractères max, HTML inclus'; $_LANGADM['AdminControllerc9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; $_LANGADM['AdminControllercbebc850f5f849e8956b5f8075f48f69'] = 'partout'; $_LANGADM['AdminControllercc3787ca78f445f481069a4c047f7e7a'] = 'Choisir la langue :'; @@ -704,7 +704,6 @@ $_LANGADM['AdminControllere99c06952f4336ce189d8df45980dca0'] = 'supprimer le dos $_LANGADM['AdminControllere9c7e4df74077626f7e42797c65273c4'] = 'et rester'; $_LANGADM['AdminControlleree05efe0548fdafc9e85cb4c34fbe845'] = 'Image supprimée avec succès'; $_LANGADM['AdminControlleref61fb324d729c341ea8ab9901e23566'] = 'Créer'; -$_LANGADM['AdminControllerf755e8b92cb8f02c24f6f539180d45b1'] = 'est trop long'; $_LANGADM['AdminControllerf84b4e2770ec98e3db2926cd49864d2f'] = 'Mes préférences'; $_LANGADM['AdminCountries00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; $_LANGADM['AdminCountries10d30c6319cf61386c878e4d9a3e09a2'] = 'Assigner une nouvelle zone';