@tyrads.com/tyrads-sdk 2.0.0-beta.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/LICENSE +11 -11
  2. package/android/build.gradle +117 -117
  3. package/android/gradle.properties +5 -5
  4. package/android/src/main/AndroidManifest.xml +3 -3
  5. package/android/src/main/AndroidManifestNew.xml +2 -2
  6. package/android/src/main/java/com/tyradssdk/TyradsSdkComposeViewManager.kt +112 -112
  7. package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +56 -56
  8. package/android/src/main/java/com/tyradssdk/TyradsSdkPackage.kt +18 -21
  9. package/ios/Tyrads/AcmoConfig.swift +32 -31
  10. package/ios/Tyrads/ApiHeaders.swift +12 -0
  11. package/ios/Tyrads/InitModel.swift +48 -46
  12. package/ios/Tyrads/Tyrads.swift +199 -176
  13. package/ios/TyradsSdk-Bridging-Header.h +2 -2
  14. package/ios/TyradsSdk.mm +14 -11
  15. package/ios/TyradsSdk.swift +47 -27
  16. package/lib/commonjs/acmo/core/marquee.js.map +1 -1
  17. package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
  18. package/lib/commonjs/acmo/core/types/types.d.js.map +1 -1
  19. package/lib/commonjs/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
  20. package/lib/commonjs/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  21. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js +3 -5
  22. package/lib/commonjs/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
  23. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js +3 -8
  24. package/lib/commonjs/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
  25. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +3 -3
  26. package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  27. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js +2 -7
  28. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
  29. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js +4 -6
  30. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
  31. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js +4 -6
  32. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
  33. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js +5 -6
  34. package/lib/commonjs/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
  35. package/lib/commonjs/acmo/modules/dashboard/repository.js.map +1 -1
  36. package/lib/commonjs/acmo/modules/dashboard/top_offers.js +23 -7
  37. package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
  38. package/lib/commonjs/i18n.js.map +1 -1
  39. package/lib/commonjs/index.js +12 -2
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/module/acmo/core/marquee.js.map +1 -1
  42. package/lib/module/acmo/core/storage/storage.js.map +1 -1
  43. package/lib/module/acmo/core/types/types.d.js.map +1 -1
  44. package/lib/module/acmo/modules/dashboard/components/auto_scroller.js.map +1 -1
  45. package/lib/module/acmo/modules/dashboard/components/custom_card.js.map +1 -1
  46. package/lib/module/acmo/modules/dashboard/components/my_games_button.js +3 -5
  47. package/lib/module/acmo/modules/dashboard/components/my_games_button.js.map +1 -1
  48. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js +3 -8
  49. package/lib/module/acmo/modules/dashboard/components/offer_info_section.js.map +1 -1
  50. package/lib/module/acmo/modules/dashboard/components/premium_header.js +3 -3
  51. package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
  52. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js +2 -7
  53. package/lib/module/acmo/modules/dashboard/components/premium_option_1.js.map +1 -1
  54. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js +4 -6
  55. package/lib/module/acmo/modules/dashboard/components/premium_option_2.js.map +1 -1
  56. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js +4 -6
  57. package/lib/module/acmo/modules/dashboard/components/premium_option_3.js.map +1 -1
  58. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js +5 -6
  59. package/lib/module/acmo/modules/dashboard/components/premium_option_4.js.map +1 -1
  60. package/lib/module/acmo/modules/dashboard/repository.js.map +1 -1
  61. package/lib/module/acmo/modules/dashboard/top_offers.js +23 -7
  62. package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
  63. package/lib/module/i18n.js.map +1 -1
  64. package/lib/module/index.js +12 -2
  65. package/lib/module/index.js.map +1 -1
  66. package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
  67. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
  68. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
  70. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
  72. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
  74. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
  76. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
  78. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
  80. package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
  83. package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  85. package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
  86. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts +1 -0
  87. package/lib/typescript/module/src/acmo/modules/dashboard/components/my_games_button.d.ts.map +1 -1
  88. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts +1 -0
  89. package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_info_section.d.ts.map +1 -1
  90. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts +1 -0
  91. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
  92. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts +1 -0
  93. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_1.d.ts.map +1 -1
  94. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts +1 -0
  95. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_2.d.ts.map +1 -1
  96. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts +1 -0
  97. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_3.d.ts.map +1 -1
  98. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts +1 -0
  99. package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_option_4.d.ts.map +1 -1
  100. package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
  101. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts +1 -0
  102. package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
  103. package/lib/typescript/module/src/index.d.ts.map +1 -1
  104. package/package.json +197 -197
  105. package/readme.md +95 -97
  106. package/src/acmo/core/marquee.tsx +61 -61
  107. package/src/acmo/core/storage/storage.ts +27 -27
  108. package/src/acmo/core/types/types.d.ts +93 -93
  109. package/src/acmo/modules/dashboard/components/auto_scroller.tsx +84 -84
  110. package/src/acmo/modules/dashboard/components/custom_card.tsx +30 -30
  111. package/src/acmo/modules/dashboard/components/my_games_button.tsx +39 -39
  112. package/src/acmo/modules/dashboard/components/offer_info_section.tsx +138 -143
  113. package/src/acmo/modules/dashboard/components/premium_header.tsx +80 -80
  114. package/src/acmo/modules/dashboard/components/premium_option_1.tsx +155 -160
  115. package/src/acmo/modules/dashboard/components/premium_option_2.tsx +99 -103
  116. package/src/acmo/modules/dashboard/components/premium_option_3.tsx +41 -45
  117. package/src/acmo/modules/dashboard/components/premium_option_4.tsx +184 -183
  118. package/src/acmo/modules/dashboard/repository.ts +94 -94
  119. package/src/acmo/modules/dashboard/top_offers.tsx +144 -131
  120. package/src/i18n.ts +114 -114
  121. package/src/index.tsx +89 -81
  122. package/tyrads-sdk.podspec +41 -41
