RichMessage Module
Splices classified arguments into the holes of a message that comes from a resource file.
A resource accessor returns a message that is already formatted, so the holes can no longer be told
apart afterwards. Instead the message is formatted with a sentinel in place of each classified
argument, and the sentinels are then replaced with the parts they stand for. This way the resource
key stays a compile-checked member reference, and translations are free to reorder, repeat or drop
holes.
This is what the generated FSComp accessors taking classified arguments are built on. Call those
directly where they exist; these take a function instead, for the messages that have no such
overload - the ones from FSStrings:
RichMessage.text (fun rich -> RecursionE().Format name (rich ty1) (rich ty2) (rich tpcs))
Functions and values
| Function or value |
Description
|
|
Formats a message with a diagnostic number. The formatted message it is given is the unclassified text the numbered accessors return, i.e. one part, which the parts standing in for the classified arguments are spliced back into.
|
|
fantomas