@os-team/i18next-react-native-language-detector
TypeScript icon, indicating that this package has built-in type declarations

1.0.33 • Public • Published

@os-team/i18next-react-native-language-detector NPM version BundlePhobia

The i18next language detector, which is used to detect the user's language in React Native.

Usage

Install the package using the following command:

yarn add @os-team/i18next-react-native-language-detector

Example of usage:

import i18next from 'i18next';
import { initReactI18next } from 'react-i18next';
import RNLanguageDetector from '@os-team/i18next-react-native-language-detector';

i18next
  .use(RNLanguageDetector) // Add the language detector
  .use(initReactI18next)
  .init({
    fallbackLng: 'en',
    supportedLngs: ['en', 'ru'],
    ns: [],
    defaultNS: undefined,

    resources: {
      en: {
        common: require('./locales/en/common.json'),
      },
      ru: {
        common: require('./locales/ru/common.json'),
      },
    },

    interpolation: {
      escapeValue: false,
    },
  });

export default i18next;

Readme

Keywords

none

Package Sidebar

Install

npm i @os-team/i18next-react-native-language-detector

Weekly Downloads

3,342

Version

1.0.33

License

MIT

Unpacked Size

5.28 kB

Total Files

8

Last publish

Collaborators

  • oxilor