I'm trying to change a single string in WooCommmece - Specfically the "Coupon" string
I wanted it changed from "Rabatkuponkode" to "Rabatkode".
This works with the following four codes:
add_filter( 'gettext', 'change_coupon_text', 20, 3);
function change_coupon_text( $translated_text, $textrabat, $text_domain){
$textrabat = str_replace( "Coupon", "Rabatkode", $textrabat );
return $textrabat;
}
However, this for some reason, changes the default language from danish to english everywhere else as well.
How do i target ONLY the coupon string and not fiddle with anything else?