cocof Posted January 26, 2017 Share Posted January 26, 2017 Bonsoir, J'aimerais savoir comment ajouter un "champ à traduire" dans International > Traduction sur Prestashop 1.7. J'ai un site multilingue et j'aimerais ajouter un champ "bonjour" lors de l'authentification (connexion à son compte) d'un client, qui se traduit en plusieurs langues, en fonction de la langue choisie. Si il y a une alternative, des pistes, un signe... je suis preneuse... Car il me faut juste une variable "bonjour" qui est stockée et traduite en fonction de la langue utilisée. Merci d'avance Link to comment Share on other sites More sharing options...
Eolia Posted January 26, 2017 Share Posted January 26, 2017 Bon courage ! http://build.prestashop.com/news/new-translation-system-prestashop-17/ 1 Link to comment Share on other sites More sharing options...
cocof Posted January 28, 2017 Author Share Posted January 28, 2017 Quelle rapidité^^ merci, j'ai lu la doc et essayée de faire afficher le hello, mais ça ne marche pas... public function getWidgetVariables($hookName, array $configuration) { $logged = $this->context->customer->isLogged(); $hello = $this->hello = $this->getTranslator()->trans('Hello'); if ($logged) { $customerName = $this->getTranslator()->trans( $hello. '%firstname% %lastname%', array( $hello => $this->context->customer->hello, '%firstname%' => $this->context->customer->firstname, '%lastname%' => $this->context->customer->lastname, ), 'Modules.CustomerSignIn' ); } else { $customerName = ''; } $link = $this->context->link; return array( 'logged' => $logged, 'customerName' => $customerName, 'logout_url' => $link->getPageLink('index', true, null, 'mylogout'), 'my_account_url' => $link->getPageLink('my-account', true), ); } public function renderWidget($hookName, array $configuration) { $this->smarty->assign($this->getWidgetVariables($hookName, $configuration)); return $this->fetch($this->templateFile); } } Aurais-tu une idée où se trouve l'erreur? 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