MKZ Industries Posted May 30 Share Posted May 30 (edited) Hi all, I have modified the /pdf/invoice.total-tab.tpl file so a new line "PayPal fee" appears in the total table. Among other code, I have used this line in a similar way to the rest of the concepts: <td class="grey" width="50%"> {l s='PayPal fee' d='Shop.Pdf' pdf='true'} </td> However, the name "PayPal fee" is no translated to other languages as, for example, the "shipping costs" is: <td class="grey" width="50%"> {l s='Shipping Costs' d='Shop.Pdf' pdf='true'} </td> How can I add a new field to the front office translations so it can be translated? It should appear under the "Shop -> pdf" translations, right? Thank you very much for your help and best regards, Edited May 30 by MKZ Industries (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted May 30 Share Posted May 30 Solution 1: Add a Dummy {l} in a PHP or TPL File Open any module or theme PHP or TPL file (for example, your custom theme's templates/_partials/footer.tpl). Add this dummy code (it won’t be displayed, but will register the string for translations): {l s='PayPal fee' d='Shop.Pdf'} This ensures that PrestaShop's translation system picks up the string during the next scan. Save and clear cache. This ensures that PrestaShop's translation system picks up the string during the next scan. Solution 2: Manually Add the Translation in the Back Office Go to International > Translations. Choose "Modify translations". Select Type of translation: PDF translations. Select your theme and language. In the list, look under Shop > pdf. If "PayPal fee" doesn't appear, use Solution 1 above and then check again after clearing cache. PrestaShop only scans core files and modules for new translation strings. Custom template strings are not automatically picked up. Use a dummy {l} line in any scanned file to make your string appear in the Back Office translations. Then, translate as normal under International > Translations > PDF translations > Shop > pdf. 1 Link to comment Share on other sites More sharing options...
MKZ Industries Posted May 30 Author Share Posted May 30 (edited) 7 hours ago, El Patron said: PrestaShop only scans core files and modules for new translation strings. Custom template strings are not automatically picked up. Use a dummy {l} line in any scanned file to make your string appear in the Back Office translations. Then, translate as normal under International > Translations > PDF translations > Shop > pdf. I thought that the file /pdf/invoice.total-tab.tpl was going to be scanned, as other terms like "Wrapping Costs" that appear in those TPL, but it doesn't look like. I have also cleared all caches and nothing. How often is that scan done? Thanks anyway! Edited May 30 by MKZ Industries (see edit history) 1 Link to comment Share on other sites More sharing options...
MKZ Industries Posted June 1 Author Share Posted June 1 Hello again, I have included the dummy line {l s='PayPal fee' d='Shop.Pdf'} in the file "My Theme/templates/_partials/footer.tpl" and now it appears in my back office under the section: "International > Translations: modify translations", selecting "Front office translations; My theme; Spanish". I translated it as "Comisión PayPal" but it seems that the translation does not apply... I have cleared both caches of PS and my browser. Any ideas why it is not working? 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