How to preserve placeholders?

Many messages contain special PHP formatting placeholders, which allow the insertion of side strings that are either untranslatable dynamic content (e.g. a number), or complementary translated information (e.g. the label of a web link). The PHP placeholders come in two different formats:

%s
When only one placeholder is present, this marker is used.
%1$s, %2$s, %3$s, …
Numbered placeholders, which allow translations to rearrange the order of the placeholders in the string while maintaining the information each is replaced with.


The important thing is that you have to preserve placeholders in translated strings. And it may be quite complicated to figure out what kind of information can appear behind a simple %s or similar.