We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i18n prevents page rendering when I use async-storage
index.js
import {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; import mocks from './mocks'; import axios from 'axios'; import config from './config'; import './src/lang/i18n'; axios.defaults.baseURL = config.API_URL; if (window.server) { window.server.shutdown(); } window.server = mocks.dataServer(); AppRegistry.registerComponent(appName, () => App);
When this happens, the ui is not rendered for some reason
const languageDetector = { type: 'languageDetector', async: true, init: () => {}, detect: callback => { return get('lng').then(res => { const lng = res ? res : RNLocalize.getLocales()[0].languageCode; return callback(lng); }); }, cacheUserLanguage: () => {}, }; i18n .use(languageDetector) .use(initReactI18next) .init({ compatibilityJSON: 'v3', debug: true, fallbackLng: 'en', resources: { en: { ...en, }, tr: { ...tr, }, }, }); export default i18n;
but when I use it like this, it works successfully.
const languageDetector = { type: 'languageDetector', async: true, detect: callback => { callback(RNLocalize.getLocales()[0].languageCode); }, cacheUserLanguage: () => {}, init: Function.prototype, }; i18n .use(languageDetector) .use(initReactI18next) .init({ compatibilityJSON: 'v3', debug: true, fallbackLng: 'en', resources: { en: { ...en, }, tr: { ...tr, }, }, }); export default i18n;
The text was updated successfully, but these errors were encountered:
Can you reproduce it with this example? https://github.com/i18next/react-i18next/tree/master/example/ReactNativeProject
Sorry, something went wrong.
No branches or pull requests
i18n prevents page rendering when I use async-storage
index.js
When this happens, the ui is not rendered for some reason
but when I use it like this, it works successfully.
Environments
The text was updated successfully, but these errors were encountered: