@tyrads.com/tyrads-sdk 3.1.0-beta.0 → 3.2.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.
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/tyradssdk/TyradsSdkModule.kt +130 -46
- package/ios/Tyrads/AcmoAssets.swift +14 -0
- package/ios/Tyrads/ApiHeaders.swift +1 -0
- package/ios/Tyrads/Tyrads.swift +184 -57
- package/ios/Tyrads/WebViewController.swift +27 -3
- package/ios/Tyrads/core/utils/AcmoKeyNames.swift +29 -0
- package/ios/Tyrads/core/utils/ColorExtension.swift +55 -0
- package/ios/Tyrads/core/utils/Services/LocalizationService.swift +175 -0
- package/ios/Tyrads/helpers/device_details.swift +148 -46
- package/ios/Tyrads/legal/AcmoPrivacyPage.swift +353 -0
- package/ios/Tyrads/legal/PrivacyPageController.swift +31 -0
- package/ios/Tyrads/user/AcmoUserUpdatePage.swift +302 -0
- package/ios/Tyrads/user/AcmoUsersUpdateController.swift +26 -0
- package/ios/Tyrads/user/Repository.swift +89 -0
- package/ios/TyradsSdk.mm +15 -3
- package/ios/TyradsSdk.swift +101 -46
- package/lib/commonjs/acmo/core/helpers/native_methods.js +37 -0
- package/lib/commonjs/acmo/core/helpers/native_methods.js.map +1 -0
- package/lib/commonjs/acmo/core/helpers/numeral.js +19 -0
- package/lib/commonjs/acmo/core/helpers/numeral.js.map +1 -0
- package/lib/commonjs/acmo/core/services/localization_service.js +164 -0
- package/lib/commonjs/acmo/core/services/localization_service.js.map +1 -0
- package/lib/commonjs/acmo/core/storage/storage.js +15 -1
- package/lib/commonjs/acmo/core/storage/storage.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js +5 -2
- package/lib/commonjs/acmo/modules/dashboard/components/active_offers_button.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js +1 -2
- package/lib/commonjs/acmo/modules/dashboard/components/custom_scroller.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js +1 -2
- package/lib/commonjs/acmo/modules/dashboard/components/custom_shimmer.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js +4 -6
- package/lib/commonjs/acmo/modules/dashboard/components/offer_card.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js +14 -9
- package/lib/commonjs/acmo/modules/dashboard/components/offer_list_item.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js +6 -2
- package/lib/commonjs/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js +4 -4
- package/lib/commonjs/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js +4 -11
- package/lib/commonjs/acmo/modules/dashboard/components/premium_loading.js.map +1 -1
- package/lib/commonjs/acmo/modules/dashboard/repository.js +1 -1
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js +16 -2
- package/lib/commonjs/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/commonjs/acmo/modules/localization/localization_context.js +55 -0
- package/lib/commonjs/acmo/modules/localization/localization_context.js.map +1 -0
- package/lib/commonjs/index.js +38 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/acmo/core/helpers/native_methods.js +33 -0
- package/lib/module/acmo/core/helpers/native_methods.js.map +1 -0
- package/lib/module/acmo/core/helpers/numeral.js +14 -0
- package/lib/module/acmo/core/helpers/numeral.js.map +1 -0
- package/lib/module/acmo/core/services/localization_service.js +159 -0
- package/lib/module/acmo/core/services/localization_service.js.map +1 -0
- package/lib/module/acmo/core/storage/storage.js +13 -0
- package/lib/module/acmo/core/storage/storage.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/active_offers_button.js +5 -2
- package/lib/module/acmo/modules/dashboard/components/active_offers_button.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/offer_card.js +3 -3
- package/lib/module/acmo/modules/dashboard/components/offer_card.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js +14 -9
- package/lib/module/acmo/modules/dashboard/components/offer_list_item.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js +6 -2
- package/lib/module/acmo/modules/dashboard/components/premium_empty_widget.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_header.js +4 -4
- package/lib/module/acmo/modules/dashboard/components/premium_header.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/components/premium_loading.js +5 -12
- package/lib/module/acmo/modules/dashboard/components/premium_loading.js.map +1 -1
- package/lib/module/acmo/modules/dashboard/repository.js +1 -1
- package/lib/module/acmo/modules/dashboard/top_offers.js +15 -0
- package/lib/module/acmo/modules/dashboard/top_offers.js.map +1 -1
- package/lib/module/acmo/modules/localization/localization_context.js +45 -0
- package/lib/module/acmo/modules/localization/localization_context.js.map +1 -0
- package/lib/module/index.js +38 -6
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts +6 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts +2 -0
- package/lib/typescript/commonjs/src/acmo/core/helpers/numeral.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts +18 -0
- package/lib/typescript/commonjs/src/acmo/core/services/localization_service.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts +1 -0
- package/lib/typescript/commonjs/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts +0 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts +14 -0
- package/lib/typescript/commonjs/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts +6 -0
- package/lib/typescript/module/src/acmo/core/helpers/native_methods.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts +2 -0
- package/lib/typescript/module/src/acmo/core/helpers/numeral.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts +18 -0
- package/lib/typescript/module/src/acmo/core/services/localization_service.d.ts.map +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts +1 -0
- package/lib/typescript/module/src/acmo/core/storage/storage.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/active_offers_button.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_card.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/offer_list_item.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_empty_widget.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_header.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts +0 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/components/premium_loading.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/repository.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/dashboard/top_offers.d.ts.map +1 -1
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts +14 -0
- package/lib/typescript/module/src/acmo/modules/localization/localization_context.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +7 -10
- package/src/acmo/core/helpers/native_methods.ts +43 -0
- package/src/acmo/core/helpers/numeral.ts +14 -0
- package/src/acmo/core/services/localization_service.ts +200 -0
- package/src/acmo/core/storage/storage.ts +14 -0
- package/src/acmo/modules/dashboard/components/active_offers_button.tsx +3 -2
- package/src/acmo/modules/dashboard/components/offer_card.tsx +3 -3
- package/src/acmo/modules/dashboard/components/offer_list_item.tsx +9 -7
- package/src/acmo/modules/dashboard/components/premium_empty_widget.tsx +5 -2
- package/src/acmo/modules/dashboard/components/premium_header.tsx +6 -5
- package/src/acmo/modules/dashboard/components/premium_loading.tsx +2 -8
- package/src/acmo/modules/dashboard/repository.ts +1 -1
- package/src/acmo/modules/dashboard/top_offers.tsx +18 -3
- package/src/acmo/modules/localization/localization_context.tsx +52 -0
- package/src/index.tsx +63 -18
- package/lib/commonjs/i18n.js +0 -112
- package/lib/commonjs/i18n.js.map +0 -1
- package/lib/module/i18n.js +0 -107
- package/lib/module/i18n.js.map +0 -1
- package/lib/typescript/commonjs/src/i18n.d.ts +0 -3
- package/lib/typescript/commonjs/src/i18n.d.ts.map +0 -1
- package/lib/typescript/module/src/i18n.d.ts +0 -3
- package/lib/typescript/module/src/i18n.d.ts.map +0 -1
- package/src/i18n.ts +0 -115
package/src/index.tsx
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
import { NativeModules, Platform, View,} from 'react-native';
|
1
|
+
import { NativeEventEmitter, NativeModules, Platform, View, } from 'react-native';
|
2
2
|
|
3
3
|
import TopOffers, { PremiumWidgetStyles } from './acmo/modules/dashboard/top_offers';
|
4
4
|
import { saveData } from './acmo/core/storage/storage';
|
5
|
-
import
|
6
|
-
import
|
5
|
+
import Localization from './acmo/core/services/localization_service';
|
6
|
+
import { changeProviderLanguage, LocalizationProvider, updateProviderLanguage } from './acmo/modules/localization/localization_context';
|
7
|
+
import PremiumWidgetsLoading from './acmo/modules/dashboard/components/premium_loading';
|
7
8
|
|
8
9
|
// const TyradsSdkComposeView = requireNativeComponent('TyradsSdkComposeView');
|
9
10
|
|
@@ -17,23 +18,54 @@ const LINKING_ERROR =
|
|
17
18
|
const TyradsSdk = NativeModules.TyradsSdk
|
18
19
|
? NativeModules.TyradsSdk
|
19
20
|
: new Proxy(
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
{},
|
22
|
+
{
|
23
|
+
get() {
|
24
|
+
throw new Error(LINKING_ERROR);
|
25
|
+
},
|
26
|
+
}
|
27
|
+
);
|
28
|
+
|
29
|
+
const tyradsEmitter = new NativeEventEmitter(TyradsSdk);
|
30
|
+
|
31
|
+
let languageChangedSubscription: any = null;
|
27
32
|
|
28
33
|
const Tyrads = {
|
29
34
|
init: async (apiKey: string, apiSecret: string, encKey?: string) => {
|
30
35
|
const data = await TyradsSdk.init(apiKey, apiSecret, encKey);
|
36
|
+
|
37
|
+
await saveData("credentials", {
|
38
|
+
'X-API-Key': apiKey,
|
39
|
+
'X-API-Secret': apiSecret
|
40
|
+
});
|
41
|
+
|
42
|
+
let languageCode = "en";
|
43
|
+
try {
|
44
|
+
const parsed = typeof data === "string" ? JSON.parse(data) : data;
|
45
|
+
if (parsed?.languageCode) {
|
46
|
+
languageCode = parsed.languageCode;
|
47
|
+
}
|
48
|
+
} catch { }
|
49
|
+
|
50
|
+
TyradsSdk.startObserving();
|
51
|
+
languageChangedSubscription?.remove();
|
52
|
+
languageChangedSubscription = tyradsEmitter.addListener(
|
53
|
+
'LanguageChanged',
|
54
|
+
async (lang: string) => {
|
55
|
+
console.log('LanguageChanged event from Android SDK:', lang);
|
56
|
+
await changeProviderLanguage(lang);
|
57
|
+
}
|
58
|
+
);
|
59
|
+
|
60
|
+
await saveData("language", languageCode);
|
61
|
+
await Localization.getInstance().init(languageCode);
|
62
|
+
await updateProviderLanguage(languageCode);
|
63
|
+
|
31
64
|
return data;
|
32
65
|
},
|
33
66
|
loginUser: async (userId: string) => {
|
34
67
|
try {
|
35
68
|
const data = await TyradsSdk.loginUser(userId);
|
36
|
-
|
37
69
|
if (typeof data === "object") {
|
38
70
|
await saveData('apiHeaders', JSON.stringify(data));
|
39
71
|
await saveData('language', data.languageCode);
|
@@ -41,25 +73,24 @@ const Tyrads = {
|
|
41
73
|
await saveData('apiHeaders', data);
|
42
74
|
await saveData('language', JSON.parse(data).languageCode);
|
43
75
|
}
|
44
|
-
|
45
76
|
return data;
|
46
77
|
} catch (err) {
|
47
78
|
return null;
|
48
79
|
}
|
49
80
|
},
|
50
|
-
|
81
|
+
|
51
82
|
showOffers: async ({
|
52
83
|
launchMode = 3,
|
53
84
|
route,
|
54
85
|
campaignID,
|
55
86
|
}: { launchMode?: number; route?: string; campaignID?: number | null } = {}) => {
|
56
87
|
if (Platform.OS === 'ios') {
|
57
|
-
if(campaignID == null) {
|
88
|
+
if (campaignID == null) {
|
58
89
|
return await TyradsSdk.showOffers(launchMode, route);
|
59
90
|
}
|
60
91
|
return await TyradsSdk.showOfferDetails(launchMode, route, campaignID);
|
61
92
|
} else {
|
62
|
-
if(campaignID == null) {
|
93
|
+
if (campaignID == null) {
|
63
94
|
return await TyradsSdk.showOffers(route);
|
64
95
|
}
|
65
96
|
return await TyradsSdk.showOfferDetails(route, campaignID);
|
@@ -73,19 +104,33 @@ const Tyrads = {
|
|
73
104
|
launchMode?: number;
|
74
105
|
} = {}) => {
|
75
106
|
const handleNavigation = (route?: string, campaignID?: number | null) => {
|
76
|
-
Tyrads.showOffers({ route: route, campaignID: campaignID, launchMode: launchMode});
|
107
|
+
Tyrads.showOffers({ route: route, campaignID: campaignID, launchMode: launchMode });
|
77
108
|
};
|
78
109
|
return (
|
79
|
-
<
|
110
|
+
<LocalizationProvider>
|
80
111
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
81
112
|
<TopOffers
|
82
113
|
widgetStyle={widgetStyle}
|
83
114
|
onNavigate={handleNavigation}
|
84
115
|
/>
|
85
116
|
</View>
|
86
|
-
</
|
117
|
+
</LocalizationProvider>
|
87
118
|
);
|
88
119
|
},
|
120
|
+
topPremiumOffersLoading: (
|
121
|
+
{ widgetStyle = PremiumWidgetStyles.list }: {
|
122
|
+
widgetStyle?: PremiumWidgetStyles;
|
123
|
+
}
|
124
|
+
) => {
|
125
|
+
return (
|
126
|
+
<PremiumWidgetsLoading
|
127
|
+
widgetStyle={widgetStyle}
|
128
|
+
/>
|
129
|
+
);
|
130
|
+
},
|
131
|
+
changeLanguage: async (lang: string) => {
|
132
|
+
return await TyradsSdk.changeLanguage(lang);
|
133
|
+
},
|
89
134
|
};
|
90
135
|
|
91
136
|
export default Tyrads;
|
package/lib/commonjs/i18n.js
DELETED
@@ -1,112 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
var _i18next = _interopRequireDefault(require("i18next"));
|
8
|
-
var _reactI18next = require("react-i18next");
|
9
|
-
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
|
-
const resources = {
|
12
|
-
en: {
|
13
|
-
translation: {
|
14
|
-
"dashboard": {
|
15
|
-
"suggested_offers": "Suggested Offers",
|
16
|
-
"more_offers": "More Offers",
|
17
|
-
"my_games": "My Games",
|
18
|
-
"play_button": "Play Now",
|
19
|
-
"top_ranking": "Top {{number}}",
|
20
|
-
"rewards_one": "Reward",
|
21
|
-
"rewards_other": "Rewards"
|
22
|
-
}
|
23
|
-
}
|
24
|
-
},
|
25
|
-
es: {
|
26
|
-
translation: {
|
27
|
-
"dashboard": {
|
28
|
-
"suggested_offers": "Ofertas sugeridas",
|
29
|
-
"more_offers": "Más ofertas",
|
30
|
-
"my_games": "Mis juegos",
|
31
|
-
"play_button": "Jugar Ahora",
|
32
|
-
"top_ranking": "Los mejores {{number}}",
|
33
|
-
"rewards_one": "Recompensa",
|
34
|
-
"rewards_other": "Recompensas"
|
35
|
-
}
|
36
|
-
}
|
37
|
-
},
|
38
|
-
id: {
|
39
|
-
translation: {
|
40
|
-
"dashboard": {
|
41
|
-
"suggested_offers": "Penawaran yang Disarankan",
|
42
|
-
"more_offers": "Penawaran Lainnya",
|
43
|
-
"my_games": "Permainan Saya",
|
44
|
-
"play_button": "Mainkan Sekarang",
|
45
|
-
"top_ranking": "Top {{number}}",
|
46
|
-
"rewards_one": "Hadiah",
|
47
|
-
"rewards_other": "Hadiah"
|
48
|
-
}
|
49
|
-
}
|
50
|
-
},
|
51
|
-
in: {
|
52
|
-
translation: {
|
53
|
-
"dashboard": {
|
54
|
-
"suggested_offers": "Penawaran yang Disarankan",
|
55
|
-
"more_offers": "Penawaran Lainnya",
|
56
|
-
"my_games": "Permainan Saya",
|
57
|
-
"play_button": "Mainkan Sekarang",
|
58
|
-
"top_ranking": "Top {{number}}",
|
59
|
-
"rewards_one": "Hadiah",
|
60
|
-
"rewards_other": "Hadiah"
|
61
|
-
}
|
62
|
-
}
|
63
|
-
},
|
64
|
-
ja: {
|
65
|
-
translation: {
|
66
|
-
"dashboard": {
|
67
|
-
"suggested_offers": "おすすめのオファー",
|
68
|
-
"more_offers": "その他のオファー",
|
69
|
-
"my_games": "マイゲーム",
|
70
|
-
"play_button": "プレイ する",
|
71
|
-
"top_ranking": "トップ {{number}}",
|
72
|
-
"rewards_one": "報酬",
|
73
|
-
"rewards_other": "報酬"
|
74
|
-
}
|
75
|
-
}
|
76
|
-
},
|
77
|
-
ko: {
|
78
|
-
translation: {
|
79
|
-
"dashboard": {
|
80
|
-
"suggested_offers": "추천 제안",
|
81
|
-
"more_offers": "더 많은 제안",
|
82
|
-
"my_games": "내 게임",
|
83
|
-
"play_button": "플레이 하고",
|
84
|
-
"top_ranking": "상위 {{number}}",
|
85
|
-
"rewards_one": "보상",
|
86
|
-
"rewards_other": "보상들"
|
87
|
-
}
|
88
|
-
}
|
89
|
-
}
|
90
|
-
};
|
91
|
-
const initializeI18n = async () => {
|
92
|
-
try {
|
93
|
-
const language = await _asyncStorage.default.getItem('language');
|
94
|
-
const storedLanguage = JSON.parse(language);
|
95
|
-
console.log('storedLanguage', storedLanguage);
|
96
|
-
const initialLanguage = storedLanguage;
|
97
|
-
await _i18next.default.use(_reactI18next.initReactI18next).init({
|
98
|
-
resources,
|
99
|
-
fallbackLng: 'en',
|
100
|
-
lng: initialLanguage,
|
101
|
-
debug: __DEV__,
|
102
|
-
interpolation: {
|
103
|
-
escapeValue: false
|
104
|
-
}
|
105
|
-
});
|
106
|
-
} catch (error) {
|
107
|
-
console.error('Error initializing i18n:', error);
|
108
|
-
}
|
109
|
-
};
|
110
|
-
initializeI18n();
|
111
|
-
var _default = exports.default = _i18next.default;
|
112
|
-
//# sourceMappingURL=i18n.js.map
|
package/lib/commonjs/i18n.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["_i18next","_interopRequireDefault","require","_reactI18next","_asyncStorage","e","__esModule","default","resources","en","translation","es","id","in","ja","ko","initializeI18n","language","AsyncStorage","getItem","storedLanguage","JSON","parse","console","log","initialLanguage","i18n","use","initReactI18next","init","fallbackLng","lng","debug","__DEV__","interpolation","escapeValue","error","_default","exports"],"sourceRoot":"../../src","sources":["i18n.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAH,sBAAA,C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
|
-
import { initReactI18next } from 'react-i18next';
|
5
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
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
|
-
es: {
|
21
|
-
translation: {
|
22
|
-
"dashboard": {
|
23
|
-
"suggested_offers": "Ofertas sugeridas",
|
24
|
-
"more_offers": "Más ofertas",
|
25
|
-
"my_games": "Mis juegos",
|
26
|
-
"play_button": "Jugar Ahora",
|
27
|
-
"top_ranking": "Los mejores {{number}}",
|
28
|
-
"rewards_one": "Recompensa",
|
29
|
-
"rewards_other": "Recompensas"
|
30
|
-
}
|
31
|
-
}
|
32
|
-
},
|
33
|
-
id: {
|
34
|
-
translation: {
|
35
|
-
"dashboard": {
|
36
|
-
"suggested_offers": "Penawaran yang Disarankan",
|
37
|
-
"more_offers": "Penawaran Lainnya",
|
38
|
-
"my_games": "Permainan Saya",
|
39
|
-
"play_button": "Mainkan Sekarang",
|
40
|
-
"top_ranking": "Top {{number}}",
|
41
|
-
"rewards_one": "Hadiah",
|
42
|
-
"rewards_other": "Hadiah"
|
43
|
-
}
|
44
|
-
}
|
45
|
-
},
|
46
|
-
in: {
|
47
|
-
translation: {
|
48
|
-
"dashboard": {
|
49
|
-
"suggested_offers": "Penawaran yang Disarankan",
|
50
|
-
"more_offers": "Penawaran Lainnya",
|
51
|
-
"my_games": "Permainan Saya",
|
52
|
-
"play_button": "Mainkan Sekarang",
|
53
|
-
"top_ranking": "Top {{number}}",
|
54
|
-
"rewards_one": "Hadiah",
|
55
|
-
"rewards_other": "Hadiah"
|
56
|
-
}
|
57
|
-
}
|
58
|
-
},
|
59
|
-
ja: {
|
60
|
-
translation: {
|
61
|
-
"dashboard": {
|
62
|
-
"suggested_offers": "おすすめのオファー",
|
63
|
-
"more_offers": "その他のオファー",
|
64
|
-
"my_games": "マイゲーム",
|
65
|
-
"play_button": "プレイ する",
|
66
|
-
"top_ranking": "トップ {{number}}",
|
67
|
-
"rewards_one": "報酬",
|
68
|
-
"rewards_other": "報酬"
|
69
|
-
}
|
70
|
-
}
|
71
|
-
},
|
72
|
-
ko: {
|
73
|
-
translation: {
|
74
|
-
"dashboard": {
|
75
|
-
"suggested_offers": "추천 제안",
|
76
|
-
"more_offers": "더 많은 제안",
|
77
|
-
"my_games": "내 게임",
|
78
|
-
"play_button": "플레이 하고",
|
79
|
-
"top_ranking": "상위 {{number}}",
|
80
|
-
"rewards_one": "보상",
|
81
|
-
"rewards_other": "보상들"
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
};
|
86
|
-
const initializeI18n = async () => {
|
87
|
-
try {
|
88
|
-
const language = await AsyncStorage.getItem('language');
|
89
|
-
const storedLanguage = JSON.parse(language);
|
90
|
-
console.log('storedLanguage', storedLanguage);
|
91
|
-
const initialLanguage = storedLanguage;
|
92
|
-
await i18n.use(initReactI18next).init({
|
93
|
-
resources,
|
94
|
-
fallbackLng: 'en',
|
95
|
-
lng: initialLanguage,
|
96
|
-
debug: __DEV__,
|
97
|
-
interpolation: {
|
98
|
-
escapeValue: false
|
99
|
-
}
|
100
|
-
});
|
101
|
-
} catch (error) {
|
102
|
-
console.error('Error initializing i18n:', error);
|
103
|
-
}
|
104
|
-
};
|
105
|
-
initializeI18n();
|
106
|
-
export default i18n;
|
107
|
-
//# sourceMappingURL=i18n.js.map
|
package/lib/module/i18n.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["i18n","initReactI18next","AsyncStorage","resources","en","translation","es","id","in","ja","ko","initializeI18n","language","getItem","storedLanguage","JSON","parse","console","log","initialLanguage","use","init","fallbackLng","lng","debug","__DEV__","interpolation","escapeValue","error"],"sourceRoot":"../../src","sources":["i18n.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,SAAS;AAC1B,SAASC,gBAAgB,QAAQ,eAAe;AAChD,OAAOC,YAAY,MAAM,2CAA2C;AAGpE,MAAMC,SAAS,GAAG;EAChBC,EAAE,EAAE;IACFC,WAAW,EAAE;MACX,WAAW,EAAE;QACX,kBAAkB,EAAE,kBAAkB;QACtC,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,UAAU;QACtB,aAAa,EAAE,UAAU;QACzB,aAAa,EAAE,gBAAgB;QAC/B,aAAa,EAAE,QAAQ;QACvB,eAAe,EAAE;MACnB;IAGF;EACF,CAAC;EACDC,EAAE,EAAE;IACFD,WAAW,EAAE;MACX,WAAW,EAAE;QACX,kBAAkB,EAAE,mBAAmB;QACvC,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,YAAY;QACxB,aAAa,EAAE,aAAa;QAC5B,aAAa,EAAE,wBAAwB;QACvC,aAAa,EAAE,YAAY;QAC3B,eAAe,EAAE;MACnB;IAEF;EACF,CAAC;EACDE,EAAE,EAAE;IACFF,WAAW,EAAE;MACX,WAAW,EAAE;QACX,kBAAkB,EAAE,2BAA2B;QAC/C,aAAa,EAAE,mBAAmB;QAClC,UAAU,EAAE,gBAAgB;QAC5B,aAAa,EAAE,kBAAkB;QACjC,aAAa,EAAE,gBAAgB;QAC/B,aAAa,EAAE,QAAQ;QACvB,eAAe,EAAE;MACnB;IACF;EACF,CAAC;EACDG,EAAE,EAAE;IACFH,WAAW,EAAE;MACX,WAAW,EAAE;QACX,kBAAkB,EAAE,2BAA2B;QAC/C,aAAa,EAAE,mBAAmB;QAClC,UAAU,EAAE,gBAAgB;QAC5B,aAAa,EAAE,kBAAkB;QACjC,aAAa,EAAE,gBAAgB;QAC/B,aAAa,EAAE,QAAQ;QACvB,eAAe,EAAE;MACnB;IACF;EACF,CAAC;EACDI,EAAE,EAAE;IACF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ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAkH3B,eAAe,IAAI,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AAkH3B,eAAe,IAAI,CAAC"}
|
package/src/i18n.ts
DELETED
@@ -1,115 +0,0 @@
|
|
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
|
-
export default i18n;
|