npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

@dvhb/react-intl-messages

1.1.0 • Public • Published

react-intl-messages

Library for parsing source files and extract react-intl messages. Extracted messages saves to json files. Underhood it uses babe-plugin-react-intl

oclif Version Downloads/week License

Features

  • synchronize translations with translation service (lokalise.co for now)
  • custom babel config, appropriate for projects on react-native and typescript
  • prettify extracted json files
  • store parameters in config

Usage

$ npm install -g @dvhb/react-intl-messages
$ messages COMMAND
running command...
$ messages (-v|--version|version)
@dvhb/react-intl-messages/1.1.0 linux-x64 node-v10.15.3
$ messages --help [COMMAND]
USAGE
  $ messages COMMAND
...

Commands

messages clean

Clean lokalise for unused translation keys

USAGE
  $ messages clean

OPTIONS
  -d, --messagesDir=messagesDir  (required) [default: src/messages] Directory for extracted messages
  -h, --help                     show CLI help
  -i, --projectId=projectId      (required) Lokalise project id
  -t, --token=token              (required) Lokalise token

See code: src/commands/clean.ts

messages extract

Extract translations from source files to json

USAGE
  $ messages extract

OPTIONS
  -d, --messagesDir=messagesDir  (required) [default: src/messages] Directory for extracted messages
  -h, --help                     show CLI help
  -i, --ignore=ignore            Regex mask for ignored files
  -l, --langs=langs              (required) Comma separated languages
  -p, --pattern=pattern          (required) Regex mask for files

EXAMPLE
  $ messages extract --langs=en,fr,de,ru --pattern="src/**/*.{ts,tsx}"

See code: src/commands/extract.ts

messages help [COMMAND]

display help for messages

USAGE
  $ messages help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

messages sync

Synchronise extracted files with Lokalise.co

USAGE
  $ messages sync

OPTIONS
  -d, --messagesDir=messagesDir  (required) [default: src/messages] Directory for extracted messages
  -h, --help                     show CLI help
  -i, --projectId=projectId      (required) Lokalise project id
  -l, --langs=langs              (required) Comma separated languages
  -t, --token=token              (required) Lokalise token

EXAMPLE
  $ messages extract --langs=en,fr,de,ru --pattern="src/**/*.{ts,tsx}"

See code: src/commands/sync.ts

Config

  • messages property in a package.json file.
  • .messages file with JSON or YAML syntax.
  • .messages.json file.
  • .messages.yaml or .messages.yml file.
  • .messages.js or messages.config.js JS file exporting the object.

install

npm i @dvhb/react-intl-messages

Downloadsweekly downloads

95

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability