I’m trying to translate the PDF invoices but I’m having trouble with “Tax” not being translatable. I’ve translated it for Woocommerce, and I can’t find the string in the plugin translations with Loco, and I couldn’t find it in the source code either. Default theme or disabling plugins didn’t help.
I’m trying to translate the PDF invoices but I’m having trouble with “Tax” not being translatable. I’ve translated it for Woocommerce, and I can’t find the string in the plugin translations with Loco, and I couldn’t find it in the source code either. Default theme or disabling plugins didn’t help.
The “Tax” label for the totals comes from WooCommerce directly, but if you want to customize it just in the PDF invoice, you could try the following code snippet:
/** * PDF Invoices & Packing Slips for WooCommerce: * Customize the VAT label on the PDF documents. */ add_filter( 'wpo_wcpdf_woocommerce_totals', function( $totals, $order, $document_type ) { foreach ( $totals as $total_id => $total ) { if ( $total['label'] == 'Tax') { $totals[$total_id]['label'] = __( 'VAT', 'woocommerce' ); break; } } return $totals; }, 10, 3 );
If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide:?How to use code snippets
Could you check which language you have selected in your WordPress dashboard > Settings > General?:
Please note that, although our plugin is available in German (de_DE), for?other German locales (Formal, Switzerland, Switzerland Informal, Austria), you’ll need to download the translation files from German (de_DE), and?manually install it in your site, or even better, use the German (de_DE) as fallback.?There is a great plugin to help you with this:?Language Fallback
After installing the plugin, you just need to go to?Settings > General, find the?Language Fallback Settings?and choose?Deutsch: