Using TranslatePress to generate multilingual PDF documents

Basic setup #

Required #

Document language setting #

Path: WooCommerce > PDF Invoices > General > Multilingual > Document language.
Unless the document needs to be set to a specific language, the recommendation is to set this option to “Order/customer language“. This setting focuses on using the site language that was set at the time the order was placed.

An image of the document language setting

Multilingual settings #

See Settings compatible with multilingual plugins for a full list.

Set order language manually #

Path: WooCommerce > Orders, then select an order or create a new order. Then scroll down to the ‘Custom Fields‘ section.

You will need to do so by creating the wcpdf_trp_language custom field and adding the language code as its value (like ‘en-US‘). Users will now receive their documents in this language, if the Document language setting is set to ‘Order/Customer language‘.

An image of settings

This could be done at the time of order, but it also could be done afterwards. Modifying the custom field value will just change the TranslatePress order language of the order.

Not to be confused with the trp_language custom field, which would help you remember the original language of the order. It will not set the document language however.

String Translation #

Please use Loco Translate to modify the individual strings to your liking. Strings in this context are what we think of as words that can be translated.