martinandert / react-translate-component

A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content.
MIT License
322 stars 31 forks source link

Support HTML content #7

Closed jonaswindey closed 8 years ago

jonaswindey commented 9 years ago

At the moment it's not possible to set html content in the translation values.

If I use:

<div dangerouslySetInnerHTML={{__html: _t('my_translation')}} />

it just renders [Object object] instead of the translated string.

martinandert commented 9 years ago

I think the example code uses a translation with embedded HTML. See https://github.com/martinandert/react-translate-component/blob/master/example/locales/en.js under example.seconds_passed.

Does that help?