Skip to content

0.9.0 changes and readme #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Changelog

## 0.9.0 - 2020-06-19

- Upgraded Reason parser to Reason 3.6.0 (release).
- OCaml 4.08, Dune 2.
- Migrated tests to [Rely](https://reason-native.com/docs/rely/).
- Moved CI to GitHub Actions.
- macOS, Linux and Windows binaries built by CI.

## 0.8.0 - 2020-02-12

- Upgraded Reason parser to Reason 3.6.0 (8f71db0)
- Upgraded dependencies.

## 0.8.0 - 2019-02-12
## 0.7.0 - 2019-02-12

- Upgraded Reason parser to Reason 3.4.0.
- Upgraded dependencies.
Expand Down
65 changes: 44 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,30 @@ where `path` is a Reason source file or a directory containing Reason source fil

The `--allow-duplicates` option allows messages with identical `id` props if the `defaultMessage` props are identical as well.

Formatted messages may be defined in your source files in one of the following three ways:
## Output

The output (a JSON array of all extracted messages sorted by id) is written to stdout. It will look like this:

```json
[
{
"id": "message.hello",
"defaultMessage": "Hello"
},
{
"id": "message.world",
"defaultMessage": "World"
},
{
"id": "some.message.id",
"defaultMessage": "Some message"
}
]
```

## Message Definition (bs-react-intl 2.x)

Formatted messages may be defined in your source files in one of the following ways:

1. inline in `FormattedMessage`:

Expand All @@ -42,6 +65,25 @@ open ReactIntl;
<FormattedMessage id="some.message.id" defaultMessage="Some message" />
```

2. within a module with the `[@intl.messages]` attribute:

```reason
open ReactIntl;

module Msg = {
[@intl.messages];

let hello = {id: "message.hello", defaultMessage: "Hello"};
let world = {id: "message.world", defaultMessage: "World"};
};
```

## Message Definition (bs-react-intl 1.x)

Formatted messages may be defined in your source files in one of the following ways:

1. inline in `FormattedMessage` (see above)

2. using `ReactIntl.defineMessages`:

```reason
Expand Down Expand Up @@ -93,30 +135,11 @@ let messages =
};
```

The output (a JSON array of all extracted messages sorted by id) is written to stdout. It will look like this:

```json
[
{
"id": "message.hello",
"defaultMessage": "Hello"
},
{
"id": "message.world",
"defaultMessage": "World"
},
{
"id": "some.message.id",
"defaultMessage": "Some message"
}
]
```

## Building and Testing

Install [esy] as follows:

% npm install -g esy@latest
% npm install -g esy

Then you can install the project dependencies using:

Expand Down