Awesome Open Source
Awesome Open Source

reactxp-i18n

This module provides cross-platform support for i18n within the ReactXP library.

This module uses react-native-i18n and i18n-js

Install

yarn add reactxp-i18n or npm install reactxp-i18n

Examples

Basic usage

import { default as RXI18n } from 'reactxp-i18n';

const translations = {
    it: {
        greeting: 'Ciao!',
    },
    en: {
        greeting: 'Hi!',
    },
    fr: {
        greeting: 'Bonjour!',
    },
};

<RX.View>
    <RXI18n toTranslate={ 'greeting' } translations={ translations } />
</RX.View>

You can pass additional parameters in customization object to enforce some properties as {locale: 'en'} or for value interpolation.

String locale

If you need the string that represents the user's locale you can use

import { getCurrentLocale } from 'reactxp-i18n';

const locale = getCurrentLocale();

Alternatives To Rx I18n
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (245,379
Plugin (113,901
String (42,398
Localization (5,322
Translate (5,102
I18n (4,834
Internationalization (3,328
Rx (2,607
L10n (657
Reactxp (14