🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@dlghq/react-l10n

Package Overview
Dependencies
Maintainers
33
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dlghq/react-l10n

Localization for React components

latest
npmnpm
Version
0.9.5
Version published
Maintainers
33
Created
Source

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

Keywords

react

FAQs

Package last updated on 29 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts