BeRoots Posted October 3, 2016 Share Posted October 3, 2016 (edited) Bonjour à tous. J'ai un problème avec certaines traductions de mon module prestashop 1.6. J'ai dans mon module un dossier "translations" qui contient des fichier .php de traduction només en.php ; fr.php ; ... Jusqu'ici tout ce passe bien et les chaines définit dans mes contrôleurs avec la méthode $this->l('Something to translate') sont bien traduites. Le contenu du fichier en.php ressemble à ceci : <?php global $_MODULE; $_MODULE = array(); $_MODULE['<{mymodule}prestashop>mymodule_fb015b930d568ac94a74509ba027152b'] = 'Something to translate'; $_MODULE['<{mymodule}prestashop>mymodule_sdkfmlk5s564fsd88fqs5f4ehj4j8gnb'] = 'Something to translate into smarty template'; return $_MODULE; Mais mon problème est que certaine chaine demander en traduction directement depuis un fichier de template smarty du module ne sont pas traduite (Cf. deuxieme chaine ci-dessus)... Voici à quoi ressemble le fichier .tpl : <div class="panel"> <h3>{l s='Something to translate into smarty template' mod='mymodule'}</h3> </div> Si quelqu'un serai me dire pourquoi les traduction ne sont pas faite pour ces chaines dans les .tpl. PS. Je sais que je peut aussi très bien définir et traduire les chaine en contrôleur pour ensuite les assigner au template mais mon exemple, c'est du code fourni par prestashop qui doit fonctionner. Donc je voudrai comprendre le truc plutôt que de le contourner J'ai bien vu ceci du coté de smarty et c'est pour cela que je suis ici... Edited October 3, 2016 by BeRoots (see edit history) Link to comment Share on other sites More sharing options...
Arnaud_69 Posted October 3, 2016 Share Posted October 3, 2016 Bonjour, Est-ce un module que tu développes ? Tu dis "mon module". si oui, je pense que tu as peut être une différence dans la chaîne. Les exemples pour montrer sont très bien, mais les vraies chaines seraient peut plus opportunes pour débugger... Link to comment Share on other sites More sharing options...
BeRoots Posted January 5, 2017 Author Share Posted January 5, 2017 Voici les fichiers : fr.php : <?php global $_MODULE; $_MODULE = array(); $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_fb015b930d568ac94a74509ba027152b'] = 'Extra CMS Info'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_918d80539e5c14996147f9d8334cdb9f'] = 'Un module pour ajouter des colonnes d\'information CMS à la page d\'accueil.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_666f6333e43c215212b916fef3d94af0'] = 'Vous devez remplir tous les champs.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_86432715902fbaf53de469fed3fa6c53'] = 'Vous devez sélectionner au moins une boutique.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_d52eaeff31af37a4a7e0550008aff5df'] = 'Une erreur est survenue lors de la sauvegarde.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_b25cde1e74f3d27f678c2e309e06102e'] = 'Quart'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_168909c0b6f1dfbd48f679d47059c1d6'] = 'Tiers'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c48615a1bc4197056d522af276aa5a85'] = 'Moitié'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_bbd47109890259c0127154db1af26c75'] = 'Complet'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c67acd72e23a9f9c5b7d4b84e7e2c5fe'] = 'Nouveau extra bloc de CMS'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_56425383198d22fc8bb296bcca26cecf'] = 'Texte du bloc'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_2b914efda9157e5ee8b488411f71e46b'] = 'Contenu du bloc.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_cc2cf71ccca97bd4549a8d73037ade69'] = 'Selectionnez une taille de colonne pour l\'affichage de votre bloc'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_4a0b5144d65932b692463b908bd4e46f'] = 'Taille de colonne'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_9a54f6841fcf7bfc6fa85ce1a30d6dca'] = 'Selectionnez une taille de colonne conformément à une valeur de largeur (Complet, Moitié, Tiers ou Quart).'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_630f6dc397fe74e52d5189e2c80f282b'] = 'Retour à la liste'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_9d55fc80bbb875322aa67fd22fc98469'] = 'Boutiques associées'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_6fcdef6ca2bb47a0cf61cd41ccf274f4'] = 'Identifiant du bloc'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_9f82518d468b9fee614fcc92f76bb163'] = 'Boutique'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_56425383198d22fc8bb296bcca26cecf'] = 'Texte du bloc'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c0b2f21e88c17ba11b749ac3e6907756'] = 'Taille de colonne d\'un bloc'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_ef61fb324d729c341ea8ab9901e23566'] = 'Ajouter un nouveau bloc'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_3c48a1a5fb49385d9d11ce4994030227'] = 'Etes vous sûr de vouloir déinstaller le module blockextracmsinfo ?'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c7a117ba53f78cdd4790723d7c9b113e'] = 'Bienvenue dans le module blockextracmsinfo de Sebastien Deschamps !'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_0aa58d62cc39c87a5f3bc68b37527c0a'] = 'Merci pour l\'utilisation de ce module.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_8326752b60221a9d5951ee2b00afa5ae'] = 'Vous pouvez le configurer par le biais du présent formulaire.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_1ca6acf5a6791beebb84bf5044ee31a1'] = 'Ce module ajoute une nouvelle alternative responsive pour l\'affichage des informations de CMS de votre page d\'accueil. Il fournit des colonnes d\'informations sur la page d\'accueil.'; return $_MODULE; en.php : global $_MODULE; $_MODULE = array(); $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_fb015b930d568ac94a74509ba027152b'] = 'Extra CMS Info'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_918d80539e5c14996147f9d8334cdb9f'] = 'A module to add cms colunm informations to the home page.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_666f6333e43c215212b916fef3d94af0'] = 'You must fill in all fields.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_86432715902fbaf53de469fed3fa6c53'] = 'You have to select at least one shop.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_d52eaeff31af37a4a7e0550008aff5df'] = 'An error occurred while attempting to save.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_b25cde1e74f3d27f678c2e309e06102e'] = 'Quarter'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_168909c0b6f1dfbd48f679d47059c1d6'] = 'Third'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c48615a1bc4197056d522af276aa5a85'] = 'Half'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_bbd47109890259c0127154db1af26c75'] = 'Full'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c67acd72e23a9f9c5b7d4b84e7e2c5fe'] = 'New extra CMS block'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_56425383198d22fc8bb296bcca26cecf'] = 'Block text'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_2b914efda9157e5ee8b488411f71e46b'] = 'Block content.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_cc2cf71ccca97bd4549a8d73037ade69'] = 'Select a column size to display your block'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_4a0b5144d65932b692463b908bd4e46f'] = 'Column size'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_9a54f6841fcf7bfc6fa85ce1a30d6dca'] = 'Select a column size according to Full, half, third or quarter width.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_630f6dc397fe74e52d5189e2c80f282b'] = 'Back to list'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_9d55fc80bbb875322aa67fd22fc98469'] = 'Shop association'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_6fcdef6ca2bb47a0cf61cd41ccf274f4'] = 'Block ID'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_9f82518d468b9fee614fcc92f76bb163'] = 'Shop'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_56425383198d22fc8bb296bcca26cecf'] = 'Block text'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c0b2f21e88c17ba11b749ac3e6907756'] = 'Block column size'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_ef61fb324d729c341ea8ab9901e23566'] = 'Add new'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_3c48a1a5fb49385d9d11ce4994030227'] = 'Are you sure you want to uninstall the blockextracmsinfo module ?'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_c7a117ba53f78cdd4790723d7c9b113e'] = 'Welcome on Sebastien Deschamps blockextracmsinfo module !'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_0aa58d62cc39c87a5f3bc68b37527c0a'] = 'Thanks to use this module.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_8326752b60221a9d5951ee2b00afa5ae'] = 'You can configure it using the following configuration form.'; $_MODULE['<{blockextracmsinfo}prestashop>blockextracmsinfo_1ca6acf5a6791beebb84bf5044ee31a1'] = 'This module provide a new responsive way to display home page CMS informations. It also provide optionnal informations blocks for the home page.'; return $_MODULE; configure.tpl (ici les chaine qui restent non traduite alors que les autres chaines le sont) : {** * 2016-2099 Sebastien Deschamps * * NOTICE OF LICENSE * * This source file is subject to a Copyright * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.deschamps-sebastien.com/licenses/copyright.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author Sebastien Deschamps <[email protected]> * @copyright 2016-2099 Sebastien Deschamps * @license http://docs.deschamps-sebastien.com/licenses/prestashop/copyright.php Copyright Sebastien Deschamps * Property of Sebastien Deschamps * * Created on : 30 septembre 2016, 09:29:20 * Prestashop module: blockextracmsinfo *} <div class="panel"> <h3><i class="icon icon-info-sign"></i> {l s='Extra CMS Info' mod='blockextracmsinfo'}</h3> <p> <strong>{l s='Welcome on Sebastien Deschamps blockextracmsinfo module !' mod='blockextracmsinfo'}</strong><br /> {l s='Thanks to use this module.' mod='blockextracmsinfo'}<br /> {l s='You can configure it using the following configuration form.' mod='blockextracmsinfo'} </p> <br /> <p> {l s='This module provide a new responsive way to display home page CMS informations. It also provide optionnal informations blocks for the home page.' mod='blockextracmsinfo'} </p> </div> j'ai revérifié les md5 et ils sont tous corrects... Si quelqu'un à une idée Link to comment Share on other sites More sharing options...
BeRoots Posted January 6, 2017 Author Share Posted January 6, 2017 PS. J'ai essayer de virer l'entrer qui était en doublon mais le resultat reste le même. Toujours aucune traduction des chaines de ce configure.tpl Je n'est aucune erreur même en mode debug... Merci d'avance pour vos ideés 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