# @mercateo/ws-intl

> Components for passing i18n messages between components/modules

Latest version **1.0.3** (published 2017-06-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @mercateo/ws-intl
pnpm add @mercateo/ws-intl
yarn add @mercateo/ws-intl
bun add @mercateo/ws-intl
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-06-15 |
| First published | 2017-06-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mercateo |
| Keywords | i18n, react, ws |

## Links

- npm: https://www.npmjs.com/package/@mercateo/ws-intl
- Repository: https://github.com/Mercateo/ws-intl
- Homepage: https://github.com/Mercateo/ws-intl#readme
- Issues: https://github.com/Mercateo/ws-intl/issues
- npm.io page: https://npm.io/package/@mercateo/ws-intl

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^15.5.4
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [@types/react](https://npm.io/package/@types/react.md) 0.14.x || >= 15.0.0
- [@types/prop-types](https://npm.io/package/@types/prop-types.md) ^15.5.1

## 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.0.3 (latest) — 2017-06-15
- 1.0.2 — 2017-06-07
- 1.0.1 — 2017-06-07
- 1.0.1-1 — 2017-06-07

## README

# `@mercateo/ws-intl`

[![Build Status](https://travis-ci.org/Mercateo/ws-intl.svg?branch=master)](https://travis-ci.org/Mercateo/ws-intl)

This module provides some components for passing i18n messages between components/modules.

## Usage

`@mercateo/ws-intl` exports two components `<Translations />` and `<Translate />`. You pass a `messages` object into `<Translations />` and can get it back via `<Translate />`. Nothing more.

```js
import React from 'react';
import { render } from 'react-dom';
import { Translations, Translate } from '@mercateo/ws-intl';

// choose your translations with your custom logic
// (based on query params, user settings... )
// or load them async with `import()`
// or just write them down here:
const messages = {
  hello(name) {
    return `Hello ${name}!`
  }
};

const Foo = ({ name }) =>
  <Translate>
    {({ hello }) =>
      <p>{hello(name)}</p>}
  </Translate>;

render(
  <Translations messages={messages}>
    <Foo name="otbe" />
  </Translations>,
  document.getElementById('app')
);
```

## Examples

Have a look at [`examples/usage/`](./examples/usage).

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