How to override any translation in GravityView
We offer filters so that developers can customize much of what GravityView displays. But GravityView doesn't include filters for everything.
If you want to translate a string that isn't modifiable with a filter, you can override the text using WordPress's built-in translation engine.
/**
* Modify text for GravityView
*/
add_filter( 'gettext', function( $translation = '', $text = '', $domain = '' ) {
if( 'gk-gravityview' !== $domain ) {
return $translation;
}
// You can add or remove switch statements below:
switch( $text ) {
case 'Delete':
$translation = 'Remove'; // Update here
break;
// Text when a note is approved
case 'Approved the Entry for GravityView':
$translation = 'Entry approved!'; // UPDATE HERE
break;
}
return $translation;
}, 10, 3 );