strangerstudios / pmpro-sponsored-members

Generate a discount code for a main account holder to distribute to sponsored members.
https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
15 stars 27 forks source link

ENHANCEMENT: Consistent handling of translation strings #50

Closed greathmaster closed 3 years ago

greathmaster commented 5 years ago

In the line of code here we display the discount code directly on the page instead of using sprintf and a placeholder:

https://github.com/strangerstudios/pmpro-sponsored-members/blob/master/pmpro-sponsored-members.php#L630

$message .= "<div class=\"pmpro_content_message\"><p>" . __( "Give this code to your sponsored members to use at checkout:", "pmpro_sponsored_members" ) . " <strong>" . $code->code . "</strong></p><p>" . __( "Or provide one of these direct links to register:", "pmpro_sponsored_members" ) . "<br /></p>";

We use sprintf and placeholder and in the line here: https://github.com/strangerstudios/pmpro-sponsored-members/blob/master/pmpro-sponsored-members.php#L1986

$message = "<p>" . sprintf(__("Give this code to your sponsored members to use at checkout: %s", "pmpro_sponsored_members"), $code->code) . "<br />";

andrewlimaza commented 3 years ago

This should be fixed with latest release.