Closed
Description
If #205 lands, we could change MessageContext.format()
to accept an identifier of a message and format it directly to string. It would avoid the intermediate step of having to first getMessage
the message from the context, which is a bit clunky and is an artifact of how the bindings retrieve translated attributes.
// BEFORE
let message = ctx.getMessage("message-key");
let translation = ctx.format(msg, args);
// AFTER
let translation = ctx.format("message-key", args);
For attributes, we could introduce the following syntax:
// AFTER
let translation = ctx.format("message-key.attr-name", args);