From your example, is there only a single variable per message string or it could be many variables?
If there's only single variable, instead of role out your old string interpolation, you could use sprinf
for this. This is more flexible in my opinion since it allows you to do many formatting types e.g. int, decimal etc
$foo = [
'someProp' => 'Some value here: %s.'
];
$myString = sprintf($myString, $value);