@dlghq/react-l10n

Localization for React components

Stats

StarsIssuesVersionUpdatedCreatedSize
@dlghq/react-l10n
0.9.52 years ago6 years agoMinified + gzip package size for @dlghq/react-l10n in KB

Readme

React localization

Localization for React components

Installation

npm install --save react
npm install --save @dlghq/react-l10n

Usage

import React from 'react';
import { render } from 'react-dom';
import { Provider, Text } from '@dlghq/react-l10n';

const messages = {
  'en-US': { hello: 'Hello' },
  'ru-RU': { hello: 'Привет' },
};

function Application() {
  return (
    <Provider messages={messages} locale={navigator.language}>
      <Text id="hello" className="text" tagName="p" />
    </Provider>
  );
}

const container = document.getElementById('container');

render(<Application />, container);

More examples in tests

License

Apache-2.0

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.