PDF Invoices & Packing Slips Generator for WooCommerce can print document text in the language of each order using the [translate] shortcode. It reads the order’s language from WPML, Polylang, or TranslatePress, so the same template serves every customer.
Before you start #
- A translation plugin that records the order language: WPML, Polylang, or TranslatePress. Without one,
[translate]falls back to the “other languages” text.
Two ways to write translated text #
1. Wrap each language block. Use lang to show text only for matching languages, and not_lang for everything else:
[translate lang="EN"]Thank you for your order.[/translate]
[translate lang="DE"]Vielen Dank fur Ihre Bestellung.[/translate]
[translate not_lang="EN,DE"]Merci pour votre commande.[/translate]
2. Inline attributes. Provide both the matching and non-matching text as attributes on a single tag:
[translate lang="EN,DE" lang_text="Invoice" not_lang_text="Facture"]
Language codes are matched case-insensitively, and you can list several separated by commas (for example lang="EN,DE,NL").
Note: the plugin resolves the order language from the order meta written by WPML, Polylang, or TranslatePress, falling back to the active site language when no order language is found. Codes are the short language slugs such as en, de, fr.
Use cases #
- Print invoice labels and thank-you notes in the buyer’s language.
- Show a legal disclaimer only for domestic orders and a different one abroad.
Get more control #
Translation is free and works in one document. PDF Invoicing Pro lets you localize several document types. See what Pro unlocks.