oblik Posted November 3, 2014 Share Posted November 3, 2014 (edited) Hello, I can't translate strings from an included tpl. My TPL : {if isset($productscoupdecoeur) && $productscoupdecoeur} <div id="exemple-accueil-coupdecoeur"> <h3 class="page-product-heading">- {l s='The' mod='testaccueil'} <span>{l s='favorites' mod='testaccueil'}</span> {l s='of users' mod='testaccueil'}... -</h3> {include file="$self/listcoupdecoeur.tpl"} </div> {/if} Translations are ok in this file. But in "listcoupdecoeur.tpl", the strings are not translated, i don't see them in the back office. <span>{l s='Quick view' mod="testaccueil"}</span> Can you help me ? Thanks Edited November 3, 2014 by oblik (see edit history) Link to comment Share on other sites More sharing options...
cristic Posted November 3, 2014 Share Posted November 3, 2014 This is because you are using double quotes (") for mod parameter. Try with this: {l s='Quick view' mod='testaccueil'} Link to comment Share on other sites More sharing options...
vekia Posted November 3, 2014 Share Posted November 3, 2014 hmm i don't see there double quotes? :| Link to comment Share on other sites More sharing options...
cristic Posted November 5, 2014 Share Posted November 5, 2014 (edited) hmm i don't see there double quotes? :| In AdminTranslationsController - the check is done in the following way: $regex = '/\{l\s*s=([\'\"])'._PS_TRANS_PATTERN_.'\1.*\s+mod=\''.$module_name.'\'.*\}/U'; So only single quotes are considered for mod part. Edited November 5, 2014 by cristic (see edit history) Link to comment Share on other sites More sharing options...
fede_balderas Posted July 24, 2015 Share Posted July 24, 2015 (edited) I got this {l s='Benefits' mod='openpayprestashop'} and i can't see this and other fields to translate, i check smarty cache, etc. and nothing works. Any idea? Edited July 24, 2015 by fede_balderas (see edit history) Link to comment Share on other sites More sharing options...
vcopleutre Posted April 26, 2019 Share Posted April 26, 2019 Hi, Digging an old subject but since there are no answers on the web, it could be useful : To translate a template that you fetch, you have to add the translation in the language translation file. Exemple for this case : $_MODULE['<{testaccueil}prestashop>listcoupdecoeur_c91e4ee170226d66e90f99ba917e4c20'] = 'Vue rapide'; Cheers Link to comment Share on other sites More sharing options...
MrEduar Posted October 21, 2021 Share Posted October 21, 2021 On 4/26/2019 at 10:22 AM, vcopleutre said: Hi, Digging an old subject but since there are no answers on the web, it could be useful : To translate a template that you fetch, you have to add the translation in the language translation file. Exemple for this case : $_MODULE['<{testaccueil}prestashop>listcoupdecoeur_c91e4ee170226d66e90f99ba917e4c20'] = 'Vue rapide'; Cheers Is there any way to update this file without modifying it manually? If I have to modify it manually, how am I supposed to know what to write in c91e4ee170226d66e90f99ba917e4c20? Link to comment Share on other sites More sharing options...
vcopleutre Posted April 5, 2022 Share Posted April 5, 2022 (edited) Getting back on my own post, proof that lacking of documentation is sometimes hard. So for people still on 1.6 and @MrEduar For common translations : (no module or admin) $_LANG['name_of_your_tpl_file_MD5_of_the_translation_needed'] = 'Your translation'; with : for example name_of_your_tpl_file : the name of your tpl without the .tpl MD5_of_the_translation_needed : https://www.md5hashgenerator.com/ Which is gonna give you : (example for string 'Text #' and tpl : shopping-cart.ajax.main.tpl) $_LANG['shopping-cart.ajax.main_2fb3b950fd7711136f7f251ae5fbdbdc'] = 'Texte n°'; Do not forget the underscore between the name of the tpl and the MD5 hash. Note : the file to update can be the main translation file or the one in your theme folder (ie : themes/theme_name/lang/fr.php) (change the iso code) Edited April 5, 2022 by vcopleutre (see edit history) 1 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