jalokin80 Posted July 8, 2015 Share Posted July 8, 2015 (edited) Hello folks. After update from 1.6.0.14 to 1.6.1.0 The PDF invoice has reset to English instead of Danish as we used in version 1.6.0.14. I can translate everything in the invoice except the invoice title where it says "Invoice". I need this to be translated to Danish so it writes "Faktura" instead. I have the same problem in delivery slip and probably other generated PDF files. Does anyone know how to translate this? I have changed all translations where it writes "Invoice" both in the english and the danish translations (module translations, field translations, back office translations and PDF translations) but still it writes "Invoice" and not "Faktura" in the invoice PDF title and "Delivery slip" in the delivery title PDF. I am unsure if it is a prestashop core issue or me, who has not found the right place of the translation. Edited July 8, 2015 by jalokin80 (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted July 8, 2015 Share Posted July 8, 2015 It is a bug. Several strings in all PDF documents are not translated and translatable. Link to comment Share on other sites More sharing options...
jalokin80 Posted July 9, 2015 Author Share Posted July 9, 2015 (edited) Okay, then I know that. Thank you for the reply. Is there anything we can do to solve the issue temporary until an official fix is released? Etc. hard code the text into the files? We only use one language anyway. Edited July 9, 2015 by jalokin80 (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted July 9, 2015 Share Posted July 9, 2015 Search for $this->l in all /classes/pdf/*.php files and replace those texts in method arguments. 1 Link to comment Share on other sites More sharing options...
jalokin80 Posted July 13, 2015 Author Share Posted July 13, 2015 Thank you, Tuk. That did the job Link to comment Share on other sites More sharing options...
makoke Posted July 22, 2015 Share Posted July 22, 2015 (edited) Yik, Can you explain how to do that? Edited July 22, 2015 by makoke (see edit history) Link to comment Share on other sites More sharing options...
makoke Posted July 23, 2015 Share Posted July 23, 2015 Search for $this->l in all /classes/pdf/*.php files and replace those texts in method arguments. how i have to do that? i don't know. thank you Link to comment Share on other sites More sharing options...
tuk66 Posted July 23, 2015 Share Posted July 23, 2015 Locally, in a text editor. Link to comment Share on other sites More sharing options...
jalokin80 Posted July 23, 2015 Author Share Posted July 23, 2015 In your prestashop installation, locate the following file. in your_prestashop_installation/classes/pdf/HTMLTemplateInvoice.php edit line 64 'header' => $this->l('INVOICE'), to 'header' => $this->l('FAKTURA'), In the example above I use the danish word for Invoice which is Faktura. Change it to whatever language you want. Use for example notepad2 to edit the php file. It can be downloaded for free and you can find it in google. You can do the same in the rest of the PDF titles (HTMLTemplateDeliverySlip.php, HTMLTemplateOrderSlip.php, etc.) Just search for $this->l and change the title to whatever translation you want. Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 24, 2015 Share Posted July 24, 2015 In your prestashop installation, locate the following file. in your_prestashop_installation/classes/pdf/HTMLTemplateInvoice.php edit line 64 'header' => $this->l('INVOICE'), to 'header' => $this->l('FAKTURA'), In the example above I use the danish word for Invoice which is Faktura. Change it to whatever language you want. Use for example notepad2 to edit the php file. It can be downloaded for free and you can find it in google. You can do the same in the rest of the PDF titles (HTMLTemplateDeliverySlip.php, HTMLTemplateOrderSlip.php, etc.) Just search for $this->l and change the title to whatever translation you want. Thank's for patch, but how can we do if we have a multilanguage shop ? :-( John Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 24, 2015 Share Posted July 24, 2015 (edited) Found a workaround, that could certainly help ;-) Add the following lines in your themes/yourtheme/pdf/header.tpl <!-- {l s='INVOICE' pdf='true'} {l s='DELIVERY' pdf='true'} {l s='DELIVERY SLIP' pdf='true'} {l s='ORDER RETURN' pdf='true'} {l s='CREDIT SLIP' pdf='true'} -->Then, just run regular translation in backoffice ( PDF, Yourtheme, language) and tranlate it. That's all folks! Edited July 29, 2015 by Prestashop Addict (see edit history) 2 Link to comment Share on other sites More sharing options...
makoke Posted July 27, 2015 Share Posted July 27, 2015 Found a workaround, that could certainly help ;-) Add the following lines in your themes/yourtheme/pdf/header.tpl <!-- {l s='INVOICE' pdf='true'} {l s='DELEVERY' pdf='true'} {l s='DELIVERY SLIP' pdf='true'} {l s='ORDER RETURN' pdf='true'} {l s='CREDIT SLIP' pdf='true'} -->Then, just run regular translation in backoffice ( PDF, Yourtheme, language) and tranlate it. That's all folks! Thank you!!! This is the solution for a multilanguage shop Link to comment Share on other sites More sharing options...
jalokin80 Posted July 29, 2015 Author Share Posted July 29, 2015 Thank you Prestashop Addict for the solution! Unfortunately I did not have the header.tpl in my themes/yourtheme/pdf/ directory so instead I added the code to: Prestashop installation directory/pdf/header.tpl It works for me and for the custom theme I use. Also you have a typo in the addition: {l s='DELEVERY' pdf='true'} I have changed that to: <!-- {l s='INVOICE' pdf='true'} {l s='DELIVERY' pdf='true'} {l s='DELIVERY SLIP' pdf='true'} {l s='ORDER RETURN' pdf='true'} {l s='CREDIT SLIP' pdf='true'} --> ... and translated the fields in BO. Now the hack works very well and also with special characters, which did not work with the previous solution Thumbs up! Link to comment Share on other sites More sharing options...
Prestashop Addict Posted July 29, 2015 Share Posted July 29, 2015 Thank you jalokin80 for my spelling mistake, I corrected my original post :-)Unfortunately your solution to modify orignal code is not the best, because on update it will be overwritten.I suggest you to create a folder in your theme /themes/yourtheme/pdf/, then copy the original /pdf/haeder.tpl to /themes/yourtheme/pdf/ and modify it.Have fun. Link to comment Share on other sites More sharing options...
RGAD Posted September 14, 2015 Share Posted September 14, 2015 @PS Addict Great ! Works perfectly. Thanks a lot. Link to comment Share on other sites More sharing options...
santorinisunglasses Posted September 27, 2017 Share Posted September 27, 2017 hello i want to quit the contry name down my logo on PDF invoice how i can do that ?? hola !! me pueden decir como le quito el pais de debajo de mi logo a la factura PDF que genera prestashop , ya que me aparece al generar el PDF el pais me imagino por defecto de la tienda justo debajo del logo de mi marca, tengo prestashop 1.6 mil gracias !! Link to comment Share on other sites More sharing options...
tuk66 Posted September 28, 2017 Share Posted September 28, 2017 It comes from your shop address and cannot be normally removed. 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