muba-input-select
Advanced tools
Comparing version 0.0.10 to 0.0.11
import React from 'react'; | ||
import * as Font from "expo-font"; | ||
import * as Font from 'expo-font'; | ||
import { View, Image } from 'react-native'; | ||
import { strings } from './locales/i18n'; | ||
import { strings } from './locales/I18n.js'; | ||
import OutputText from 'muba-output-text'; | ||
@@ -20,4 +20,2 @@ import { inputSelectStyles } from './InputSelectStyles'; | ||
} | ||
loadFonts(); | ||
} | ||
@@ -24,0 +22,0 @@ |
import I18n from 'ex-react-native-i18n'; | ||
// Import all locales | ||
import ar from './ar.json'; | ||
import fr from './fr.json'; | ||
import en from './en.json'; | ||
// Define the supported translations | ||
I18n.translations = { | ||
ar, | ||
fr, | ||
en | ||
}; | ||
// The method we'll use instead of a regular string | ||
export function strings(name, params = {}) { | ||
let text; | ||
if (I18n.currentLocale() !== 'ar' && I18n.currentLocale() !== 'fr' && I18n.currentLocale() !== 'en') { | ||
let currentLocale = I18n.currentLocale(); | ||
I18n.locale = 'en'; | ||
text = I18n.t(name, params); | ||
I18n.locale = currentLocale; | ||
} else { | ||
text = I18n.t(name, params); | ||
} | ||
return text; | ||
return I18n.t(name, params); | ||
} | ||
export default I18n; | ||
export function isRTL() { | ||
return I18n.currentLocale() === 'ar'; | ||
} |
{ | ||
"name": "muba-input-select", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Input select", | ||
@@ -5,0 +5,0 @@ "main": "InputSelect.js", |
293104
272