import i18n from 'i18n-js';
import * as RNLocalize from 'react-native-localize';

import { es, en, fr } from './translations';

i18n.fallbacks = true;
i18n.translations = { es, en, fr };

const fallback = { languageTag: 'en', isRTL: false };

const { languageTag } =
  RNLocalize.findBestAvailableLanguage(Object.keys(i18n.translations)) || fallback;
i18n.locale = languageTag;
