
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
react-translation
Advanced tools
This is a simple plugin for using multi languages in your project.
npm install react-translator --save
This prugin requires react
and redux
libraries.
First of all we need to add a reducer to our store:
createStore(
combineReducers({...reducers, lang: translatorReducer('ru')})
)
the name of reducer should be lang
.
Use the plugin in your component:
import { translator, changeLanguage } from 'react-translation';
export default compose(
connect(
null,
{ changeLanguage },
),
translator({
foo: {
ru: 'Привет',
en: 'Hello',
sp: 'Hola',
}
}),
)(MyComponent)
Use your keys as props in your component:
<div> {this.props.foo} </div>
<button onClick={() => this.props.changeLanguage('en')}>en</button>
<button onClick={() => this.props.changeLanguage('ru')}>ru</button>
<button onClick={() => this.props.changeLanguage('sp')}>sp</button>
FAQs
React simple plugin for multi-languages applications.
The npm package react-translation receives a total of 1 weekly downloads. As such, react-translation popularity was classified as not popular.
We found that react-translation 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.