@absolutesight/react-gettext 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +369 -0
- package/dist/react-gettext.js +500 -0
- package/dist/react-gettext.min.js +1 -0
- package/lib/TextDomain.js +70 -0
- package/lib/TextDomainContext.js +11 -0
- package/lib/Textdomain.js +70 -0
- package/lib/TextdomainContext.js +11 -0
- package/lib/buildTextDomain.js +24 -0
- package/lib/buildTextdomain.js +24 -0
- package/lib/gettext.js +113 -0
- package/lib/index.js +30 -0
- package/lib/withGettext.js +39 -0
- package/package.json +81 -0
- package/src/TextDomain.js +82 -0
- package/src/TextDomainContext.js +7 -0
- package/src/buildTextDomain.js +19 -0
- package/src/gettext.js +123 -0
- package/src/index.js +12 -0
- package/src/withGettext.js +40 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.0.2 (2020-10-18)
|
|
4
|
+
|
|
5
|
+
- Updated dependencies to the latest versions.
|
|
6
|
+
|
|
7
|
+
## v1.0.1 (2019-11-21)
|
|
8
|
+
|
|
9
|
+
- Fixed babel-preset-env browser targets.
|
|
10
|
+
- Updated dependencies to the latest versions.
|
|
11
|
+
|
|
12
|
+
## v1.0.0 (2019-07-15)
|
|
13
|
+
|
|
14
|
+
- Implemented TextDomainContext context that adheres the current version of Context APIs.
|
|
15
|
+
- Reworked Poedit example project to use new API.
|
|
16
|
+
|
|
17
|
+
## v0.4.0 (2017-08-17)
|
|
18
|
+
|
|
19
|
+
**Implemented enhancements:**
|
|
20
|
+
|
|
21
|
+
- Implemented ability to get wrapped component.
|
|
22
|
+
|
|
23
|
+
## v0.3.3 (2017-08-12)
|
|
24
|
+
|
|
25
|
+
**Implemented enhancements:**
|
|
26
|
+
|
|
27
|
+
- Updated dev dependencies to use latest versions.
|
|
28
|
+
- Updated hoist-non-react-statics peer dependency to support version 2+.
|
|
29
|
+
|
|
30
|
+
## v0.3.2 (2017-08-04)
|
|
31
|
+
|
|
32
|
+
**Implemented enhancements:**
|
|
33
|
+
|
|
34
|
+
- Added a sample application which shows how to use Poedit and React/React-Router conjunction to make translatable applications.
|
|
35
|
+
- Added ability to import TextDomain component directly.
|
|
36
|
+
|
|
37
|
+
## v0.3.1 (2017-06-28)
|
|
38
|
+
|
|
39
|
+
**Fixed issues:**
|
|
40
|
+
|
|
41
|
+
- Fixed warning which happened when children prop was a node.
|
|
42
|
+
|
|
43
|
+
## v0.3.0 (2017-06-26)
|
|
44
|
+
|
|
45
|
+
**Implemented enhancements:**
|
|
46
|
+
|
|
47
|
+
- Added nxgettext function which allows to translate plural strings with context.
|
|
48
|
+
- Extracted HOC into a separate component and updated it to inherit from that standalone component.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017 Eugene Manuilov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# react-gettext 1.0.2
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/react-gettext) [](https://travis-ci.org/eugene-manuilov/react-gettext)
|
|
4
|
+
|
|
5
|
+
A tiny React library that helps to implement internalization in your application using gettext functions. It uses [React Context API](https://reactjs.org/docs/context.html) to expose gettext functions to children components.
|
|
6
|
+
|
|
7
|
+
## Instalation
|
|
8
|
+
|
|
9
|
+
> **Note:** This library requires **React 16.3 or later**
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm i react react-gettext
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
To use this library in your application, you need to do a few simple steps:
|
|
18
|
+
|
|
19
|
+
1. Prepare translations and define plural form functions.
|
|
20
|
+
1. Add `TextDomainContext.Provider` provider to the root of your application.
|
|
21
|
+
1. Updated your components to use context functions, provided by `TextDomainContext`, to translate text messages.
|
|
22
|
+
|
|
23
|
+
Let's take a closer look at each step. First of all, you to create translation catalogs and prepare plural form functions for every language that you are going to use. Each language needs one catalog and one plural form function.
|
|
24
|
+
|
|
25
|
+
The translation catalog is an object that contains key/value pairs where keys are original singular messages and values are translations. If you have a message that can have plural forms, the value for it should be an array with translations where each translation corresponds to appropriate plural form. Finally, if you want to use a context with your messages, then it should be prepended to the message itself and separated by using `\u0004` (end of transition) character. Here is an example:
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
{
|
|
29
|
+
"Hello world!": "¡Hola Mundo!", // regular message
|
|
30
|
+
"article": ["artículo", "artículos"], // plural version
|
|
31
|
+
"Logo link\u0004Homepage": "Página principal", // single message with "Logo link" contex
|
|
32
|
+
"Search results count\u0004article": ["artículo", "artículos"], // plural version with "Search results count" context
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The plural form function is a function that determines the number of a plural form that should be used for a particular translation. For English, the plural form is `n != 1 ? 1 : 0`, that means to use a translation with `0` index when `n == 1`, and a translation with `1` index in all other cases. Slavic and arabic languages have more than 2 plural forms and their functions are more complicated. Translate Toolkit has a [list of plural forms expressions for many languages](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms) that you can use in your project. An example of a plural form function can be the following:
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
function getPluralForm(n) {
|
|
40
|
+
return n != 1 ? 1 : 0;
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The next step is to pass translations and plural form function for the current language to the `buildTextDomain` function. It will create APIs that need to be passed to the `TextDomainContext.Provider` provider that you need to add to the root of your project:
|
|
45
|
+
|
|
46
|
+
```javascript
|
|
47
|
+
import React, { Component } from 'react';
|
|
48
|
+
import { TextDomainContext, buildTextDomain } from 'react-gettext';
|
|
49
|
+
|
|
50
|
+
class MyApp extends Component {
|
|
51
|
+
|
|
52
|
+
constructor(props) {
|
|
53
|
+
super(props);
|
|
54
|
+
this.state = { textdomain: buildTextDomain(...) };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
return (
|
|
59
|
+
<div>
|
|
60
|
+
<TextDomainContext.Provider value={this.state.textdomain}>
|
|
61
|
+
<ComponentA />
|
|
62
|
+
...
|
|
63
|
+
</TextDomainContext>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
> **Note:** Please, pay attention that you need to avoid passing the results of `buildTextDomain` function directly into `TextDomainContext.Provider`'s value to escape unintentional renders in consumers when a provider’s parent re-renders.
|
|
72
|
+
|
|
73
|
+
Finally, the last step is to update your descendant components to consume these context APIs. Import `TexdomainContext` in the child component and assign it to the component `contextType` static properly. It will expose gettext APIs to that component via `this.context` field:
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
import React, { Component } from "react";
|
|
77
|
+
import { TextDomainContext } from "react-gettext";
|
|
78
|
+
|
|
79
|
+
class ComponentA extends Component {
|
|
80
|
+
render() {
|
|
81
|
+
const { gettext, ngettext, xgettext, nxgettext } = this.context;
|
|
82
|
+
|
|
83
|
+
return <div>...</div>;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
ComponentA.contextType = TextDomainContext;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## An example
|
|
91
|
+
|
|
92
|
+
Let's assume you have following React application:
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
// app.js
|
|
96
|
+
import React, { Component } from "react";
|
|
97
|
+
import Header from "./Header";
|
|
98
|
+
import Footer from "./Footer";
|
|
99
|
+
|
|
100
|
+
export default class App extends Component {
|
|
101
|
+
render() {
|
|
102
|
+
return (
|
|
103
|
+
<div id="app">
|
|
104
|
+
<Header />
|
|
105
|
+
...
|
|
106
|
+
<Footer />
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
// Header.js
|
|
115
|
+
import React, { Component } from "react";
|
|
116
|
+
|
|
117
|
+
export default class Header extends Component {
|
|
118
|
+
render() {
|
|
119
|
+
return <h1>Welcome to my application!</h1>;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
To make it translatable, you need to update your `app.js` file to use TextDomainContext provider and build textdomain using messages list and plural form function:
|
|
125
|
+
|
|
126
|
+
```diff
|
|
127
|
+
// app.js
|
|
128
|
+
import React, { Component } from 'react';
|
|
129
|
+
+ import { TextDomainContext, buildTextDomain } from 'react-gettext';
|
|
130
|
+
import Header from './Header';
|
|
131
|
+
import Footer from './Footer';
|
|
132
|
+
|
|
133
|
+
export default class App extends Component {
|
|
134
|
+
|
|
135
|
+
+ constructor(props) {
|
|
136
|
+
+ super(props);
|
|
137
|
+
+ this.state = {
|
|
138
|
+
+ textdomain: buildTextDomain(
|
|
139
|
+
+ {
|
|
140
|
+
+ 'Welcome to my application!': 'Bienvenido a mi aplicación!',
|
|
141
|
+
+ // ...
|
|
142
|
+
+ },
|
|
143
|
+
+ n => n != 1
|
|
144
|
+
+ ),
|
|
145
|
+
+ };
|
|
146
|
+
+ }
|
|
147
|
+
|
|
148
|
+
render() {
|
|
149
|
+
return (
|
|
150
|
+
<div id="app">
|
|
151
|
+
+ <TextDomainContext.Provider value={this.state.textdomain}>
|
|
152
|
+
<Header />
|
|
153
|
+
...
|
|
154
|
+
<Footer />
|
|
155
|
+
+ </TextDomainContext.Provider>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
After doing it you can start using `gettext`, `ngettext`, `xgettext` and `nxgettext` functions in your descending components:
|
|
163
|
+
|
|
164
|
+
```diff
|
|
165
|
+
// Header.js
|
|
166
|
+
import React, { Component } from 'react';
|
|
167
|
+
+ import { TextDomainContext } from 'react-gettext';
|
|
168
|
+
|
|
169
|
+
export default class Header extends Component {
|
|
170
|
+
|
|
171
|
+
render() {
|
|
172
|
+
+ const { gettext } = this.context;
|
|
173
|
+
return (
|
|
174
|
+
- <h1>Welcome to my application!</h1>
|
|
175
|
+
+ <h1>{gettext('Welcome to my application!')}</h1>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
+ Header.contextType = TextDomainContext;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Check a [sample](https://github.com/eugene-manuilov/react-gettext/tree/master/examples/poedit) application to see how it works.
|
|
185
|
+
|
|
186
|
+
## Documentation
|
|
187
|
+
|
|
188
|
+
### buildTextDomain(translations, pluralForm)
|
|
189
|
+
|
|
190
|
+
Builds gettext APIs for TextDomainContext provider that will work with provided translations.
|
|
191
|
+
|
|
192
|
+
- **translations**: an object with translated messages.
|
|
193
|
+
- **pluralForm**: a function that determines a plural form or a stringular reresentation of it.
|
|
194
|
+
|
|
195
|
+
```javascript
|
|
196
|
+
const api = buildTextDomain({...}, n => n == 1 ? 0 : 1);
|
|
197
|
+
// or
|
|
198
|
+
const api = buildTextDomain({...}, 'n == 1 ? 0 : 1');
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### gettext(message)
|
|
202
|
+
|
|
203
|
+
The function to translate a string. Accepts original message and returns translation if it exists, otherwise original message.
|
|
204
|
+
|
|
205
|
+
- **message**: a string to be translated.
|
|
206
|
+
|
|
207
|
+
Example:
|
|
208
|
+
|
|
209
|
+
```javascript
|
|
210
|
+
// somewhere in your jsx component
|
|
211
|
+
this.context.gettext("Some text");
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### ngettext(singular, plural, n)
|
|
215
|
+
|
|
216
|
+
The function to translate plural string. Accepts singular and plural messages along with a number to calculate plural form against. Returns translated message based on plural form if it exists, otherwise original message based on **n** value.
|
|
217
|
+
|
|
218
|
+
- **singular**: a string to be translated when count is not plural
|
|
219
|
+
- **plural**: a string to be translated when count is plural
|
|
220
|
+
- **n**: a number to count plural form
|
|
221
|
+
|
|
222
|
+
Example:
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
// somewhere in your jsx component
|
|
226
|
+
this.context.ngettext("day ago", "days ago", numberOfDays);
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### xgettext(message, context)
|
|
230
|
+
|
|
231
|
+
The function to translate a string based on a specific context. Accepts a message to translate and a translation context string. Returns translated message if it exists, otherwise original string.
|
|
232
|
+
|
|
233
|
+
- **message**: A string to be translated.
|
|
234
|
+
- **context**: A context to search translation in.
|
|
235
|
+
|
|
236
|
+
Example:
|
|
237
|
+
|
|
238
|
+
```javascript
|
|
239
|
+
// somewhere in your jsx component
|
|
240
|
+
this.context.xgettext("some text", "context where this message is used");
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### nxgettext(singular, plural, n, context)
|
|
244
|
+
|
|
245
|
+
The function to translate plural string based on a specific context. Accepts singular and plural messages along with a number to calculate plural form against and context string. Returns translated message based on plural form if it exists, otherwise original message based on **n** value.
|
|
246
|
+
|
|
247
|
+
- **singular**: a string to be translated when count is not plural
|
|
248
|
+
- **plural**: a string to be translated when count is plural
|
|
249
|
+
- **n**: a number to count plural form
|
|
250
|
+
- **context**: A context to search translation in.
|
|
251
|
+
|
|
252
|
+
Example:
|
|
253
|
+
|
|
254
|
+
```javascript
|
|
255
|
+
// somewhere in your jsx component
|
|
256
|
+
this.context.nxgettext(
|
|
257
|
+
"day ago",
|
|
258
|
+
"days ago",
|
|
259
|
+
numberOfDays,
|
|
260
|
+
"Article publish date"
|
|
261
|
+
);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Legacy API
|
|
265
|
+
|
|
266
|
+
The initial version of this library had been created when React used the legacy version of Context APIs, thus it played a keystone role in the main approach of how to use this library at that time. However, in the late March of 2018, React 16.3 was released and that API became deprecated, so do the main approach used in this library.
|
|
267
|
+
|
|
268
|
+
The proper way to use this library is described in the [Usage](#usage) section, this section contains legacy API that will be removed in next versions of the library. We don't encourage you to use it in a new project.
|
|
269
|
+
|
|
270
|
+
### withGettext(translations, pluralForms, options)
|
|
271
|
+
|
|
272
|
+
Higher-order function which is exported by default from `react-gettext` package. It accepts two arguments and returns function to create higher-order component.
|
|
273
|
+
|
|
274
|
+
- **translations**: a hash object or a function which returns hash object where keys are original messages and values are translated messages.
|
|
275
|
+
- **pluralForms**: a string to calculate plural form (used by [Gettext PO](http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms)) or a function which accepts a number and calculates a plural form number. Pay attentions that plural forms are zero-based what means to get 1st plural form it should return 0, to get 2nd - 1, and so on.
|
|
276
|
+
- **options**: a hash object with options. Currently supports following options:
|
|
277
|
+
- **withRef**: an optional boolean flag that determines whether or not to set `ref` property to a wrapped component what will allow you to get wrapped component instance by calling `getWrappedComponent()` function of the HOC. By default: `FALSE`.
|
|
278
|
+
|
|
279
|
+
Example:
|
|
280
|
+
|
|
281
|
+
```javascript
|
|
282
|
+
const translations = {
|
|
283
|
+
'Some text': 'Some translated text',
|
|
284
|
+
...
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
const pluralForms = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; // 3 plural forms for Russian, Belarusian, Bosnian, Croatian, Serbian, Ukrainian, etc.
|
|
288
|
+
|
|
289
|
+
const HOC = withGettext(translations, pluralForms)(App);
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
```javascript
|
|
293
|
+
function getTranslations() {
|
|
294
|
+
return {
|
|
295
|
+
'Some text': 'Some translated text',
|
|
296
|
+
...
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function getPluralForms(n) {
|
|
301
|
+
return n > 1 ? 1 : 0;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const HOC = withGettext(getTranslations, getPluralForms)(App);
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
As an alternative you can pass translations and plural form as properties to higher-order-component, like this:
|
|
308
|
+
|
|
309
|
+
```javascript
|
|
310
|
+
function getTranslations() {
|
|
311
|
+
return {
|
|
312
|
+
'Some text': 'Some translated text',
|
|
313
|
+
...
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function getPluralForms(n) {
|
|
318
|
+
return n > 1 ? 1 : 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const HOC = withGettext()(App);
|
|
322
|
+
|
|
323
|
+
...
|
|
324
|
+
|
|
325
|
+
ReactDOM.render(<HOC translations={getTranslations} plural={getPluralForms}>...</HOC>, ...);
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
One more alternative is to not create HOC, but use TextDomain component directly. You can import it using `import { TextDomain } from 'react-gettext'` and use it as a regular component which will provide context functions to translate your messages. Just don't forget to pass `translations` and `plural` props to this component when you render it.
|
|
329
|
+
|
|
330
|
+
## Poedit
|
|
331
|
+
|
|
332
|
+
If you want to use Poedit application to translate your messages, then use the following keywords to properly extract static copy from your javascript files:
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
gettext;ngettext:1,2;xgettext:1,2c;nxgettext:1,2,4c
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Here is an example of a **POT** file that you can use as a starting point:
|
|
339
|
+
|
|
340
|
+
```
|
|
341
|
+
msgid ""
|
|
342
|
+
msgstr ""
|
|
343
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
344
|
+
"Project-Id-Version: \n"
|
|
345
|
+
"POT-Creation-Date: \n"
|
|
346
|
+
"PO-Revision-Date: \n"
|
|
347
|
+
"Last-Translator: \n"
|
|
348
|
+
"Language-Team: \n"
|
|
349
|
+
"MIME-Version: 1.0\n"
|
|
350
|
+
"Content-Type: text/plain; charset=iso-8859-1\n"
|
|
351
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
352
|
+
"X-Poedit-Basepath: ./src\n"
|
|
353
|
+
"X-Poedit-KeywordsList: gettext;ngettext:1,2;xgettext:1,2c;nxgettext:1,2,4c\n"
|
|
354
|
+
"X-Poedit-SourceCharset: UTF-8\n"
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
If you prefer using npm scripts, then you can add the following command to your `package.json` file to extract static copy and generate POT file using CLI commands. Make sure, you have correct `project` and `output` paths.
|
|
358
|
+
|
|
359
|
+
```
|
|
360
|
+
"gettext:extract": "find /path/to/project -name \"*.js\" | xargs xgettext --from-code=UTF-8 --language=JavaScript --keyword=gettext --keyword=ngettext:1,2 --keyword=xgettext:1,2c --keyword=nxgettext:1,2,4c --output=/path/to/project/projectname.pot --sort-by-file --package-name=\"My Project Name\" --package-version=\"1.0.0\""
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## Contribute
|
|
364
|
+
|
|
365
|
+
Want to help or have a suggestion? Open a [new ticket](https://github.com/eugene-manuilov/react-gettext/issues/new) and we can discuss it or submit pull request. Please, make sure you run `npm test` before submitting a pull request.
|
|
366
|
+
|
|
367
|
+
## License
|
|
368
|
+
|
|
369
|
+
MIT
|