To translate our plugins or themes in WordPress, we have many handy helper functions that we can use to pass through text and then later translate it.
But what if we want to pass dynamic data inside our static translatable string? In this case, we can combine the translate functions with the PHP’s sprintf like so:
echo sprintf(__('The validator of this post is: %s.', 'pine' ), $verifier_name);
Using sprintf we can insert variables inside strings. A particular character combination (%s) must always be present (in the translations, too); this special character will be replaced with the variable’s value.