swansong Posted October 6, 2014 Share Posted October 6, 2014 Hi, I customize my prestashop website with my own module so most of the content comes from this module. I added a language and manage to get translations using the l method. ( $this->l('my sentence') ). My problem is that I update some of my content using ajax, which is called in a external file in my module. I was wondering if it was possible to somehow use the same method on the sentences in this file. Thank you. Regards, Swansong Link to comment Share on other sites More sharing options...
vekia Posted October 6, 2014 Share Posted October 6, 2014 add each instance of $this->l('something'); code to construct function in your main module .php file Link to comment Share on other sites More sharing options...
swansong Posted October 6, 2014 Author Share Posted October 6, 2014 (edited) If i understood correctly, i should do something like this in mymodule.php class MyModule extends Module { public function __construct() { $this->name = 'myModule'; $this->tab = 'front_office_features'; $this->version = 1.0; $this->author = '...'; parent::__construct(); $this->displayName = $this->l('MyModule'); $this->description = $this->l('Module Description'); $this->l('sentence i want to translate', 'myModule'); } } and what should i do in my other file, assuming it looks somethink like this echo 'sentence i want to translate'; Thank you for your time. Swansong Edited October 6, 2014 by swansong (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts