lyra / plugin-magento

An open source plugin that links Magento based e-commerce websites to PayZen secure payment gateway developed by Lyra Network.
https://lyra.com/fr/guides/magento/
Open Software License 3.0
10 stars 12 forks source link

M1: Translations Broken & Performance Decrease #10

Closed sprankhub closed 5 years ago

sprankhub commented 5 years ago

Yesterday we updated from Lyra_Payzen 1.7.1 to 1.9.2. We now encountered wrong translations and a decreased performance. The issues comes from Lyra_Payzen_Model_Field_Translatable::afterLoad:

  1. Broken translations: No matter if in frontend or in backend, you reset the area of the translator to adminhtml: https://github.com/payzen/plugin-magento/blob/7a43b84e2482ec88b7b3950faf9638fde7b720f1/app/code/community/Lyra/Payzen/Model/Field/Translatable.php#L43 This leads to the fact that certain strings are not translated into the correct locale in the frontend.
  2. Performance Decrease: When Mage::getStoreConfig is called, your afterLoad method is called for every config value where Lyra_Payzen_Model_Field_Translatable is defined as a backend. There, you load the translations twice. This results in loading the translations 34 times!

Please fix this issue ASAP.

nabil509 commented 5 years ago

Thank you for reporting. I agree with your explanation. As workarround, you can just comment this part of code (lines 30-44) and save the plugin configuration after updating traslatable fields (as submodue titles).

We done this code to quickly answer a marketing request about the translation of default values.

We will fix this as soon as possible.

nabil509 commented 5 years ago

Hi,

The translation of title is reverted in v1.9.3. The issue is fixed.

Thank you for reporting.