replace only specific message variables

This avoids errors when using `{}` in message strings.