The logic for this is in the formatRBString() method in the ResourceBundle plugin. Read through that to familiarize yourself and feel free to put in some dumps to debug it to see exactly what it’s doing.
It looks like if you pass a string, it will replace {1}
If you pass an array, the respective elements will replace {1}, {2}, {3}…
And if you pass a struct, the LOWERCASE struct key will be replaced. {keyname1}, {keyname2}, {keyname3}…