added missing behaviour

This commit is contained in:
Viktor Sarström 2021-04-28 15:20:44 +02:00
parent a3fa5070c2
commit 1b1e3fa1b0
3 changed files with 5 additions and 9 deletions

View File

@ -5,8 +5,5 @@
import { AppRegistry } from 'react-native'
import App from './App'
import { name as appName } from './app.json'
import { setupi18n } from './utils/translation'
setupi18n()
AppRegistry.registerComponent(appName, () => App)

View File

@ -39,9 +39,11 @@ export const LanguageService = {
if (langCode) {
i18n.translations = { [langCode]: Strings }
i18n.locale = langCode
i18n.fallbacks = true
I18nManager.forceRTL(isRTL(langCode))
}
i18n.fallbacks = true
i18n.defaultLocale = 'sv'
i18n.missingBehaviour = 'guess'
moment.locale(langCode)
},
@ -66,3 +68,5 @@ export const LanguageService = {
changeListeners[`${key}`] = (langCode) => cb(langCode)
},
}
export const i18nService = i18n

View File

@ -1,10 +1,5 @@
import i18n from 'i18n-js'
export const setupi18n = () => {
i18n.defaultLocale = 'sv'
i18n.fallbacks = true
}
export const translations = {
ar: require('../translations/ar.json'),
de: require('../translations/de.json'),