5.2.1 • Published 7 years ago

react-intl-gettext v5.2.1

Weekly downloads
123
License
MIT
Repository
-
Last release
7 years ago

react-intl-gettext

Integrate react-intl with gettext tools. This package provides a CLI tool to help converting between react-intl JSON files and gettext PO files.

Installation

$ npm install react-intl-gettext --save-dev

Of course you can use yarn add.

$ yarn add react-intl-gettext --dev

Example package.json usage

scripts: {
  "i18n:extract:json2pot": "rig json2pot ./messages ./translations/my-app.pot",
  "i18n:extract:json2po": "rig json2pot -d en './build/messages/json' ./translations/my-app-en.po",
  "i18n:import": "rig po2json './translations' ./src/assets/translations.json",
}

CLI usage

 Usage: cli [options] [command]


  Commands:

    json2pot [options] <src> <dest>  converts react-intl extracted json to po/pot
    po2json [options] <src> <dest>   converts po files to json

  Options:

    -h, --help  output usage information

Commands usage

json2pot [options] <src> <dest> converts react-intl extracted json to po/pot

  Usage: json2pot [options] <src> <dest>

  converts react-intl extracted json to po/pot

  Options:

    -h, --help                      output usage information
    -p, --pattern [pattern]         glob pattern used to find the src files [**/*.json]
    -d, --use-default <lang>        use defaultMessage as msgstr and use <lang> as value for Language header field
    -i, --ignore <patterns>         add a pattern or an array of glob patterns to exclude matches
    --project-id-version [version]  set the value of Project-Id-Version header field [my-app 1.0.0]
    --report-msgid-bugs-to [url]    set the value of Report-Msgid-Bugs-to header field [http://myapp.example.com]

po2json [options] <src> <dest> converts po files to json

Usage: po2json [options] <src> <dest>

  converts po files to json

  Options:

    -h, --help               output usage information
    -p, --pattern [pattern]  glob pattern used to find the src files [**/*.po]
    --pretty                 pretty print json
    -i, --ignore <patterns>  add a pattern or an array of glob patterns to exclude matches
5.2.1

7 years ago

5.2.0

7 years ago

5.1.2

8 years ago

5.1.1

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.0.0

8 years ago

3.1.1

9 years ago

2.1.0

9 years ago

2.0.0

9 years ago

1.3.9

9 years ago

1.3.8

9 years ago

1.3.7

9 years ago

1.3.6

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago