Some questions about placeholders and markers in translations

"Mathias (GER, Freeciv)" <[email protected]> Sat, 9 Apr 2022 21:32:27 +0200
Newsgroups gmane.games.freeciv.internationalization
Message-ID <[email protected]>
Hi all,

today I spent a few hours translating. I found some things that I don't understand e.g. placeholders (%s or %d) and other markers (underscores, round brackets oder questions marks):

– What are these placeholders and markers for?
– How must they be used in translations?
– What rules / syntax must be observed?

Maybe someone can explain this to me or tell me where I can find answers. Here are some examples:

- - - - - 

Percentage signs
Examples:
%s
(In some cases, multiple %s are used in one "Language constant")
%d
%3d
Plague risk: %.1f%%
%1
%2 etc.

Underscores
Examples:
_Mines
U_nload All From Transporter

Round brackets
Example:
(unknown city)

Question marks and asterisks
Examples:
?redundant:*
?Merchant:M
?timeout:eta
?style:European

"Language constant" without blank spaces
Examples:
RequiresBridge
PreventsOtherRoads
CanIrrigate
CanRoad

- - - - - 

Thank you!
- -
Mathias