Skip to content

Commit 69254f9

Browse files
committed
README
1 parent 102aa42 commit 69254f9

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

README.md

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
1-
# esy-reason-project
1+
# bs-react-intl-extractor
22

3-
[![Build Status](https://travis-ci.org/esy-ocaml/esy-reason-project.svg?branch=master)](https://travis-ci.org/esy-ocaml/esy-reason-project)
3+
Extracts messages for localization from [Reason] source files.
44

5-
A project which demonstrates a Reason workflow with [Esy][].
5+
This assumes that you are using the
6+
[bs-react-intl] bindings for [react-intl] and your source files define formatted messages as follows:
67

7-
[Esy]: https://github.com/esy-ocaml/esy
8+
```re
9+
<FormattedMessage id="some.message.id" defaultMessage="Some message" />
10+
```
811

12+
The reason formatter (`refmt`) needs to be on the path.
913

1014
## Usage
1115

12-
You need Esy, you can install the beta using [npm][]:
16+
```sh
17+
bs-react-intl-extractor <directory>
18+
```
19+
20+
where `directory` is the directory containing yuor Reason source files.
21+
22+
The output (a JSON array of all extracted messages sorted by id) is written to stdout.
23+
24+
## Known Issues
25+
26+
Performance is not optimal right now as the `refmt` executable is forked for the processing of each file.
27+
28+
## How to build
29+
30+
Install [esy] as follows:
1331

1432
% npm install -g esy@latest
1533

@@ -33,8 +51,13 @@ using:
3351

3452
And test compiled executable:
3553

36-
% esy ./_build/default/bin/hello.exe
54+
% esy ./_build/default/bin/Extract.exe
3755

3856
Shell into environment:
3957

4058
% esy shell
59+
60+
[reason]: https://reasonml.github.io
61+
[bs-react-intl]: https://github.com/alexfedoseev/bs-react-intl
62+
[react-intl]: https://github.com/yahoo/react-intl
63+
[esy]: https://esy.sh

0 commit comments

Comments
 (0)