react-jed

0.1.0 • Public • Published

React Jed

React component for translation with Jed.

Installation

$ npm install --save react-jed

Usage

Simple translation

import Trans from 'react-jed'
 
class MyComponent extend React.Component {
    render() {
        var translations = window.translations
        return (
            <Trans trans={translations}>Christian Bale has an apple</Trans>
        )
    }
}

Complex translation with plural

import Trans from 'react-jed'
 
class MyComponent extend React.Component {
    render() {
        var nbr = 1,
            translations = window.translations
 
        return (
            <Trans
                count={nbr}
                one="{username} has one apple"
                plural="{username} has {nbr} apples"
                none="{username} has no apples"
                trans={translations}
            />
        )
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i react-jed

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • romainberger