Translating the documents and issues regarding WPML support
The Flexible Invoices plugin is compatible with the WPML plugin and is ready for translations. The invoices will be issued in the language of a user session during placing an order in WooCommerce. The text below will explain how the translation works and how to introduce WPML support for Flexible Invoices in your WooCommerce store.
WPML & Flexible Invoices for WooCommerce
Invoices that you issue for WooCommerce orders will always be saved in a language in which the order was placed during the WPML session.
All of the fields visible on the invoice can be translated. Furthermore, the plugin also supports the translations of:
- The VAT number field in the checkout form
- Order items
- Shipping method
- Payment method
- E-mails with the invoice download link that are sent to the customers
- Download link in the My Account section of your site
Adding the translations
During the configuration of the plugin, you can adjust the phrases which can be edited (eg. Invoice Prefix). You can only edit them using the default site Language. For languages different than default, fields won't be editable - you should use the String Translation tool to translate them:
In order to add translations for Flexible Invoices phrases, use the String Translation tool, just like translating any other plugin. Open String Translation screen and add translated phrases:
Text domains you should be using while working with translations:
- flexible-invoices
- flexible-invoices-woocommerce
Flexible Invoices for WordPress
If you decide to issue an invoice that won't be related to WooCommerce order (using Invoices -> Add New), the invoice language will be the same as logged in user's language which generates the invoice.
Deactivate and reactivate Flexible Invoices for WordPress plugin to reload standard translation included with the plugin in .mo files (it will overwrite your current translations).
Troubleshooting
Phrase's language flag does not match its actual language
If you notice that the phrase's language flag does not match its actual language during the work on translation, it might mean that this phrase has been saved while the current phrase language was set as the site's language (eg. before activating WPML).
Phrase's language flag does not match its actual language
To solve this issue, choose one of the solutions below:
- delete the string (after deleting, it will be added again automatically)
- manually change the string's language using Change the language of selected strings button
There are string in different languages on the invoice
If there are mixed languages on the invoice, please make sure that all phrases are translated in the String Translation tool. If one of the strings does not have a translation set, it may lead to incorrect loading of other strings. Translating the remaining phrases will solve this issue.