From 715d15f91de0b7c62e30ad11a788a488286d1a84 Mon Sep 17 00:00:00 2001 From: Gustavo Emanuel Farias Rosa Date: Tue, 12 Apr 2022 17:59:15 -0300 Subject: [PATCH 1/2] implementing fall back to lenguage in Intl --- react-native/app/translations/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/react-native/app/translations/index.ts b/react-native/app/translations/index.ts index b22fce0..a1164f5 100644 --- a/react-native/app/translations/index.ts +++ b/react-native/app/translations/index.ts @@ -2,10 +2,12 @@ import i18next from 'i18next' import RNLanguages from 'react-native-languages'; import resources from './resources'; -export const initTranslation = ()=>{ +export const initTranslation = ()=>{ + console.log(RNLanguages.language) i18next.init({ compatibilityJSON: 'v3', lng: RNLanguages.language, - resources: resources + resources: resources, + fallbackLng: 'en-US', }) } \ No newline at end of file From 64cbfd02690f47ff868309d29a4542987f823be3 Mon Sep 17 00:00:00 2001 From: Gustavo Emanuel Farias Rosa Date: Tue, 12 Apr 2022 18:08:41 -0300 Subject: [PATCH 2/2] remove console log --- react-native/app/translations/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/react-native/app/translations/index.ts b/react-native/app/translations/index.ts index a1164f5..c554eb4 100644 --- a/react-native/app/translations/index.ts +++ b/react-native/app/translations/index.ts @@ -2,8 +2,7 @@ import i18next from 'i18next' import RNLanguages from 'react-native-languages'; import resources from './resources'; -export const initTranslation = ()=>{ - console.log(RNLanguages.language) +export const initTranslation = ()=>{ i18next.init({ compatibilityJSON: 'v3', lng: RNLanguages.language,