# inno-trans-react-element-plugin

> inno-trans plugin for react element interpolation.

Latest version **0.0.5** (published 2019-01-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install inno-trans-react-element-plugin
pnpm add inno-trans-react-element-plugin
yarn add inno-trans-react-element-plugin
bun add inno-trans-react-element-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2019-01-09 |
| First published | 2018-12-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | skt-t1-byungi |
| Maintainers | skt-t1-byungi |
| Keywords | inno-trans, plugin, i18n, localization, react, html, tag, interpolation |

## Links

- npm: https://www.npmjs.com/package/inno-trans-react-element-plugin
- Repository: https://github.com/skt-t1-byungi/inno-trans-react-element-plugin
- npm.io page: https://npm.io/package/inno-trans-react-element-plugin

## Dependencies (1)

- [tag-name-parser](https://npm.io/package/tag-name-parser.md) ^0.2.2

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2019-01-09
- 0.0.4 — 2018-12-25
- 0.0.3 — 2018-12-19
- 0.0.2 — 2018-12-19
- 0.0.1 — 2018-12-19

## README

# inno-trans-react-element-plugin
inno-trans plugin for react element interpolation.

[![npm](https://flat.badgen.net/npm/v/inno-trans-react-element-plugin)](https://www.npmjs.com/package/inno-trans-react-element-plugin)

## Install
```sh
npm i inno-trans-react-element-plugin
```
```js
const InnoTrans = require('inno-trans')
const InnoTransReactElementPlugin = require('inno-trans-react-element-plugin')

InnoTrans.use(InnoTransReactElementPlugin) // install plugin.
```

## Example
```jsx
const t = InnoTrans({
    locale: 'en',
    messages: {
        en: {
            welcome: '<wrap>welcome<0/>to {name}</wrap>'
        }
    }
})

function App(){
    return t.rt('welcome', {wrap: <p className='a' />, 0: <br/>, name: 'my world'})
}

ReactDOM.render(<App />, document.getElementById('app'))
```
output:
```html
<div id="app">
    <p class='a'>welcome<br />to my world</p>
</div>
```

## API
### t.rt(key [, values [, options]])
Returns a message that matches the key. with react element interpolation.
```jsx
// 'hello' : '<0>hello<1 />{name}!!</0>'

t.rt('hello', {0: <div className='abc' />, 1: <br/>, name: 'byungi!'})

// => <div class='abc'>hello<br/>byungi!!</div>
```

### t.rtc(key, number [, values [, options]])
Returns a message that matches the key and the quantity number. with react element interpolation.

```jsx
// 'apple' : '<0>an apple</0>|<0>apples</0>'

t.rtc('apple', 10, {0: <div className='abc' />})

// => <div class='abc'>apples</div>
```

## Related
- [inno-trans](https://github.com/skt-t1-byungi/inno-trans) - simple localization library (inspired by laravel translation)
- [tag-name-parser](https://github.com/skt-t1-byungi/tag-name-parser) - A tag name parser that does not support attributes. Lightweight and fast when only need tag names.

## License
MIT

---
_Source: https://npm.io/package/inno-trans-react-element-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
