Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-intl-locale-manager
Advanced tools
Manage the translation process of projects that use the 'react-intl' translation library.
react-intl-locale-manager is a CLI utility created to aid in the extraction and manteinance of react-intl translations. It uses @babel/core and babel-plugin-react-intl under the hood to handle message extraction.
npm global:
npm install --global react-intl-locale-manager
npm local:
npm install --save --dev react-intl-locale-manager
yarn local:
yarn add --dev react-intl-locale-manager
The best way to obtain usage information is to use the tool's comprehensive internal help:
locale-manager --help
locale-manager [files..]
Manage the translation process of projects that use the react-intl translation
library. This tool will extract react-intl messages into key-value pairs of id
and message that can be imported directly in code and passed to the
'IntlProvider' component. Additonally, existing translations will be merged with
the extracted messages and information about the changes will be printed to
console.
Positionals:
[files..] Space separated list of paths to be scanned for translations. Can
contain glob patterns. [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 stored in a single JSON
object grouped by locale. [string]
-d, --out-dir Path to the directory where the extracted
messages will be stored generating a
[locale].json file for each locale.
[string]
-i, --ignore Glob pattern designating 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:
locale-manager -l en,es -d ./locales -i src/**/*.test.js src/**/*.js
locale-manager -l it,de -f locales.json src/**/*.{js,tsx}
For additional information, visit:
https://github.com/murar8/react-intl-locale-manager
If you would like to make a contribution to the project you can just fork the the repo, 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
.
Run the unit tests | yarn test:unit |
Build the project | yarn build |
Run the integration tests. | yarn test:integration |
FAQs
Manage the translation process of projects that use the 'react-intl' translation library.
We found that react-intl-locale-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.