Fix tests and add translation

modifié:         core/lib/Thelia/Config/I18n/en_US.php
	modifié:         core/lib/Thelia/Config/I18n/fr_FR.php
	modifié:         core/lib/Thelia/Tests/Tools/MimeTypesToolsTest.php
	modifié:         core/lib/Thelia/Tools/MimeTypeTools.php
	modifié:         local/config/mime.types
This commit is contained in:
Benjamin Perche
2014-07-28 11:29:42 +02:00
parent 172d7c06ca
commit 5d9f120c81
5 changed files with 18 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ return array(
'All shipping methods' => 'All shipping methods',
'Alpha code 2 *' => 'Alpha code 2 *',
'Alpha code 3 *' => 'Alpha code 3 *',
'An error occurred while reading the file %file' => 'An error occurred while reading the file %file',
'Apply exchange rates on price in %sym' => 'Apply exchange rates on price in %sym',
'At least one of cart products categories is %op% <strong>%categories_list%</strong>' => 'At least one of cart products categories is %op% <strong>%categories_list%</strong>',
'Attribute ID:Attribute AV ID' => 'Attribute ID:Attribute AV ID',
@@ -112,6 +113,7 @@ return array(
'Fax' => 'Fax',
'Feature value does not match FLOAT format' => 'Feature value does not match FLOAT format',
'File is too large, please retry with a file having a size less than %size%.' => 'File is too large, please retry with a file having a size less than %size%.',
'Files with the following mime type are not allowed: %type, please do an archive of the file if you want to upload it' => 'Files with the following mime type are not allowed: %type, please do an archive of the file if you want to upload it',
'First Name' => 'First Name',
'Firstname' => 'Firstname',
'Fixed Amount Discount' => 'Fixed Amount Discount',
@@ -307,8 +309,10 @@ return array(
'The coupon applies to the selected delivery countries' => 'Ce code promo s\'applique seulement aux pays de facturation sélectionnés',
'The coupon is valid after a given date' => 'Le code promo est valide seulement à partir d\'une certaine date',
'The detailed description.' => 'The detailed description.',
'The file %file could not be opened' => 'The file %file could not be opened',
'The image which replaces an undefined country flag (%file) was not found. Please check unknown-flag-path configuration variable, and check that the image exists.' => 'The image which replaces an undefined country flag (%file) was not found. Please check unknown-flag-path configuration variable, and check that the image exists.',
'The loop name \'%name\' is already defined in %className class' => 'The loop name \'%name\' is already defined in %className class',
'There\'s a conflict between your file extension "%ext" and the mime type "%mime"' => 'There\'s a conflict between your file extension "%ext" and the mime type "%mime"',
'This brand is online' => 'This brand is online',
'This category is online.' => 'This category is online.',
'This condition is always true' => 'This condition is always true',

View File

@@ -34,6 +34,7 @@ return array(
'All shipping methods' => 'Tous les modes de livraison',
'Alpha code 2 *' => 'Code Alpha 2 *',
'Alpha code 3 *' => 'Code Alpha 3 *',
'An error occurred while reading the file %file' => 'Une erreur s\'est produite pendant la lecture du fichier %file ',
'Apply exchange rates on price in %sym' => 'Appliquer le taux de change sur le prix en %sym',
'At least one of cart products categories is %op% <strong>%categories_list%</strong>' => 'Au moins une des catégories des produits présents dans le panier %op% <strong>%categories_list%</strong> ',
'Attribute ID:Attribute AV ID' => 'Déclinaison ID : Valeur de déclinaison ID',
@@ -112,6 +113,7 @@ return array(
'Fax' => 'Fax',
'Feature value does not match FLOAT format' => 'valeur de caractéristique n\'est pas un FLOAT',
'File is too large, please retry with a file having a size less than %size%.' => 'La taille de ce fichier est trop importante. Merci d\'envoyer des fichier dont la taille est inférieure à %size%.',
'Files with the following mime type are not allowed: %type, please do an archive of the file if you want to upload it' => 'Les fichiers avec le type mieme: %type ne sont pas authorisés, veuillez en faire une archive avant de l\'envoyer',
'First Name' => 'Prénom',
'Firstname' => 'Prénom',
'Fixed Amount Discount' => 'Remise d\'un montant fixe',
@@ -307,8 +309,10 @@ return array(
'The coupon applies to the selected delivery countries' => 'Ce code promo s\'applique pour les pays de livraison sélectionnés',
'The coupon is valid after a given date' => 'Le code promo est valide à partir de cette date',
'The detailed description.' => 'La description détaillée',
'The file %file could not be opened' => 'Le fichier %file n\'a pas pu être ouvert',
'The image which replaces an undefined country flag (%file) was not found. Please check unknown-flag-path configuration variable, and check that the image exists.' => 'L\'image qui remplace un drapeau de pays manquant (%file) n\'a pas été trouvée. Merci de vérifier la variable de configuration unknown-flag-path.',
'The loop name \'%name\' is already defined in %className class' => 'La boucle \'%name\' est déjà définir dans la classe %className',
'There\'s a conflict between your file extension "%ext" and the mime type "%mime"' => 'Il y a un conflit entre l\'extension "%ext" et le type mome "%mime" ',
'This brand is online' => 'Cette marque est en ligne',
'This category is online.' => 'Cette catégorie est en ligne.',
'This condition is always true' => 'Cette condition est troujours vérifiée',

View File

@@ -112,5 +112,11 @@ class MimeTypesToolsTest extends \PHPUnit_Framework_TestCase
$this->tool->validateMimeTypeExtension(
"thismimetype/doesntexists", "foo.bar"
));
$this->assertEquals(
MimeTypeTools::TYPE_UNKNOWN,
$this->tool->validateMimeTypeExtension(
"text/x-php", "foo.php"
));
}
}

View File

@@ -75,10 +75,9 @@ class MimeTypeTools
return static::TYPE_UNKNOWN;
}
$oneMatch = true;
foreach ($extensions as $extension) {
$oneMatch &= !!preg_match("#\.$extension$#i", $fileName);
}
$extensions = implode("|", $extensions);
$oneMatch = preg_match("#\.$extensions{1}$#i", $fileName);
return (bool) $oneMatch ? static::TYPE_MATCH : static::TYPE_NOT_MATCH;
}

View File

@@ -1586,7 +1586,7 @@ video/x-msvideo avi
video/x-sgi-movie movie
video/x-smv smv
x-conference/x-cooltalk ice
text/x-php php, php3, php4, php5
text/x-php php php3 php4 php5
application/x-httpd-php phtml pht php
application/x-httpd-php-source phps
application/x-httpd-php3 php3