Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-intl-locale-manager

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intl-locale-manager

Manage the translation process of projects that use the 'react-intl' translation library.

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

build codecov Codacy Badge Dependabot Status semantic-release Commitizen friendly node license

react-intl-locale-manager

react-intl-locale-manager is a CLI utility created to aid in the extraction and manteinance of react-intl messages. It uses @babel/core and babel-plugin-react-intl under the hood to handle message extraction.

Features

  • Extract messages from source files.
  • Detect duplicate IDs.
  • Get information about added and deleted IDs and languages.
  • Get information about empty translation keys.

Installation

yarn add react-intl-locale-manager

or

npm install --save react-intl-locale-manager

Usage

locale-manager --help
Usage: locale-manager [options] [files..]

Positionals:
  files  Files to be seached for translations. Every glob pattern in this list will be expanded.  [string]

Options:
  --help                              Show help  [boolean]
  --version                           Show version number  [boolean]
  -l, --languages                     Comma-separated list of language codes to support. A translation will be generated and mantained for every code in this list.  [string]
  -f, --out-file                      Path to the file where the extracted messages will be output in a single JSON object grouped by locale.  [string]
  -d, --out-dir                       Path to the directory where the extracted messages will be output generating a [locale].json file for each locale.  [string]
  -i, --ignore                        Glob pattern designationg the files to exlcude from the translation process.To define more than one ignore pattern, just list the flag multiple times.  [string]
  --module-source-name                The ES6 module source name of the React Intl package.  [string]
  --additional-component-names        Comma separated list of component names to extract messages from. Note that default we check for the fact that 'FormattedMessage' is imported from '--module-source-name' to make sure variable alias works. This option does not do that so it's less safe.,  [string]
  --extract-from-format-message-call  Opt-in to extract from 'intl.formatMessage' calls with the restriction that it has to be called with an object literal such as 'intl.formatMessage({ id: 'foo', ...})  [boolean]

Examples:
    $0 -l en,es -d ./locales -i src/**/*.test.js -i src/**/*.spec.js  src/**/*.js
    $0 --extract-from-format-message-call -l en,es -f locales.json src/**/*.tsx

For additional information, visit: https://github.com/murar8/react-intl-locale-manager

locale-manager manage --help
Usage: locale-manager [options] [files..]

Positionals:
  files  Files to be seached for translations. Every glob pattern in this list will be expanded.  [string]

Options:
  --help                              Show help  [boolean]
  --version                           Show version number  [boolean]
  -l, --languages                     Comma-separated list of language codes to support. A translation will be generated and mantained for every code in this list.  [string]
  -f, --out-file                      Path to the file where the extracted messages will be output in a single JSON object grouped by locale.  [string]
  -d, --out-dir                       Path to the directory where the extracted messages will be output generating a [locale].json file for each locale.  [string]
  -i, --ignore                        Glob pattern designationg the files to exlcude from the translation process.To define more than one ignore pattern, just list the flag multiple times.  [string]
  --module-source-name                The ES6 module source name of the React Intl package.  [string]
  --additional-component-names        Comma separated list of component names to extract messages from. Note that default we check for the fact that 'FormattedMessage' is imported from '--module-source-name' to make sure variable alias works. This option does not do that so it's less safe.,  [string]
  --extract-from-format-message-call  Opt-in to extract from 'intl.formatMessage' calls with the restriction that it has to be called with an object literal such as 'intl.formatMessage({ id: 'foo', ...})  [boolean]

Examples:
    $0 -l en,es -d ./locales -i src/**/*.test.js -i src/**/*.spec.js  src/**/*.js
    $0 --extract-from-format-message-call -l en,es -f locales.json src/**/*.tsx

For additional information, visit: https://github.com/murar8/react-intl-locale-manager

Contributing

If you would like to make a contribution to the project you can fork it then submit a pull request.

Please note that this projects uses semantic-release following the Angular Commit Message Conventions, so version bumping is completely automated. In order to ensure the commit messages follow the specification, you can use the commit script in package.json. The README.md and CHANGELOG.md are automatically generated when pushing the code to the repository. To modify the readme, edit README_template.md.

Pre-commit checklist
Run the unit testsyarn test:unit
Build the projectyarn build
Run the integration tests.yarn test:integration

FAQs

Package last updated on 04 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc