|
I haven't look into i18n-js library in details, but this is what I can spot so far: * the message format in i18n-js seems to be compatible with ICU message syntax, the industry standard used in other programming languages and the one used by formatJS as well. we will have to check if they really implemented all the specs, which makes the messages more advanced, e.g.: ```
Cart: {itemCount, plural,
=0 {no items}
one {one item}
other {# items}
}
``` including the fact that itemCount from `other` option will be formatted as a number, saying "1,030" in EN, vs "1 030" in FR. * i18n-js is a js library, which means you have to do the formatting in your js code, then passing the formatted data into the template engine where you have the placeholders for them, while FormatJS focuses more on the high-level declarative form that you can use in your templates directly, which makes things simpler, if you use handlebars, you could do: {{formatMessage "Cart" itemCount=numItems}} right in your template. |
Not sure I follow, taken from a React component: