importMessageFormatfrom'@messageformat/core'constmf=newMessageFormat('en')constmsgSrc=`{GENDER, select,
male {He} female {She} other {They}
} found {RES, plural,
=0 {no results} one {1 result} other {# results}
}.`;constmsg=mf.compile(msgSrc)msg({GENDER:'male',RES:1})// 'He found 1 result.'msg({GENDER:'female',RES:1})// 'She found 1 result.'msg({GENDER:'male',RES:0})// 'He found no results.'msg({RES:2})// 'They found 2 results.'