babelfish-plus
Babelfish react helpers. Can be used for rendering props as react widgets. All babelfish power accessible from helper. Returns array of translated strings and functions:
As library
const options = locale: 'ru' phrases: user: birthday: 'День рождения: #{date}' const t = // 'День рождения: 01.01.1970' // ['День рождения: ', Func] // 'not.existing.path'
React component
const func string = PropTypes Component static propTypes = date: stringisRequired { return <span className="date">thispropsdate</span> } Component static propTypes = date: stringisRequired { return <div> <T>User info</T> <T date=<Date value=thispropsdate />>userbirthday</T> </div> } Component static propTypes = t: funcisRequired birthday: stringisRequired static childContextTypes = t: func { return t: thispropst } { return <UserBirthday date=thispropsbirthday /> } const options = locale: 'ru' phrases: 'User info': 'О пользователе' user: birthday: 'День рождения: #{date}' const t = React