Some shops/configurations may require custom translations, and you can override the default translations that come with WooCommerce PDF Invoices & Packing Slips by storing them in the WordPress Language folder (wp-content/languages unless overridden with the WP_LANG_DIR constant).
Simply copy the .po and .mo files from:
You can alter the translations by opening them in Poedit. You can also use the plugin Loco Translate.
If you think your translations/modifications are useful for other people, send them to us at support at wpovernight.com and we’ll include them in the offical release!
For the translations for the Premium Templates pack, use:
and for the Professional extension:
Creating a new translation
To create a create a new translation, you can install the plugin Loco Translate – this plugin has an intuitive interface and lets you add new translations with ease.
If you want full control over the translation files, you can use POEdit:
- Download POEdit at http://www.poedit.net/download.php
- Open POEdit
- File > New from POT
- Open wpo_wcpdf.pot (from woocommerce-pdf-invoices-packing-slips/languages/)
- A popup will ask you for your language
- Enter/change the translations
- Save as wpo_wcpdf-xx_XX.po, where you replace xx_XX with your language code & country code suffix (da_DK, pl_PL, de_DE etc.)
- Send them to us at support at wpovernight.com and we’ll include them in the offical release!
Important note: Make sure you have properly configured the plurals, as they are used for the filenames: Somehow the settings can’t be copied from the pot. Go to Catalogue > Preferences. Then enter
nplurals=2; plural=n != 1;
in the custom expression field. The strings ‘invoice’ and ‘packing-slip’ now have two translation fields, single & plural. Note that this is a filename, so replace spaces with a – just to be sure!