1.0.2 • Published 6 years ago

react-simple-localize v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Really minimal localization module based on the new context api

AppVeyor

React Context Api

Zero dependencies, only 3kb ( not minified )

How to Use

// main.jsx

import { LocalizeProvider } from 'react-simple-localize'
import { YourApp } from './yourapp'

const messages = {
    en: {
        message: "hello"
    },
    it: {
        message: "ciao"
    }
}

render(
    <LocalizeProvider locale="en" messages={messages}>
        <YourApp />
    </LocalizeProvider>,
    document.getElementById('yourapp')
)
// yourapp.jsx

import { Localize } from 'react-simple-localize'

export function App() {
    return <div>
        <Localize path="message" />
        <Localize path="another.nested.message" />
        <Localize path="nested.message[0].inside_an_array" />
    </div>
}
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago