Documentation

Translating documents

This is a guide for advanced users.

Invoice language#

By default, the invoice language is set based on the current language in the WordPress panel. If you do not have invoice translation for other languages, the default invoice language will be English.
You can set a fixed value for the invoice language and print invoices in the selected language. Apply the action for this purpose:
add_action( 'flexible_invoices_pre_generate_pdf', 'my_flexible_invoices_pre_generate_pdf' ); function my_flexible_invoices_pre_generate_pdf( $invoice ) { global $locale; $locale = 'en_US'; unload_textdomain( 'flexible-invoices-woocommerce' ); load_plugin_textdomain( 'flexible-invoices-woocommerce', false, 'flexible-invoices-woocommerce/lang/' ); unload_textdomain( 'flexible-invoices' ); load_plugin_textdomain( 'flexible-invoices', false, 'flexible-invoices/lang/' ); unload_textdomain( 'woocommerce' ); load_plugin_textdomain( 'woocommerce', false, 'woocommerce/i18n/languages/' ); }

WPML Translations#

Flexible Invoices plugin is compatible with WPML plugin and 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 hot 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:

  • VAT number field in the checkout form
  • Order items
  • Shipping method
  • Payment method
  • E-mails with an 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:
Flexible Invoices Wpml String Translations
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:
Flexible Invoices Woocommerce Wordpress Wpml String Translation
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 which 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.

Not the solution you are looking for?

Please check other articles or open a support ticket.

Cookies preferences

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

Necessary

Necessary
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.