Its basically expressions in one of the three forms:
%{expression?Text if true:Text if false} - Replace with "Text if true" when expression is set, otherwise replace with "Text if false". Both the true and the false variants can be omitted, e.g. %{expression?Text if true} will result in "Text if true" when expression is set, otherwise nothing. Another variant is %{expression?:Text if false} which will result in either the expression value when set or the text "Text if false".
%{expression#Loop text} - Repeat "Loop text" for each value in expression
%{expression} - Replace with the value of expression
There's also two special variables:
%{item} refers to the current list item being looped
%{next} a variable which is set to true for any list item except the first, this is mainly used to place list separators conditionally
For example the expression %{protocol#%{next?, }%{item}} with protocol = ["TCP", "UDP", "ICMP"] will result in "TCP, UDP, ICMP"
Broken into pieces and reformatted for clarity, the above block becomes the following text. The translatable parts are underlined.
For a real world example it might help to look at the russian translation which makes distinguishing the formatting code from the texts easy due to the use of the Cyrillic alphabet.