0.1.0 • Published 9 years ago

react-jed v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

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}
            />
        )
    }
}