Open Quetzacoalt91 opened 9 years ago
Hello Thomas
etranslation First code review.xlsx
We were able to solve some detected problems.
Please find attached ( excel file ) the detail of the actions carried out.
You will find on the following url the updated source code of the etranslation module : https://github.com/faycaldreamit/etranslation
We also hope having more detail on the points mentioned in the Excel file.
Thank you
Module must be written in English first and then translated in your favorite language. Even if if it dedicated to only one country. Est-ce que on peut juste traduire les phrases non encore traduites comme les messages d'erreurs ? Ca nous evite de mettre en cause tout le système actuel d'internalisation
Nope, everything should be written in the code. Because of its open-source status, it will allow anybody to read and understand the code you wrote. Furthermore, if you want to make your module available in another language, you will only have to add one translation file.
Overrides are forbidden in partner modules
In the install()
function of etranslation.php:
// en 1.4, recopie de l'override
$override_file = _PS_ROOT_DIR_ . '/override/classes/CMS.php';
$source_file = _PS_ROOT_DIR_ . '/modules/etranslation/override_1.4/classes/CMS.php';
if ( Tools::substr(_PS_VERSION_, 0 , 3) == '1.4' && !file_exists($override_file) ){
if(!copy($source_file, $override_file)) {
echo "Erreur lors de la copie $source_file vers $override_file";
return false;
}
chmod($override_file, 0777);
}
You are trying to override one Core file. If you remove the folder override_1.4, you have to remove this code.
The namespace marks should be removed from this file. This file is not using a namespace and this will allow it to work on PHP 5.1 & 5.2
For this point, we can see namespace marks (antislash):
$background = new \ImagickPixel('none');
But you do not define your class in a namespace, so these antislashes can be removed.
Best regards
Hi,
Hi,
Here are some changes to do in the module:
General
etranslation.php
$$extlgid
and$extlgname
not compatible with PHP < 5.3. You should have instead:/templates/admin/server/php/files/UploadHandler.php
Module configuration