@os-team/i18next-react-native-language-detector
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)
.use(initReactI18next)
.init({
fallbackLng: 'en',
whitelist: ['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;