In this blog, we will learn how to translate phrases in the override files. Sometimes we need to override the core PrestaShop classes and controllers and need to add some of our own phrases. But when we translate the module, these phrases are not available in the translation list because core files use the new translation system.
$this->errors = $this->trans( 'This voucher does not exist.', , 'Shop.Notifications.Error' );
To overcome this issue, we simply need to create the module instance and use the old translation method:
$objModule = Module::getInstanceByName('wktestmodule'); $this->errors = $objModule->l('This is custom error message.');
Prestashop Company ? Read More
If any issue or doubt in the above process, please feel free to let us know in the comment section.
I would be happy to help.
For any doubt contact us at [email protected].