Last active
December 5, 2022 15:02
Translate Tax Toggle for WooCommerce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't copy this opening PHP tag if you are pasting in to functions.php | |
/** | |
* Change text strings for WooCommerce Tax Toggle | |
* | |
* Translate the text used in Tax Toggle plugin. | |
* Copy the code below to your theme functions.php file. | |
* | |
* @param string $translated_text Translated text. | |
* @param string $text Text to translate. | |
* @param string $domain Text domain. Unique identifier for retrieving translated strings. | |
*/ | |
function wctax_text_strings( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Excl.': | |
$translated_text = __( 'Exkl', 'wc-tax' ); | |
break; | |
case 'From': | |
$translated_text = __( 'Von', 'wc-tax' ); | |
break; | |
case 'Incl.': | |
$translated_text = __( 'Inkl', 'wc-tax' ); | |
break; | |
} | |
return $translated_text; | |
} | |
add_filter( 'gettext', 'wctax_text_strings', 20, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please also see https://desk.thetwopercent.co.uk/knowledgebase.php?article=5