NB: I know one suboptimal solution to this problem, which I give at the end. I'm looking for a better one. Also, I was not able to solve this problem with the solutions give in Backquote in string template?.
For example, this assignment is no problem:
example::message = "foo`bar is set to `1`"; (* no problem *)
But if one uses this message in a Message
expression, then two messages appear, and the second one is malformed:
foo`bar = 3;
Message[example::message, foo`bar]
StringForm::sfq: Unmatched backquote in foo`bar is set to `1`. >> example::message: foo`bar is set to `1`
One solution is to make a slot for the backquote, and include "`"
among the message parameters:
example::message = "foo`1`bar is set to `2`";
Message[example::message, "`", foo`bar]
example::message: foo`bar is set to 3
This solution, however, is suboptimal, because it requires users to remember to include the otherwise meaningless "`" among the message parameters.