How to use the react-i18next.translate.setI18n function in react-i18next

To help you get started, we’ve selected a few react-i18next examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github whphhg / vcash-electron / src / index.js View on Github external
import { join } from 'path'
import i18next from './utilities/i18next'
import './utilities/rightClickMenu'

/** Components */
import Connections from './components/screens/Connections'
import MainMenu from './components/menus/MainMenu'
import Root from './components/Root'

/** Store instances */
import connections from './stores/connections'
import gui from './stores/gui'
import rates from './stores/rates'

/** Set the i18next instance. */
translate.setI18n(i18next)

/** Use MobX strict mode, allowing only actions to alter the state. */
useStrict(true)

/** Enable MobX logging in development mode. */
if (process.env.NODE_ENV === 'dev') enableLogging()

/** Override and disable eval, which allows strings to be executed as code. */
// prettier-ignore
window.eval = global.eval = () => { // eslint-disable-line
  throw new Error('eval() is disabled for security reasons.')
}

render(
github iotaledger / trinity-wallet / src / mobile / routes / entry.js View on Github external
import { Navigation } from 'react-native-navigation';
import { translate } from 'react-i18next';
import { Provider } from 'react-redux';
import '../shim';
import registerScreens from './navigation';
import store from '../store';
import i18 from '../i18next';

registerScreens(store, Provider);
translate.setI18n(i18);

Navigation.startSingleScreenApp({
    screen: {
        screen: 'initialLoading',
        navigatorStyle: {
            navBarHidden: true,
            navBarTransparent: true,
        },
        overrideBackPress: true,
    },
    appStyle: {
        orientation: 'portrait',
    },
});

XMLHttpRequest = GLOBAL.originalXMLHttpRequest ? GLOBAL.originalXMLHttpRequest : GLOBAL.XMLHttpRequest;