Jontee Posted March 26, 2023 Share Posted March 26, 2023 Hi! I have upgraded to Prestashop 8.0.2 and just realized that when I generate a PDF Invoice or Delivery Slip, their translations are always in English, even tough my shop only has one language (Swedish) and then of course the Super Admin also only has Swedish set as profile language. The PDF strings are translated in the back officel, as can be seen in "International > Translations > Front Office > Core (No theme choosen) > Swedish. I have tried creating a new admin profile, reset the cache through BO, cleared the cache in FTP, installed a second language and switched to in admin profile, etc., nothing helps, the Invoice and Delivery Slip PDF are ALWAYS generated in English. What could be causing this? Many thanks in advance. Best regards, Jonte Link to comment Share on other sites More sharing options...
Knowband Plugins Posted March 27, 2023 Share Posted March 27, 2023 Kindly try by commenting the below code in file : OrderInvoicePdfGenerator.php, path : \src\Adapter\PDF\OrderInvoicePdfGenerator.php Hook::exec('actionPDFInvoiceRender', ['order_invoice_list' => $order_invoice_list]); Function : generatePDF() If the above solution doesnt work and you are using only 1 language at your store, then you can directly make changes in the following path : PDF.php Path : classes\pdf\PDF.php Function : render() Replace below code $this->pdf_renderer->setFontForLang(Context::getContext()->language->iso_code); with $this->pdf_renderer->setFontForLang([ISO_CODE_OF_YOUR_LANGUAGE]); Link to comment Share on other sites More sharing options...
Jontee Posted March 27, 2023 Author Share Posted March 27, 2023 Hi, Many thanks for your reply. I have tried both of your suggestions. The first one didn't work unfortunately, and the second one resulted in error 500 when trying to generate a invoice in backend. I don't understand what is causing this, I am only using one language, Swedish, and all of those language strings has been translated for years. Best regards, Jonte Link to comment Share on other sites More sharing options...
Jontee Posted March 28, 2023 Author Share Posted March 28, 2023 This problem arose with Prestashop 8.0.2. Does anybody have a clue what is going on? Best regards, Link to comment Share on other sites More sharing options...
Knowband Plugins Posted March 29, 2023 Share Posted March 29, 2023 Kindly share the ISO code which you have used. Link to comment Share on other sites More sharing options...
Jontee Posted March 29, 2023 Author Share Posted March 29, 2023 Hi, I have tried with: $this->pdf_renderer->setFontForLang(EN); $this->pdf_renderer->setFontForLang([EN]); $this->pdf_renderer->setFontForLang(SV); $this->pdf_renderer->setFontForLang([SV]); $this->pdf_renderer->setFontForLang(SE); $this->pdf_renderer->setFontForLang([SE]); ...just to be sure. Neither works unfortunately, resulting in error 500. I am thinking, even if it would work, what could be the initial cause of the problem? I have also tried clicking "reset" of all the language string in "ShopPDF" translations in backend, and they reset but the PDF is still generated in English for the different sections. Best regards and thanks in advance, Link to comment Share on other sites More sharing options...
Jontee Posted March 29, 2023 Author Share Posted March 29, 2023 I have the exact same problem as can be seen on this Github: https://github.com/PrestaShop/PrestaShop/issues/31863 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