-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
53 lines (45 loc) · 1.26 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import {createStackNavigator} from '@react-navigation/stack';
import i18next from 'i18next';
import {initReactI18next} from 'react-i18next';
import {NativeBaseProvider, extendTheme} from 'native-base';
import MainScreen from './src/screens/main/MainScreen';
import AuthScreen from './src/screens/auth/AuthScreen';
import {RootStackParamList} from './src/screens/RootStackPrams';
import * as sv from './src/i18n/sv.json';
import * as en from './src/i18n/en.json';
const Stack = createStackNavigator<RootStackParamList>();
i18next
.use({
type: 'languageDetector',
async: true,
detect: (cb: (arg0: string) => any) => cb('en'),
init: () => {
},
cacheUserLanguage: () => {
},
})
.use(initReactI18next)
.init({
fallbackLng: 'en',
debug: true,
resources: {
en: {
translation: en.translation
},
sv: {
translation: sv.translation
},
},
});
export default function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Auth" component={AuthScreen}/>
<Stack.Screen name="Main" component={MainScreen}/>
</Stack.Navigator>
</NavigationContainer>
);
}