Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
react-localize
Advanced tools
A simple context wrapper and text localization component for localizing strings
A simple context wrapper and text localization component for localizing strings.
npm i react-localize
import Localization, { Text } from 'react-localize';
<Localization messages={{
'app.button.Submit': 'Submit',
foo: {
bar: 'Hey %s, you must be %d old?'
}
}}>
<AnyParent>
<Text message="prop.Val" style={{ color: 'blue' }} />
<Text message="app.button.Submit" data-magic="pretty neat" />
<Text message="foo.bar" values={['Foophen', 32]} style={{ color: 'red' }} />
</AnyParent>
</Localization>
<span style="color: blue">prop.Val</span>
<span data-magic="pretty neat">Submit</span>
<span style="color: red">Hey Foophen, you must be 32 old?</span>
<Text message='some.key'>
{(localized, message, ...values) => {
// message & ...values are optional, and are really just whatever you sent in on props
return <input type="text" placholder={localized} />
}}
</Text>
(that's so you can use something other than span, or put localized text in attributes, mostly)
I think you might need to browserify build/index.js
because of util
dependency. I have the dist/
folder but I'm not sure how I feel about all that or what it should do yet.
¯\_(ツ)_/¯
FAQs
A simple context wrapper and text localization component for localizing strings
The npm package react-localize receives a total of 113 weekly downloads. As such, react-localize popularity was classified as not popular.
We found that react-localize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.