Norwegian Puffin Movies

    @dvhb/react-intl-messages
    TypeScript icon, indicating that this package has built-in type declarations

    2.4.4 • 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/2.4.4 linux-x64 node-v12.13.0
    $ 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
      --namespace=namespace          Provider`s namespace. Required for Locize
      --projectId=projectId          Provider`s project id
      --provider=lokalise|locize     (required) Translation service provider
      --token=token                  Provider`s token
      --uploadTranslations           Upload existing translations to provider. Useful for provider migration.
      --version=version              Translations version, for example "production". Required for Locize
    

    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
      -l, --langs=langs              (required) Comma separated languages
      --namespace=namespace          Provider`s namespace. Required for Locize
      --projectId=projectId          Provider`s project id
      --provider=lokalise|locize     (required) Translation service provider
      --token=token                  Provider`s token
      --uploadTranslations           Upload existing translations to provider. Useful for provider migration.
      --version=version              Translations version, for example "production". Required for Locize
    
    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

    57

    Version

    2.4.4

    License

    MIT

    Unpacked Size

    41.8 kB

    Total Files

    25

    Last publish

    Collaborators

    • admindvhb
    • alexbee
    • r2d2dvhb
    • sairus2k