PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™
<?php
add_filter("gettext_with_context", "s2_contextual_translation", 10, 3);
function s2_contextual_translation($translation = NULL, $original = NULL, $context = NULL)
{
if($context === "s2member-front" && $original === "COUPON %s off. ( Now: %s )")
/* Here you provide the translation.
You can take the `%s` Replacement Codes out if needed. */
$translation = "You received %s off. ( You now pay: %s )";
/**/
else if($context === "s2member-front" && $original === '<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s</strong> )</div>')
$translation = '<div>You received: <strong>%s off</strong>. ( You now pay: <strong>%s</strong> )</div>';
/**/
else if($context === "s2member-front" && $original === "COUPON %s off. ( Now: %s, then %s )")
$translation = "You received %s off. ( Now pay: %s, then %s )";
/**/
else if($context === "s2member-front" && $original === '<div>Coupon: <strong>%s off</strong>. ( Now: <strong>%s, then %s</strong> )</div>')
$translation = '<div>You received: <strong>%s off</strong>. ( Now pay: <strong>%s, then %s</strong> )</div>';
/**/
return $translation;
}
?>
<?php
add_filter('ngettext_with_context', 's2_n_contextual_translation', 10, 5);
function s2_n_contextual_translation($translated = NULL, $original_single = NULL, $original_plural = NULL, $number = NULL, $context = NULL)
{
if($context === 's2member-front' && $original_single === 'for %1$s %2$s')
/* Ex: `good for 1 month`. Using `%1$s` and `%2$s`. */
$translated = 'good for %1$s %2$s';
/**/
else if($context === 's2member-front' && $original_plural === 'for %1$s %3$s')
/* Ex: `good for 2 months`. Using `%1$s` and `%3$s`. */
$translated = 'good for %1$s %3$s';
/**/
return $translated;
}
?>
Return to Common Questions/Problems/Tips
Users browsing this forum: No registered users and 1 guest