Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Releases: formatjs/intl-messageformat-parser

v1.5.1

Choose a tag to compare

@redonkulus redonkulus released this 01 May 17:05

v1.5.0

Choose a tag to compare

@redonkulus redonkulus released this 30 Apr 19:01

v1.4.0...v1.5.0

v1.4.0

Choose a tag to compare

@okuryu okuryu released this 23 Oct 12:40
v1.4.0

v1.3.0

Choose a tag to compare

@ericf ericf released this 27 Feb 21:46

This minor release adds location information to the AST nodes so it can be used in tools like https://astexplorer.net (@Turbo87 #16, #17)

v1.2.0 — Added Support for Escaping Backslashes

Choose a tag to compare

@ericf ericf released this 27 Oct 04:09

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

Choose a tag to compare

@ericf ericf released this 02 Mar 18:12

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

Choose a tag to compare

@ericf ericf released this 23 Jan 23:28

This patch release actually fixes support for ES3 environments when using Browserify or Webpack to bundle intl-messageformat-parser. The previous release had .defaults in the transpiled CommonJS modules, the es6-module-transpiler has been updated to fix that, and this release contains those fixes.

See: formatjs/intl-messageformat#90

v1.0.1 — ES3 Support When Using Browserify/Webpack

Choose a tag to compare

@ericf ericf released this 14 Jan 03:47

This patch release fixes support for ES3 environments when using Browserify or Webpack to bundle intl-messageformat-parser.

See: formatjs/intl-messageformat#90

Initial Public Release

Choose a tag to compare

@ericf ericf released this 02 Oct 23:05

This is the first public release of this package!

$ npm install intl-messageformat-parser