Hello,
Thanks for your message. The PDF document for the contract agreement is generated for a specific rental order ID, to which a specific language code is assigned. From the wp-admin section, it is possible to assign a custom language to every rental order, by opening its details page and by using the “Administration” tab. The available languages are taken from your WordPress settings.
Once the rental order will have the proper language code assigned (for front-end reservations the system will automatically assign to the order the currently active language of the user), the PDF document can be generated, and its contents will be translated into the proper language.
The contents of the PDF document for the contract agreement use by default some GetText translation strings (constants), and so WordPress will automatically translate them depending on PO/MO files available for that language.
Alternatively, the PDF document can contain “Conditional Texts” that were previously set up from the Configuration page of VikRentCar. Such texts can be translated by using the apposite “Global – Translations” page of our plugin, and when the PDF document is generated, any Conditional Text will be eventually translated automatically into the language assigned to the rental order.
We hope this helps!
The VikWP Team
Thread Starter
l0gin
(@l0gin)
Changing the language in the Administration tab itself does not change the translation of documents, but the “conditional texts” function solved the problem.
Can you tell me which files exactly are responsible for generating documents? I have a big problem on my server with generated graphics in documents. This especially concerns the red markers showing damage in the pdf file.
I know that I can define the logo and car_inspection.png rigidly in the template, but if I set the path to the graphics in the chceckin_pdf_tmpl.php template to /wp-content/plugins/vikrentcar/admin/resources/damage_mark.png rigidly, the mark is generated in the wrong place.
I use the nginix server and php 7.4 on Ubuntu. The entire plugin directory has permissions of 0775
I have curl and PHP-GD installed, but this does not solve the problem.
When I tested on a shared hosting, the marks are applied correctly and there is generally no problem with graphics in the pdf file.
Thanks for your message. We understand the situation, but there are probably several PHP core files responsible for the generation of the check-in document. You should try to get in touch with our technical support team through our website in case you wanted to investigate some specific issues over a few core files.
What we can tell you is that the PHP-GD libraries ship by default with PHP, but every PHP environment and version has got its own building preferences, with a default set of dependencies. It is quite probably that your PHP version 7.4 is dedicated to Ubuntu, and so we suggest comparing the GD libraries available against the ones on the shared hosting where you said the image manipulation functions work well. By using phpinfo() you can get a list of all libraries available for your PHP installation. Any missing package could be easily installed in your Ubuntu installation, but ideally, the PHP-GD native functions used by our plugin are part of the native bundle that ships with any PHP version, to mainly support PNG and JPG files.