@@ -1,131 +1,144 @@
1
- import React, { useState, useEffect } from 'react';
2
- import {
3
- View,
4
- Text,
5
- ActivityIndicator,
6
- StyleSheet,
7
- } from 'react-native';
8
- import { fetchCampaignsData } from './repository';
9
- import PremiumHeaderSection from './components/premium_header';
10
- import CustomCard from './components/custom_card';
11
- import MyGamesButton from './components/my_games_button';
12
- import PremiumOption1 from './components/premium_option_1';
13
- import PremiumOption2 from './components/premium_option_2';
14
- import PremiumOption3 from './components/premium_option_3';
15
- import PremiumOption4 from './components/premium_option_4';
16
-
17
- interface TopOffersProps {
18
- showMore?: boolean;
19
- showMyOffers?: boolean;
20
- showMyOffersEmptyView?: boolean;
21
- style?: number;
22
- }
23
-
24
- const TopOffers: React.FC<TopOffersProps> = ({
25
- showMore,
26
- showMyOffers = false,
27
- showMyOffersEmptyView = false,
28
- style = 1,
29
- }) => {
30
- const [campaigns, setCampaigns] = useState<TransformedCampaign[]>([]);
31
- const [isLoading, setIsLoading] = useState<boolean>(true);
32
- const [error, setError] = useState<string | null>(null);
33
- const [premiumColor, setPremiumColor] = useState<string>('#1C90DF');
34
- // const [language, setLanguage] = useState<string>('en');
35
-
36
- useEffect(() => {
37
- fetchCampaignsData(
38
- // setLanguage,
39
- setPremiumColor,
40
- setCampaigns,
41
- setError,
42
- setIsLoading
43
- );
44
- }, []);
45
-
46
- if (isLoading) {
47
- return (
48
- <View style={styles.loadingContainer}>
49
- <ActivityIndicator size="large" color="#007AFF" />
50
- </View>
51
- );
52
- }
53
-
54
- if (error) {
55
- return (
56
- <View style={styles.errorContainer}>
57
- <Text style={styles.errorText}>Error: {error}</Text>
58
- </View>
59
- );
60
- }
61
-
62
- if (campaigns.length === 0) {
63
- if (showMyOffersEmptyView) {
64
- return (
65
- <View style={styles.noCampaignContainer}>
66
- <Text>No campaigns available</Text>
67
- </View>
68
- );
69
- } else {
70
- return <View />;
71
- }
72
- }
73
-
74
- return (
75
- <CustomCard style={{}}>
76
- <View style={{ flex: 1 }}>
77
- <PremiumHeaderSection showMore={showMore} premiumColor={premiumColor} />
78
- <View style={styles.headerSpacer} />
79
- {(() => {
80
- switch (style) {
81
- case 1:
82
- return (
83
- <PremiumOption1 data={campaigns} premiumColor={premiumColor} />
84
- );
85
- case 2:
86
- return (
87
- <PremiumOption2 data={campaigns} premiumColor={premiumColor} />
88
- );
89
- case 3:
90
- return (
91
- <PremiumOption3 data={campaigns} premiumColor={premiumColor} />
92
- );
93
- case 4:
94
- return (
95
- <PremiumOption4 data={campaigns} premiumColor={premiumColor} />
96
- );
97
- default:
98
- return <Text>Please specify a correct style</Text>;
99
- }
100
- })()}
101
- <View style={styles.gameListSpacer} />
102
- {showMyOffers && <MyGamesButton premiumColor={premiumColor} />}
103
- </View>
104
- </CustomCard>
105
- );
106
- };
107
-
108
- const styles = StyleSheet.create({
109
- loadingContainer: {
110
- flex: 1,
111
- justifyContent: 'center',
112
- alignItems: 'center',
113
- },
114
- errorContainer: {
115
- padding: 16,
116
- },
117
- errorText: {
118
- color: 'red',
119
- },
120
- noCampaignContainer: {
121
- padding: 16,
122
- },
123
- headerSpacer: {
124
- height: 10,
125
- },
126
- gameListSpacer: {
127
- height: 10,
128
- },
129
- });
130
-
131
- export default TopOffers;
1
+ import React, { useState, useEffect } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ ActivityIndicator,
6
+ StyleSheet,
7
+ } from 'react-native';
8
+ import { fetchCampaignsData } from './repository';
9
+ import PremiumHeaderSection from './components/premium_header';
10
+ import CustomCard from './components/custom_card';
11
+ import MyGamesButton from './components/my_games_button';
12
+ import PremiumOption1 from './components/premium_option_1';
13
+ import PremiumOption2 from './components/premium_option_2';
14
+ import PremiumOption3 from './components/premium_option_3';
15
+ import PremiumOption4 from './components/premium_option_4';
16
+
17
+ interface TopOffersProps {
18
+ showMore?: boolean;
19
+ showMyOffers?: boolean;
20
+ showMyOffersEmptyView?: boolean;
21
+ style?: number;
22
+ onNavigate: (route?: string, campaignID?: number) => void;
23
+ }
24
+
25
+ const TopOffers: React.FC<TopOffersProps> = ({
26
+ showMore,
27
+ showMyOffers = false,
28
+ showMyOffersEmptyView = false,
29
+ style = 1,
30
+ onNavigate
31
+ }) => {
32
+ const [campaigns, setCampaigns] = useState<TransformedCampaign[]>([]);
33
+ const [isLoading, setIsLoading] = useState<boolean>(true);
34
+ const [error, setError] = useState<string | null>(null);
35
+ const [premiumColor, setPremiumColor] = useState<string>('#1C90DF');
36
+ // const [language, setLanguage] = useState<string>('en');
37
+
38
+ useEffect(() => {
39
+ fetchCampaignsData(
40
+ // setLanguage,
41
+ setPremiumColor,
42
+ setCampaigns,
43
+ setError,
44
+ setIsLoading
45
+ );
46
+ }, []);
47
+
48
+ const handleShowOffers = () => {
49
+ onNavigate();
50
+ };
51
+ const handleCampaignPress = (campaignId: number) => {
52
+ onNavigate('campaign-details',campaignId );
53
+ };
54
+
55
+ const handleMoreOffersPress = (route: string) => {
56
+ onNavigate(route);
57
+ };
58
+
59
+ if (isLoading) {
60
+ return (
61
+ <View style={styles.loadingContainer}>
62
+ <ActivityIndicator size="large" color="#007AFF" />
63
+ </View>
64
+ );
65
+ }
66
+
67
+ if (error) {
68
+ return (
69
+ <View style={styles.errorContainer}>
70
+ <Text style={styles.errorText}>Error: {error}</Text>
71
+ </View>
72
+ );
73
+ }
74
+
75
+ if (campaigns.length === 0) {
76
+ if (showMyOffersEmptyView) {
77
+ return (
78
+ <View style={styles.noCampaignContainer}>
79
+ <Text>No campaigns available</Text>
80
+ </View>
81
+ );
82
+ } else {
83
+ return <View />;
84
+ }
85
+ }
86
+
87
+ return (
88
+ <CustomCard style={{}}>
89
+ <View style={{ flex: 1 }}>
90
+ <PremiumHeaderSection showMore={showMore} premiumColor={premiumColor} onShowOffers={handleShowOffers} />
91
+ <View style={styles.headerSpacer} />
92
+ {(() => {
93
+ switch (style) {
94
+ case 1:
95
+ return (
96
+ <PremiumOption1 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
97
+ );
98
+ case 2:
99
+ return (
100
+ <PremiumOption2 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
101
+ );
102
+ case 3:
103
+ return (
104
+ <PremiumOption3 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
105
+ );
106
+ case 4:
107
+ return (
108
+ <PremiumOption4 data={campaigns} premiumColor={premiumColor} onCampaignPress={handleCampaignPress} />
109
+ );
110
+ default:
111
+ return <Text>Please specify a correct style</Text>;
112
+ }
113
+ })()}
114
+ <View style={styles.gameListSpacer} />
115
+ {showMyOffers && <MyGamesButton premiumColor={premiumColor} onPress={handleMoreOffersPress}/>}
116
+ </View>
117
+ </CustomCard>
118
+ );
119
+ };
120
+
121
+ const styles = StyleSheet.create({
122
+ loadingContainer: {
123
+ flex: 1,
124
+ justifyContent: 'center',
125
+ alignItems: 'center',
126
+ },
127
+ errorContainer: {
128
+ padding: 16,
129
+ },
130
+ errorText: {
131
+ color: 'red',
132
+ },
133
+ noCampaignContainer: {
134
+ padding: 16,
135
+ },
136
+ headerSpacer: {
137
+ height: 10,
138
+ },
139
+ gameListSpacer: {
140
+ height: 10,
141
+ },
142
+ });
143
+
144
+ export default TopOffers;
package/src/i18n.ts CHANGED
@@ -1,115 +1,115 @@
1
- import i18n from 'i18next';
2
- import { initReactI18next } from 'react-i18next';
3
- import AsyncStorage from '@react-native-async-storage/async-storage';
4
-
5
-
6
- const resources = {
7
- en: {
8
- translation: {
9
- "dashboard": {
10
- "suggested_offers": "Suggested Offers",
11
- "more_offers": "More Offers",
12
- "my_games": "My Games",
13
- "play_button": "Play Now",
14
- "top_ranking": "Top {{number}}",
15
- "rewards_one": "Reward",
16
- "rewards_other": "Rewards"
17
- },
18
-
19
-
20
- }
21
- },
22
- es: {
23
- translation: {
24
- "dashboard": {
25
- "suggested_offers": "Ofertas sugeridas",
26
- "more_offers": "Más ofertas",
27
- "my_games": "Mis juegos",
28
- "play_button": "Jugar Ahora",
29
- "top_ranking": "Los mejores {{number}}",
30
- "rewards_one": "Recompensa",
31
- "rewards_other": "Recompensas"
32
- },
33
-
34
- }
35
- },
36
- id: {
37
- translation: {
38
- "dashboard": {
39
- "suggested_offers": "Penawaran yang Disarankan",
40
- "more_offers": "Penawaran Lainnya",
41
- "my_games": "Permainan Saya",
42
- "play_button": "Mainkan Sekarang",
43
- "top_ranking": "Top {{number}}",
44
- "rewards_one": "Hadiah",
45
- "rewards_other": "Hadiah"
46
- },
47
- }
48
- },
49
- in: {
50
- translation: {
51
- "dashboard": {
52
- "suggested_offers": "Penawaran yang Disarankan",
53
- "more_offers": "Penawaran Lainnya",
54
- "my_games": "Permainan Saya",
55
- "play_button": "Mainkan Sekarang",
56
- "top_ranking": "Top {{number}}",
57
- "rewards_one": "Hadiah",
58
- "rewards_other": "Hadiah"
59
- },
60
- }
61
- },
62
- ja: {
63
- translation: {
64
- "dashboard": {
65
- "suggested_offers": "おすすめのオファー",
66
- "more_offers": "その他のオファー",
67
- "my_games": "マイゲーム",
68
- "play_button": "プレイ する",
69
- "top_ranking": "トップ {{number}}",
70
- "rewards_one": "報酬",
71
- "rewards_other": "報酬"
72
- },
73
- }
74
- },
75
- ko: {
76
- translation: {
77
- "dashboard": {
78
- "suggested_offers": "추천 제안",
79
- "more_offers": "더 많은 제안",
80
- "my_games": "내 게임",
81
- "play_button": "플레이 하고",
82
- "top_ranking": "상위 {{number}}",
83
- "rewards_one": "보상",
84
- "rewards_other": "보상들"
85
- },
86
- }
87
- }
88
- };
89
-
90
- const initializeI18n = async () => {
91
- try {
92
- const language:any = await AsyncStorage.getItem('language');
93
- const storedLanguage: string = JSON.parse(language);
94
- console.log('storedLanguage', storedLanguage);
95
-
96
- const initialLanguage = storedLanguage;
97
- await i18n
98
- .use(initReactI18next)
99
- .init({
100
- resources,
101
- fallbackLng: 'en',
102
- lng: initialLanguage,
103
- debug: __DEV__,
104
- interpolation: {
105
- escapeValue: false,
106
- },
107
- });
108
- } catch (error) {
109
- console.error('Error initializing i18n:', error);
110
- }
111
- };
112
-
113
- initializeI18n();
114
-
1
+ import i18n from 'i18next';
2
+ import { initReactI18next } from 'react-i18next';
3
+ import AsyncStorage from '@react-native-async-storage/async-storage';
4
+
5
+
6
+ const resources = {
7
+ en: {
8
+ translation: {
9
+ "dashboard": {
10
+ "suggested_offers": "Suggested Offers",
11
+ "more_offers": "More Offers",
12
+ "my_games": "My Games",
13
+ "play_button": "Play Now",
14
+ "top_ranking": "Top {{number}}",
15
+ "rewards_one": "Reward",
16
+ "rewards_other": "Rewards"
17
+ },
18
+
19
+
20
+ }
21
+ },
22
+ es: {
23
+ translation: {
24
+ "dashboard": {
25
+ "suggested_offers": "Ofertas sugeridas",
26
+ "more_offers": "Más ofertas",
27
+ "my_games": "Mis juegos",
28
+ "play_button": "Jugar Ahora",
29
+ "top_ranking": "Los mejores {{number}}",
30
+ "rewards_one": "Recompensa",
31
+ "rewards_other": "Recompensas"
32
+ },
33
+
34
+ }
35
+ },
36
+ id: {
37
+ translation: {
38
+ "dashboard": {
39
+ "suggested_offers": "Penawaran yang Disarankan",
40
+ "more_offers": "Penawaran Lainnya",
41
+ "my_games": "Permainan Saya",
42
+ "play_button": "Mainkan Sekarang",
43
+ "top_ranking": "Top {{number}}",
44
+ "rewards_one": "Hadiah",
45
+ "rewards_other": "Hadiah"
46
+ },
47
+ }
48
+ },
49
+ in: {
50
+ translation: {
51
+ "dashboard": {
52
+ "suggested_offers": "Penawaran yang Disarankan",
53
+ "more_offers": "Penawaran Lainnya",
54
+ "my_games": "Permainan Saya",
55
+ "play_button": "Mainkan Sekarang",
56
+ "top_ranking": "Top {{number}}",
57
+ "rewards_one": "Hadiah",
58
+ "rewards_other": "Hadiah"
59
+ },
60
+ }
61
+ },
62
+ ja: {
63
+ translation: {
64
+ "dashboard": {
65
+ "suggested_offers": "おすすめのオファー",
66
+ "more_offers": "その他のオファー",
67
+ "my_games": "マイゲーム",
68
+ "play_button": "プレイ する",
69
+ "top_ranking": "トップ {{number}}",
70
+ "rewards_one": "報酬",
71
+ "rewards_other": "報酬"
72
+ },
73
+ }
74
+ },
75
+ ko: {
76
+ translation: {
77
+ "dashboard": {
78
+ "suggested_offers": "추천 제안",
79
+ "more_offers": "더 많은 제안",
80
+ "my_games": "내 게임",
81
+ "play_button": "플레이 하고",
82
+ "top_ranking": "상위 {{number}}",
83
+ "rewards_one": "보상",
84
+ "rewards_other": "보상들"
85
+ },
86
+ }
87
+ }
88
+ };
89
+
90
+ const initializeI18n = async () => {
91
+ try {
92
+ const language:any = await AsyncStorage.getItem('language');
93
+ const storedLanguage: string = JSON.parse(language);
94
+ console.log('storedLanguage', storedLanguage);
95
+
96
+ const initialLanguage = storedLanguage;
97
+ await i18n
98
+ .use(initReactI18next)
99
+ .init({
100
+ resources,
101
+ fallbackLng: 'en',
102
+ lng: initialLanguage,
103
+ debug: __DEV__,
104
+ interpolation: {
105
+ escapeValue: false,
106
+ },
107
+ });
108
+ } catch (error) {
109
+ console.error('Error initializing i18n:', error);
110
+ }
111
+ };
112
+
113
+ initializeI18n();
114
+
115
115
  export default i18n;