Releases: formatjs/intl-messageformat-parser
v1.5.1
v1.5.0
v1.4.0
v1.3.0
v1.2.0 — Added Support for Escaping Backslashes
This minor release adds support for escaping backslashes (formatjs/intl-messageformat#109). The following example shows how a backslash can be included in the formatted message:
Choose either: one\\\\two\\\\three.
This will produce the following AST, note the four backslashes resolve to two:
{
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "Choose either: one\\two\\three."
}
]
}
v1.1.0 — Select Ordinal Support
This release adds support for parsing selectordinal
argument types which are the ordinal variant of plural style arguments. The following is an example of how selectordinal
arguments could be used:
The elevator is on the {floor, selectordinal,
=0 {ground}
one {#st}
two {#nd}
few {#rd}
other {#th}
} floor.
This would produce the following AST, note the ordinal
property on the pluralFormat
object:
{
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "The elevator is on the "
},
{
"type": "argumentElement",
"id": "floor",
"format": {
"type": "pluralFormat",
"ordinal": true,
"offset": 0,
"options": [
{
"type": "optionalFormatPattern",
"selector": "=0",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "ground"
}
]
}
},
{
"type": "optionalFormatPattern",
"selector": "one",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "#st"
}
]
}
},
{
"type": "optionalFormatPattern",
"selector": "two",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "#nd"
}
]
}
},
{
"type": "optionalFormatPattern",
"selector": "few",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "#rd"
}
]
}
},
{
"type": "optionalFormatPattern",
"selector": "other",
"value": {
"type": "messageFormatPattern",
"elements": [
{
"type": "messageTextElement",
"value": "#th"
}
]
}
}
]
}
},
{
"type": "messageTextElement",
"value": " floor."
}
]
}
v1.0.2 — Actually Fixed ES3 Support When Using Browserify/Webpack
This patch release actually fixes support for ES3 environments when using Browserify or Webpack to bundle intl-messageformat-parser
. The previous release had .default
s in the transpiled CommonJS modules, the es6-module-transpiler
has been updated to fix that, and this release contains those fixes.
v1.0.1 — ES3 Support When Using Browserify/Webpack
This patch release fixes support for ES3 environments when using Browserify or Webpack to bundle intl-messageformat-parser
.
Initial Public Release
This is the first public release of this package!
$ npm install intl-messageformat-parser