Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Utilities to integrate react-intl with gettext

License

NotificationsYou must be signed in to change notification settings

rubencosta/react-intl-gettext

Repository files navigation

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 useyarn add.

$ yarn add react-intl-gettext --dev

Examplepackage.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 valuefor 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

About

Utilities to integrate react-intl with gettext

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp