i18n
i18n copied to clipboard
Issue escaping Single quote
Below is the plural message being used. But, when generating the ARB file, the single quote is not escaping. Similary, I also used double quotes to use the single quotes. That didn't give desired result either.
Intl.plural(
numberOfOranges,
zero: "You\'ve got zero orange.",
one: "You\'ve got $numberOfOranges orange.",
other: "You\'ve got $numberOfOranges oranges.",
name: 'getOrangesText',
args: [numberOfOranges],
)
ARB: app_en.arb
{
"@@last_modified": "2021-12-23T12:15:56.804292",
"appTitle": "Home",
"@appTitle": {
"description": "Application title/name",
"type": "text",
"placeholders": {}
},
"helloWorld": "Hello World!",
"@helloWorld": {
"description": "Hello World message",
"type": "text",
"placeholders": {}
},
"getOrangesText": "{numberOfOranges,plural, =0{You''ve got zero orange.}=1{You''ve got {numberOfOranges} orange.}other{You''ve got {numberOfOranges} oranges.}}",
"@getOrangesText": {
"type": "text",
"placeholders": {
"numberOfOranges": {}
}
}
}
I am unsure what the problem is - the quotes do look escaped to me, as ICU escapes by adding another single quote per their docs. What behavior would you expect?
Same here:
Unbalanced escape quotes. To escape a single quote ', prefix it with another single quote.