Jump to content

TRanslated terms not available in backend Translation panel


stardy
 Share

Recommended Posts

Hi, 

I need to override some controllers and add a term (in english) to translate in French.
But, the term is not available in back-office for translating.


My code in my controller override

$breadcrumb['links'][] = [
  'title' => $this->trans('Your Order history', array(), 'Shop.Theme.Customeraccount'),
  'url'   => '',
];

 

And I try in Template but no result too...
 

{l s='Your Order history' d='Shop.Theme.Customeraccount'}

 

There is something to do for refresh all terms to translate in backend panel ?

 

My configuration : 
Prestashop version : 1.7.2.0
PHP version : 7.1.12
Theme CLASSIC
Debug Mode Active

Best regards and thank you for your help.

J.
 

Share this post


Link to post
Share on other sites

I find a solution not really clean but it works !

Override the Admin Controller AdminTranslationsController.php and replace the line : 

$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $lang_file, $is_default);


by

$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $lang_file, $is_default);

// Check override
if( is_dir(_PS_ROOT_DIR_.'/override/modules/'.$module.'/') ){
	$this->recursiveGetModuleFiles(_PS_ROOT_DIR_.'/override/modules/'.$module.'/', $array_files, $module, $lang_file, $is_default);
}

// Check Template Overrides
if( is_dir(_PS_ROOT_DIR_.'/themes/classic/modules/'.$module.'/') ){
	$this->recursiveGetModuleFiles(_PS_ROOT_DIR_.'/themes/classic/modules/'.$module.'/', $array_files, $module, $lang_file, $is_default);
}

Your script will check "override" and "theme" ("classic" for me) module folders.

 

++

Share this post


Link to post
Share on other sites

  • 10 months later...

Hi Stardy,

This fix the modules translations problem, but do you know how to translate strings in a controller override (core ones, like the controllers/front/CartController.php) ? It seems that thoses files aren't translated too... (override/controllers/front/CartController.php)

Regards,

 

Ben

Edited by Benzakem (see edit history)

Share this post


Link to post
Share on other sites

  • 1 year later...
On 2/18/2019 at 3:49 PM, Benzakem said:

Hi Stardy,

This fix the modules translations problem, but do you know how to translate strings in a controller override (core ones, like the controllers/front/CartController.php) ? It seems that thoses files aren't translated too... (override/controllers/front/CartController.php)

Regards,

 

Ben

you have fix your problem ?

Thanks

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More