Jump to content

English translation in overriding of template with module


Stainton

Recommended Posts

I need to override a class and a template. To achieve this, I choose to create a new module in order to not be blocked when Prestashop will update. For overriding class, I don't have problem.

 

The worry is in overriding template, fields are in English whereas in the rest of my website, they are in French (when I uninstall the module, they come back in French).

 

In my module, I override the template with this way :

public function hookDisplayOverrideTemplate($params)
{
$controllerName = get_class($params['controller']);
$tpl = $this->local_path . 'override/tpl/' . $controllerName . '.tpl';
if (file_exists($tpl))
{
return $tpl;
}
return false;
}

In my .tpl file, the fields which are not translate are like this :

{l s='Your addresses'}

So, I tried to insert the fr.php file in /my_module/translations/fr.php, and I edited it :

<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{customaddresses}prestashop>customaddresses_3908e1afa0ff22fbf112aff3c5ba55c1'] = 'Vos adresses';

Then, I modified the .tpl file :

{l s='Your addresses' mod='customaddresses'}

My fields are still in English. Someone has a solution to suggest ?

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...