# @rcp/use.i18n

> A react hook for using i18n

Latest version **1.1.18** (published 2021-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rcp/use.i18n
pnpm add @rcp/use.i18n
yarn add @rcp/use.i18n
bun add @rcp/use.i18n
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.18 |
| Published | 2021-12-28 |
| First published | 2020-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | imcuttle |
| Maintainers | moyuyc |
| Keywords | imcuttle, use, i18n, react, rcp |

## Links

- npm: https://www.npmjs.com/package/@rcp/use.i18n
- Repository: https://github.com/imcuttle/rcp
- Homepage: https://github.com/imcuttle/rcp#readme
- Issues: https://github.com/imcuttle/rcp/issues
- npm.io page: https://npm.io/package/@rcp/use.i18n

## Dependencies (1)

- [tiny-i18n](https://npm.io/package/tiny-i18n.md) ^2.0.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.18 (latest) — 2021-12-28
- 1.1.17 — 2021-12-27
- 1.1.16 — 2021-09-29
- 1.1.15 — 2020-07-05
- 1.1.14 — 2020-07-04
- 1.1.12 — 2020-07-04
- 1.1.11 — 2020-07-04
- 1.1.10 — 2020-07-04
- 1.1.8 — 2020-07-03
- 1.1.6 — 2020-07-02
- 1.1.5 — 2020-07-01
- 1.1.4 — 2020-04-13
- 1.1.2 — 2020-04-13
- 1.1.0 — 2020-03-31

## README

# @rcp/use.i18n

[![NPM version](https://img.shields.io/npm/v/@rcp/use.i18n.svg?style=flat-square)](https://www.npmjs.com/package/@rcp/use.i18n)
[![NPM Downloads](https://img.shields.io/npm/dm/@rcp/use.i18n.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/@rcp/use.i18n)

A react hook for using i18n

## Installation

```bash
npm install @rcp/use.i18n
# or use yarn
yarn add @rcp/use.i18n
```

## Usage

```javascript
import useI18n from '@rcp/use.i18n'

function App({ locale = {}, language = 'zh' } = {}) {
  const { i18n } = useI18n(
    {
      zh: {
        title: '标题',
        content: '${1}, 内容'
      },
      en: {
        title: 'Title',
        content: '${1}, Content'
      }
    },
    { locale, language }
  )

  return <p>{i18n('content', i18n('title'))}</p>
}
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

## Related

## Authors

This library is written and maintained by imcuttle, &lt;a href="<mailto:moyuyc95@gmail.com"">moyuyc95@gmail.com></a>.

## License

MIT

---
_Source: https://npm.io/package/@rcp/use.i18n · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
