|
4 | 4 | [](https://github.com/facebook/jest) |
5 | 5 | [](https://github.com/prettier/prettier) |
6 | 6 | [](./license) |
7 | | -[](#contributors-) |
| 7 | +[](#contributors-) |
8 | 8 |
|
9 | 9 | This package will generate json or yaml files from a glob. It will generate one file per locale, with the ids of each message defined by the [`defineMessages`](https://github.com/yahoo/react-intl/wiki/API#definemessages) function of [react-intl](https://github.com/yahoo/react-intl). The value of each of these keys will be an empty string, except for your `defaultLocale` which will be populated with the [`defaultMessage`](https://github.com/yahoo/react-intl/wiki/API#message-descriptor). |
10 | 10 |
|
@@ -96,12 +96,12 @@ $ extract-messages --help |
96 | 96 | $ extract-messages <input> |
97 | 97 |
|
98 | 98 | Options |
99 | | - -o, --output Output directory [require: true] |
100 | | - -l, --locales locales [require: true] |
101 | | - -f, --format json|yaml [default: json] |
102 | | - --flat json [default: true] | yaml [default: false] |
103 | | - --default-locale default locale [default: en] |
104 | | - --moduleSourceName module source name from where components are imported [default: react-intl] |
| 99 | + -o, --output Output directory [require: true] |
| 100 | + -l, --locales locales [require: true] |
| 101 | + -f, --format json | yaml [default: json] |
| 102 | + -d, --default-locale default locale |
| 103 | + -w, --overwrite-default default: false |
| 104 | + --flat json [default: true] | yaml [default: false] |
105 | 105 |
|
106 | 106 | Example |
107 | 107 | $ extract-messages --locales=ja,en --output app/translations 'app/**/*.js' |
@@ -163,6 +163,13 @@ Default: `json` |
163 | 163 |
|
164 | 164 | Set extension to output. |
165 | 165 |
|
| 166 | +##### overwriteDefault |
| 167 | + |
| 168 | +Type: `boolean`<br> |
| 169 | +Default: true |
| 170 | + |
| 171 | +If overwriteDefault is `false`, it will not overwrite messages in the default locale. |
| 172 | + |
166 | 173 | ##### flat |
167 | 174 |
|
168 | 175 | Type: `boolean`<br> |
@@ -201,6 +208,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds |
201 | 208 | <td align="center"><a href="http://ddem.us/"><img src="https://avatars1.githubusercontent.com/u/290457?v=4" width="100px;" alt="Gregor MacLennan"/><br /><sub><b>Gregor MacLennan</b></sub></a><br /><a href="https://github.com/akameco/extract-react-intl-messages/commits?author=gmaclennan" title="Code">💻</a></td> |
202 | 209 | <td align="center"><a href="https://github.com/zarv1k"><img src="https://avatars1.githubusercontent.com/u/6296643?v=4" width="100px;" alt="Dmitry Zarva"/><br /><sub><b>Dmitry Zarva</b></sub></a><br /><a href="https://github.com/akameco/extract-react-intl-messages/commits?author=zarv1k" title="Code">💻</a></td> |
203 | 210 | <td align="center"><a href="https://github.com/panpanc"><img src="https://avatars2.githubusercontent.com/u/29132669?v=4" width="100px;" alt="Michael Pan"/><br /><sub><b>Michael Pan</b></sub></a><br /><a href="#example-panpanc" title="Examples">💡</a></td> |
| 211 | + <td align="center"><a href="https://webstep.no"><img src="https://avatars2.githubusercontent.com/u/231492?v=4" width="100px;" alt="Tom Erik Støwer"/><br /><sub><b>Tom Erik Støwer</b></sub></a><br /><a href="https://github.com/akameco/extract-react-intl-messages/commits?author=testower" title="Code">💻</a></td> |
204 | 212 | </tr> |
205 | 213 | </table> |
206 | 214 |
|
|
0 commit comments