stardy Posted March 16, 2018 Share Posted March 16, 2018 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. Link to comment Share on other sites More sharing options...
stardy Posted March 21, 2018 Author Share Posted March 21, 2018 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. ++ Link to comment Share on other sites More sharing options...
Benzakem Posted February 18, 2019 Share Posted February 18, 2019 (edited) 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 February 18, 2019 by Benzakem (see edit history) Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted May 21, 2020 Share Posted May 21, 2020 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now