File tree Expand file tree Collapse file tree 1 file changed +29
-6
lines changed Expand file tree Collapse file tree 1 file changed +29
-6
lines changed Original file line number Diff line number Diff line change 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
3452And test compiled executable:
3553
36- % esy ./_build/default/bin/hello .exe
54+ % esy ./_build/default/bin/Extract .exe
3755
3856Shell 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
You can’t perform that action at this time.
0 commit comments