[-] FO : #PSCFV-2150 : Translations of back office are connected width sprintf()

This commit is contained in:
lLefevre
2012-05-14 14:38:07 +00:00
parent ef31252386
commit 3ddf7259a2
78 changed files with 246 additions and 441 deletions
+11 -3
View File
@@ -340,7 +340,11 @@ class AdminProductsControllerCore extends AdminController
if (isset($_FILES['attachment_file']) && is_uploaded_file($_FILES['attachment_file']['tmp_name']))
{
if ($_FILES['attachment_file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024))
$this->errors[] = $this->l('File too large, maximum size allowed:').' '.(Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024).' '.$this->l('kB').'. '.$this->l('File size you\'re trying to upload is:').number_format(($_FILES['attachment_file']['size'] / 1024), 2, '.', '').$this->l('kB');
$this->errors[] = sprintf(
$this->l('File too large, maximum size allowed: %1$d kB. File size you\'re trying to upload is: %2$d kB.'),
(Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024),
number_format(($_FILES['attachment_file']['size'] / 1024), 2, '.', '')
);
else
{
do $uniqid = sha1(microtime());
@@ -355,7 +359,11 @@ class AdminProductsControllerCore extends AdminController
$max_upload = (int)ini_get('upload_max_filesize');
$max_post = (int)ini_get('post_max_size');
$upload_mb = min($max_upload, $max_post);
$this->errors[] = $this->l('the File').' <b>'.$_FILES['attachment_file']['name'].'</b> '.$this->l('exceeds the size allowed by the server, this limit is set to').' <b>'.$upload_mb.$this->l('MB').'</b>';
$this->errors[] = sprintf(
$this->l('The File %1$s exceeds the size allowed by the server. The limit is set to %1$d MB.'),
'<b>'.$_FILES['attachment_file']['name'].'</b> ',
'<b>'.$upload_mb.'</b>'
);
}
else
$this->errors[] = Tools::displayError('File is missing');
@@ -1781,7 +1789,7 @@ class AdminProductsControllerCore extends AdminController
{
if (!Tools::getValue('virtual_product_expiration_date'))
{
$this->errors[] = $this->l('this field').' <b>'.$this->l('expiration date attribute').'</b> '.$this->l('is required');
$this->errors[] = Tools::displayError('This field expiration date attribute is required.');
return false;
}
}