Hi there,
To really do that reliably you should be comfortable and familiar with PHP code and how to scan plugins for their hooks and filters as well as what GETTEXT is.
Nevertheless, another route that might be quite a bit easier is this snippet:
https://github.com/WordImpress/Give-Snippet-Library/blob/master/translation-snippets/change-text.php
Basically, make sure the $domain == 'give'
is there, then change the $translation
string to the one you want to change and provide the translation. Then do it again for the next string, and the next.
I’d HIGHLY recommend doing this in a local environment (not LIVE), and to add these snippets into a custom functionality plugin. Otherwise, one missing comma or apostrophe and it can break your site.
Thanks!
I appreciate that! I tried to implement via functions file but it has no effect. Not sure what I’m doing wrong- I modified to be this:
add_filter( ‘give_payment_gateways’, ‘my_custom_gateway_labels’ );
/**
* A local translation snippet. Change ‘YOUR TEXT HERE’ to your desired text.
*
* @param $translations
* @param $text
* @param $domain
*
* @return string
*/
function my_give_text_switcher( $translations, $text, $domain ) {
// changes the “Donations” text in multiple places
if ( $domain == ‘give’ && $text == ‘Donation’ ) {
return __( ‘Payment’, ‘give’ );
}
return $translations;
}
add_filter( ‘gettext’, ‘my_give_text_switcher’, 10, 3 );
Change $text == 'Donation'
to $translations == 'Donation'
Also keep in mind that the “Donation” has to be the full string of what you are translating. You cannot just change one word unless that word is is in the plugin by itself (which in the case of Donation it might be).
Thanks!
Oh, ok excellent, thank you!