Closed luciaam closed 4 years ago
ICU message format uses apostrophe to escape so you need to double
apostrophe (''
) to get the character to show up.
On Thu, Oct 3, 2019 at 2:44 AM luci notifications@github.com wrote:
Which package? intl-messageformat
Describe the bug Messages with values placed in ' ' misinterpreted.
To Reproduce Steps to reproduce the behavior:
- Define a message with a placeholder within '' i.e.: var msg = new IntlMessageFormat('My name is \'{name}\'.', 'en-US');
- Try to format it with a name var output = msg.format({name: "Eric"});
- See the output: console.log(output); // => "My name is {name}."
Expected behavior The expected output would be "My name is 'Eric'."
Desktop (please complete the following information):
- OS: Windows 10
- Browser: N/A
- Version Node.js v10.15.3
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/formatjs/formatjs/issues/210?email_source=notifications&email_token=AABQM33V5RWYJ52KGINAH7DQMWIGLA5CNFSM4I47DBO2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HPKEISQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AABQM33LOUSFOQ2EYGMGU6LQMWIGLANCNFSM4I47DBOQ .
Thanks for the hint
Which package? intl-messageformat
Describe the bug Messages with values placed in ' ' misinterpreted.
To Reproduce Steps to reproduce the behavior:
var msg = new IntlMessageFormat('My name is \'{name}\'.', 'en-US');
var output = msg.format({name: "Eric"});
console.log(output);
// => "My name is {name}."Expected behavior The expected output would be "My name is 'Eric'."
Desktop (please complete the following information):