Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-intl-po
Advanced tools
Extract POT from react-intl and convert back to json.
messages.json → POT → PO → translation.json
Standalone example based on Create-React-App: https://github.com/evenchange4/react-intl-po-example
$ npm install react-intl-po --save
^2.0.0
^2.0.0
There are two sub-commands of react-intl-po
or rip
:
.pot
file..json
format.$ rip json2pot '_translations/src/**/*.json' \
-o ./mcs-public.pot
Arguments | Description |
---|---|
srcPatterns | The pattern of .json files extracted from babel-plugin-react-intl |
output (-o) | The output pathname of .pot file to be translated |
message-key (-k) | [Optional] Translation message key (default key is defaultMessage ) |
message-context (-c) | [Optional] Translation message context (defaults to no context) |
directory
is set$ rip po2json './node_modules/mcs-translation/po/mcs-public*.po' \
-m './_translations/src/**/*.json' \
-o './translations'
.json file
is set$ rip po2json './node_modules/mcs-translation/po/mcs-public*.po' \`
-m './_translations/src/**/*.json' \
-o './translations.json'
Arguments | Description |
---|---|
srcPatterns | The pattern of translated .po files |
messagesPattern (-m) | The pattern of .json files extracted from babel-plugin-react-intl |
output (-o) | The output pathname of a file / directory |
message-key (-k) | [Optional] Translation message key (default key is defaultMessage ) |
message-context (-c) | [Optional] Translation message context (defaults to no context) |
Set the message-context (-c)
to 'id'
of message object from babel-plugin-react-intl (there is no context by default).
The advantage of this option over Option 2 (below) is that PO file editors that provide features such as translation suggestions or error-checking often expect the message key to be defaultMessage
.
$ rip po2json './node_modules/mcs-translation/po/mcs-public*.po' \
-m './_translations/src/**/*.json' \
-o './translations' \
-c 'id'
$ rip po2json './node_modules/mcs-translation/po/mcs-public*.po' \`
-m './_translations/src/**/*.json' \
-o './translations.json' \
-c 'id'
Set the message-key (-k)
to 'id'
of message object from babel-plugin-react-intl (default key is 'defaultMessage'
). (#41)
$ rip po2json './node_modules/mcs-translation/po/mcs-public*.po' \
-m './_translations/src/**/*.json' \
-o './translations' \
-k 'id'
$ rip po2json './node_modules/mcs-translation/po/mcs-public*.po' \`
-m './_translations/src/**/*.json' \
-o './translations.json' \
-k 'id'
$ npm run lint
$ npm run test:watch
$ npm test
).[v2.1.0]
Jul 17, 2017
-c
arguments. (@Sand1929in [#84])Example: https://github.com/evenchange4/react-intl-po-example#option
FAQs
Extract POT from react-intl and convert back to json.
The npm package react-intl-po receives a total of 2,314 weekly downloads. As such, react-intl-po popularity was classified as popular.
We found that react-intl-po 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.