PrestaShopCorp / etranslation

1 stars 2 forks source link

First code review #1

Open Quetzacoalt91 opened 9 years ago

Quetzacoalt91 commented 9 years ago

Hi,

Here are some changes to do in the module:

General

{l s='Text to translate' mod='etranslation'}
$explode =  explode('-',Tools::getValue('export_id_lang'));
$extlgid = $explode[0];
$extlgname = $explode[1];
faycaldreamit commented 9 years ago

Hello Thomas

etranslation First code review.xlsx etranslation first code review

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

Quetzacoalt91 commented 8 years ago

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

Quetzacoalt91 commented 8 years ago

Hi,

etranslation.php