
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-localizeit
Advanced tools
react-localizeit helps you to translate and render your react components in different languages.
See in production here.
A simple component for translating your react-app. Once you wrap your views inside the LocalWrapper the translations will be available to rest of your components.
It is tiny package without dependencies.
Make sure that you are using React 16.x
$ npm install react-localizeit --save
First of all upon installing the package you have to import inside the file where your parent component is defined. You should be wrapping everything that's going to be rendered inside .
To import it simply pull the LocalWrapper.
ìmport { LocalWrapper } from 'react-localizeit'
We have to pass an object of language data to props as data.
We have to pass an object of language data to props as data. If we are using a data set that consists of a few languages we can use the object shorthand.
I prefer to keep my language files inside a folder called locales but you can name it as you like.
import en from '/path/locales/en';
import es from '/path/locales/es';
import tr from '/path/locales/tr';
const data = {en , tr , es};
const Component = ({data}) => (
<LocalWrapper
data={data}
wrapper={({ lit,setLang }) => (
// all elements are passed as children of the wrapper.
<div>
<h1>{lit('desc')}</h1>
<button onClick={() => setLang('tr')}></button>
</div>
)}/>
);
React-localizait comes with the following props
| Name | required | description |
|---|---|---|
| data | true | You should pass your data set. |
| setLang | false | For toggling the current language. |
| lit | false | Translate a string. |
| selectedLanguage | false | Get the current language being used. |
| wrapper | true | renders the elements as its children along with the props |
Node.js >= v4 must be installed.
npm install in the component's root directory will install everything you need for development.npm start will run a development server with the component's demo app at http://localhost:3000 with hot module reloading.npm test will run the tests once.npm run build will build the component for publishing to npm and also bundle the demo app.
npm run clean will delete built resources.
MIT
FAQs
react-localizeit helps you to translate and render your react components in different languages.
The npm package react-localizeit receives a total of 2 weekly downloads. As such, react-localizeit popularity was classified as not popular.
We found that react-localizeit 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.