@accelbyte/error-translator 0.1.1-alpha.55
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/CHANGELOG.md +7 -0
- package/dist/index.es.js +437 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +463 -0
- package/dist/index.js.map +1 -0
- package/dist/types/error-translation-map/augments-admin-error-translation-map.d.ts +3 -0
- package/dist/types/error-translation-map/basic-admin-error-translation-map.d.ts +19 -0
- package/dist/types/error-translation-map/basic-error-translation-map.d.ts +14 -0
- package/dist/types/error-translation-map/common-admin-error-translation-map.d.ts +7 -0
- package/dist/types/error-translation-map/common-error-translation-map.d.ts +7 -0
- package/dist/types/error-translation-map/ecommerce-admin-error-translation-map.d.ts +18 -0
- package/dist/types/error-translation-map/ecommerce-error-translation-map.d.ts +13 -0
- package/dist/types/error-translation-map/gdpr-error-translation-map.d.ts +3 -0
- package/dist/types/error-translation-map/iam-admin-error-translation-map.d.ts +41 -0
- package/dist/types/error-translation-map/iam-error-translation-map.d.ts +26 -0
- package/dist/types/error-translation-map/legal-admin-error-translation-map.d.ts +4 -0
- package/dist/types/error-translation-map/lobby-and-matchmaking-admin-error-translation-map.d.ts +4 -0
- package/dist/types/error-translation-map/reportingmoderation-admin-error-translation-map.d.ts +3 -0
- package/dist/types/error-translation-map/rewards-admin-error-translation-map.d.ts +3 -0
- package/dist/types/error-translation-map/seasonpass-admin-error-translation-map.d.ts +21 -0
- package/dist/types/error-translation-map/statistic-admin-error-translation-map.d.ts +13 -0
- package/dist/types/error-translation-map/ugc-admin-error-translation-map.d.ts +6 -0
- package/dist/types/i18n.d.ts +4 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/service-error-translator.d.ts +15 -0
- package/package.json +38 -0
- package/rollup.config.mjs +73 -0
- package/scripts/i18nbuilder.js +144 -0
- package/src/README.md +41 -0
- package/src/config.json +13 -0
- package/src/error-translation-map/augments-admin-error-translation-map.tsx +12 -0
- package/src/error-translation-map/basic-admin-error-translation-map.tsx +30 -0
- package/src/error-translation-map/basic-error-translation-map.tsx +47 -0
- package/src/error-translation-map/common-admin-error-translation-map.tsx +16 -0
- package/src/error-translation-map/common-error-translation-map.tsx +16 -0
- package/src/error-translation-map/ecommerce-admin-error-translation-map.tsx +37 -0
- package/src/error-translation-map/ecommerce-error-translation-map.tsx +22 -0
- package/src/error-translation-map/gdpr-error-translation-map.tsx +16 -0
- package/src/error-translation-map/iam-admin-error-translation-map.tsx +64 -0
- package/src/error-translation-map/iam-error-translation-map.tsx +53 -0
- package/src/error-translation-map/legal-admin-error-translation-map.tsx +13 -0
- package/src/error-translation-map/lobby-and-matchmaking-admin-error-translation-map.tsx +13 -0
- package/src/error-translation-map/reportingmoderation-admin-error-translation-map.tsx +12 -0
- package/src/error-translation-map/rewards-admin-error-translation-map.tsx +12 -0
- package/src/error-translation-map/seasonpass-admin-error-translation-map.tsx +34 -0
- package/src/error-translation-map/statistic-admin-error-translation-map.tsx +22 -0
- package/src/error-translation-map/ugc-admin-error-translation-map.tsx +15 -0
- package/src/i18n.ts +83 -0
- package/src/index.ts +7 -0
- package/src/service-error-translator.tsx +107 -0
- package/src/translations/de-DE.json +37 -0
- package/src/translations/en-US.json +162 -0
- package/src/translations/es-ES.json +37 -0
- package/src/translations/fr-FR.json +37 -0
- package/src/translations/it-IT.json +37 -0
- package/src/translations/ja-JP.json +37 -0
- package/src/translations/zh-CN.json +162 -0
- package/tsconfig.build.json +17 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const BasicErrorTranslationMap = {
|
|
11
|
+
11233: (
|
|
12
|
+
<Trans i18nKey="serviceError.11233">
|
|
13
|
+
Error: Country group does not exist. If you see this error, please contact our support team for immediate assistance
|
|
14
|
+
</Trans>
|
|
15
|
+
),
|
|
16
|
+
11337: (
|
|
17
|
+
<Trans i18nKey="serviceError.11337">
|
|
18
|
+
Error: User profile does not exist. If you see this error, please contact our support team for immediate assistance
|
|
19
|
+
</Trans>
|
|
20
|
+
),
|
|
21
|
+
11440: (
|
|
22
|
+
<Trans i18nKey="serviceError.11440">
|
|
23
|
+
Error: User profile does not exist. If you see this error, please contact our support team for immediate assistance
|
|
24
|
+
</Trans>
|
|
25
|
+
),
|
|
26
|
+
11441: (
|
|
27
|
+
<Trans i18nKey="serviceError.11441">
|
|
28
|
+
Error: User profile is already exist. If you see this error, please contact our support team for immediate assistance
|
|
29
|
+
</Trans>
|
|
30
|
+
),
|
|
31
|
+
11132: <Trans i18nKey="serviceError.11132">You've reached the maximum upload limit.</Trans>,
|
|
32
|
+
20000: <Trans i18nKey="serviceError.20000">Something went wrong. For more information please contact our support team</Trans>,
|
|
33
|
+
20001: <Trans i18nKey="serviceError.20001">Sorry, the page you want to access is publicly unavailable.</Trans>,
|
|
34
|
+
20002: <Trans i18nKey="serviceError.20002">Please correct the errors in the form to proceed</Trans>,
|
|
35
|
+
20008: (
|
|
36
|
+
<Trans i18nKey="serviceError.20008">
|
|
37
|
+
Error: User does not exist. If you see this error, please contact our support team for immediate assistance
|
|
38
|
+
</Trans>
|
|
39
|
+
),
|
|
40
|
+
20013: <Trans i18nKey="serviceError.20013">Sorry, you have no permission to do this action or access this page</Trans>,
|
|
41
|
+
20017: (
|
|
42
|
+
<Trans i18nKey="serviceError.20017">
|
|
43
|
+
Oops, it seems you haven't play the game yet. Please play the game before proceed with this action
|
|
44
|
+
</Trans>
|
|
45
|
+
),
|
|
46
|
+
20019: <Trans i18nKey="serviceError.20019">Something went wrong. For more information please contact our support team</Trans>
|
|
47
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const IAMAdminErrorTranslationMap = {
|
|
11
|
+
20002: <Trans i18nKey="adminServiceError.20002">Please correct the errors in the form to proceed</Trans>,
|
|
12
|
+
20019: <Trans i18nKey="adminServiceError.20019">Something went wrong. Please contact Administrator.</Trans>,
|
|
13
|
+
20001: <Trans i18nKey="adminServiceError.20001">Sorry, you are not authorized for selected action</Trans>,
|
|
14
|
+
20013: <Trans i18nKey="adminServiceError.20013">Sorry, you have no permission to do this action or access this page</Trans>,
|
|
15
|
+
20008: <Trans i18nKey="adminServiceError.20008">User does not exist</Trans>
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const IAMAdminErrorTranslationMap = {
|
|
11
|
+
20002: <Trans i18nKey="serviceError.20002">Please correct the errors in the form to proceed</Trans>,
|
|
12
|
+
20019: <Trans i18nKey="serviceError.20019">Something went wrong. For more information please contact our support team</Trans>,
|
|
13
|
+
20001: <Trans i18nKey="serviceError.20001">Sorry, the page you want to access is publicly unavailable.</Trans>,
|
|
14
|
+
20013: <Trans i18nKey="serviceError.20013">Sorry, you have no permission to do this action or access this page</Trans>,
|
|
15
|
+
20008: <Trans i18nKey="serviceError.20008">User does not exist</Trans>
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const EcommerceAdminErrorTranslationMap = {
|
|
11
|
+
30071: (
|
|
12
|
+
<Trans i18nKey="adminServiceError.30071">This item cannot be deselected while the associated bundle/option box is still selected</Trans>
|
|
13
|
+
),
|
|
14
|
+
30072: (
|
|
15
|
+
<Trans i18nKey="adminServiceError.30072">This category cannot be deselected while there are still items selected within it.</Trans>
|
|
16
|
+
),
|
|
17
|
+
30074: (
|
|
18
|
+
<Trans i18nKey="adminServiceError.30074">This item cannot be deselected while the associated subscription is still selected</Trans>
|
|
19
|
+
),
|
|
20
|
+
30075: <Trans i18nKey="adminServiceError.30075">This display cannot be deselected while the associated section is still selected</Trans>,
|
|
21
|
+
30141: <Trans i18nKey="adminServiceError.30141">The draft store does not exist or deleted in namespace</Trans>,
|
|
22
|
+
30326: <Trans i18nKey="adminServiceError.30326">Subscription item cannot be bundled</Trans>,
|
|
23
|
+
30327: <Trans i18nKey="adminServiceError.30327">Invalid item trial price</Trans>,
|
|
24
|
+
30374: <Trans i18nKey="adminServiceError.30374">SKU already exist. Please try again.</Trans>,
|
|
25
|
+
31178: <Trans i18nKey="adminServiceError.31178">Entitlement out of time range</Trans>,
|
|
26
|
+
33271: <Trans i18nKey="adminServiceError.33271">Payment configuration for the selected namespace and region already exists.</Trans>,
|
|
27
|
+
34042: (
|
|
28
|
+
<Trans i18nKey="adminServiceError.34042">
|
|
29
|
+
Failed to update reward condition. Please remove or change any inactive or deleted items.
|
|
30
|
+
</Trans>
|
|
31
|
+
),
|
|
32
|
+
37171: <Trans i18nKey="adminServiceError.37171">Code Redemption Name already exists. Try again.</Trans>,
|
|
33
|
+
37271: <Trans i18nKey="adminServiceError.37271">Key Group Name is already exists.</Trans>,
|
|
34
|
+
37221: <Trans i18nKey="adminServiceError.37221">Upload file failed. It's either empty or file extension is not acceptable</Trans>,
|
|
35
|
+
38122: <Trans i18nKey="adminServiceError.38122">Subscription end date required</Trans>,
|
|
36
|
+
40141: <Trans i18nKey="adminServiceError.40141">Subscription does not exist</Trans>
|
|
37
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const EcommerceErrorTranslationMap = {
|
|
11
|
+
38171: <Trans i18nKey="serviceError.38171">Sorry, you already own this item</Trans>,
|
|
12
|
+
30121: <Trans i18nKey="serviceError.30121">Failed to import store. Imported file is invalid. Please try again.</Trans>,
|
|
13
|
+
30122: <Trans i18nKey="serviceError.30122">Failed to publish store. Language/Region does not match. Please try again.</Trans>,
|
|
14
|
+
30171: <Trans i18nKey="serviceError.30171">Failed to update store. Language/Region does not match. Please try again.</Trans>,
|
|
15
|
+
30172: <Trans i18nKey="serviceError.30172">Failed to update store. Language/Region does not match. Please try again.</Trans>,
|
|
16
|
+
35121: <Trans i18nKey="serviceError.35121">The maximum amount per day has been exceeded.</Trans>,
|
|
17
|
+
35122: <Trans i18nKey="serviceError.35122">The maximum amount per transaction has been exceeded.</Trans>,
|
|
18
|
+
35125: <Trans i18nKey="serviceError.35125">The maximum balance amount has been exceeded.</Trans>,
|
|
19
|
+
31177: <Trans i18nKey="serviceError.31177">You cannot make this purchase because it includes one or more items you already own.</Trans>,
|
|
20
|
+
38121: <Trans i18nKey="serviceError.38121">You can only purchase 1 copy of this item.</Trans>,
|
|
21
|
+
31145: <Trans i18nKey="serviceError.31145">Sorry! The item you've selected doesn't exist in this Option Box.</Trans>
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2020. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const GDPRerrorTranslationMap = {
|
|
11
|
+
13122: (
|
|
12
|
+
<Trans i18nKey="serviceError.13122">
|
|
13
|
+
The password that you entered does not match. Please make sure you input the correct password
|
|
14
|
+
</Trans>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const IAMAdminErrorTranslationMap = {
|
|
11
|
+
10157: <Trans i18nKey="adminServiceError.10157">Role does not exist</Trans>,
|
|
12
|
+
20022: <Trans i18nKey="adminServiceError.20022">Something went wrong. You've sent an invalid request.</Trans>,
|
|
13
|
+
10156: <Trans i18nKey="adminServiceError.10156">Role does not exist</Trans>,
|
|
14
|
+
10130: <Trans i18nKey="adminServiceError.10130">Age does not meet the age restriction</Trans>,
|
|
15
|
+
10142: <Trans i18nKey="adminServiceError.10142">Sorry, your new password cannot be the same as the old one</Trans>,
|
|
16
|
+
10143: (
|
|
17
|
+
<Trans i18nKey="adminServiceError.10143">
|
|
18
|
+
The password that you entered does not match. Please make sure you input the correct password
|
|
19
|
+
</Trans>
|
|
20
|
+
),
|
|
21
|
+
10154: <Trans i18nKey="adminServiceError.10154">Country does not exist</Trans>,
|
|
22
|
+
10133: <Trans i18nKey="adminServiceError.10133">Email address is already taken</Trans>,
|
|
23
|
+
10139: <Trans i18nKey="adminServiceError.10139">Platform account does not exist</Trans>,
|
|
24
|
+
10158: <Trans i18nKey="adminServiceError.10158">Ban does not exist</Trans>,
|
|
25
|
+
10145: <Trans i18nKey="adminServiceError.10145">Only Publisher Admin can perform this action</Trans>,
|
|
26
|
+
10159: <Trans i18nKey="adminServiceError.10159">Only Role Manager can perform this action</Trans>,
|
|
27
|
+
10160: <Trans i18nKey="adminServiceError.10160">User already has the role</Trans>,
|
|
28
|
+
10161: <Trans i18nKey="adminServiceError.10161">User is already registered as role member</Trans>,
|
|
29
|
+
10153: <Trans i18nKey="adminServiceError.10153">User already exists</Trans>,
|
|
30
|
+
10152: <Trans i18nKey="adminServiceError.10152">Something went wrong. Please contact Administrator.</Trans>,
|
|
31
|
+
10137: <Trans i18nKey="adminServiceError.10137">Verification code is expired</Trans>,
|
|
32
|
+
// tslint:disable-next-line:max-line-length
|
|
33
|
+
10136: (
|
|
34
|
+
<Trans i18nKey="adminServiceError.10136">Sorry, you've entered the codes incorrectly too many times. Please request a new one</Trans>
|
|
35
|
+
),
|
|
36
|
+
10138: <Trans i18nKey="adminServiceError.10138">Verification code does not match</Trans>,
|
|
37
|
+
10170: <Trans i18nKey="adminServiceError.10170">User already has platform account</Trans>,
|
|
38
|
+
10140: <Trans i18nKey="adminServiceError.10140">User is already verified</Trans>,
|
|
39
|
+
10169: <Trans i18nKey="adminServiceError.10169">Age restriction does not exist</Trans>,
|
|
40
|
+
10171: <Trans i18nKey="adminServiceError.10171">Email address is not registered</Trans>,
|
|
41
|
+
10177: <Trans i18nKey="adminServiceError.10177">Username is already taken. Please try something different.</Trans>,
|
|
42
|
+
// tslint:disable-next-line:max-line-length
|
|
43
|
+
10190: (
|
|
44
|
+
<Trans i18nKey="adminServiceError.10190">
|
|
45
|
+
QR Code expired. Please reload the page and repeat the process to enable the authenticator app.
|
|
46
|
+
</Trans>
|
|
47
|
+
),
|
|
48
|
+
20007: <Trans i18nKey="adminServiceError.20007">You have requested too many codes. Please try again later.</Trans>,
|
|
49
|
+
10365: <Trans i18nKey="adminServiceError.10365">Client does not exist</Trans>,
|
|
50
|
+
10364: <Trans i18nKey="adminServiceError.10364">Client already exists</Trans>,
|
|
51
|
+
10456: <Trans i18nKey="adminServiceError.10456">Role does not exist</Trans>,
|
|
52
|
+
10467: <Trans i18nKey="adminServiceError.10467">Admin role must have at least 1 role manager</Trans>,
|
|
53
|
+
10468: <Trans i18nKey="adminServiceError.10468">User already registered as role manager</Trans>,
|
|
54
|
+
10457: <Trans i18nKey="adminServiceError.10457">Failed to add role member, the role is not an admin role</Trans>,
|
|
55
|
+
10459: <Trans i18nKey="adminServiceError.10459">Only Role Manager can perform this action</Trans>,
|
|
56
|
+
10469: <Trans i18nKey="adminServiceError.10469">User already registered as role member</Trans>,
|
|
57
|
+
10148: <Trans i18nKey="adminServiceError.10148">Something went wrong. Please contact Administrator.</Trans>,
|
|
58
|
+
10149: <Trans i18nKey="adminServiceError.10149">Something went wrong. Please contact Administrator.</Trans>,
|
|
59
|
+
11621: <Trans i18nKey="adminServiceError.11621">API Key is invalid. Please try again with the correct one.</Trans>,
|
|
60
|
+
|
|
61
|
+
// still orange in sheet, undecided
|
|
62
|
+
10146: <Trans i18nKey="adminServiceError.10146">user id not match</Trans>,
|
|
63
|
+
10466: <Trans i18nKey="adminServiceError.10466">invalid role members</Trans>
|
|
64
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const IAMErrorTranslationMap = {
|
|
11
|
+
10130: <Trans i18nKey="serviceError.10130">Sorry, we are unable to process this request</Trans>,
|
|
12
|
+
10142: <Trans i18nKey="serviceError.10142">Sorry, your new password cannot be the same as the old one</Trans>,
|
|
13
|
+
10143: (
|
|
14
|
+
<Trans i18nKey="serviceError.10143">
|
|
15
|
+
The password that you entered does not match. Please make sure you input the correct password
|
|
16
|
+
</Trans>
|
|
17
|
+
),
|
|
18
|
+
20022: <Trans i18nKey="serviceError.20022">Something went wrong. For more information please contact our support team</Trans>,
|
|
19
|
+
10136: (
|
|
20
|
+
// tslint:disable-next-line:max-line-length
|
|
21
|
+
<Trans i18nKey="serviceError.10136">Sorry, you've entered the codes incorrectly too many times. Please request a new one</Trans>
|
|
22
|
+
),
|
|
23
|
+
10137: <Trans i18nKey="serviceError.10137">Sorry, the code you entered is expired. Please request a new one.</Trans>,
|
|
24
|
+
10138: <Trans i18nKey="serviceError.10138">Sorry, the code you entered is invalid. Please try again.</Trans>,
|
|
25
|
+
|
|
26
|
+
10154: <Trans i18nKey="serviceError.10154">Country does not exist</Trans>,
|
|
27
|
+
10171: <Trans i18nKey="serviceError.10171">This email address is not registered</Trans>,
|
|
28
|
+
10133: <Trans i18nKey="serviceError.10133">Sorry, you must enter a new email address</Trans>,
|
|
29
|
+
10140: <Trans i18nKey="serviceError.10140">User is already verified</Trans>,
|
|
30
|
+
10153: <Trans i18nKey="serviceError.10153">User already exists</Trans>,
|
|
31
|
+
20007: <Trans i18nKey="serviceError.20007">You have requested too many codes. Please try again later.</Trans>,
|
|
32
|
+
10170: <Trans i18nKey="serviceError.10170">Oops, you are already linked your email address to your account.</Trans>,
|
|
33
|
+
10172: <Trans i18nKey="serviceError.10172">Sorry, your account is already linked.</Trans>,
|
|
34
|
+
10173: <Trans i18nKey="serviceError.10173">Sorry, platform account has already linked with another user account.</Trans>,
|
|
35
|
+
10139: (
|
|
36
|
+
<Trans i18nKey="serviceError.10139">
|
|
37
|
+
Oops, it seems you haven't play the game yet. Please play the game before proceed with this action
|
|
38
|
+
</Trans>
|
|
39
|
+
),
|
|
40
|
+
10174: (
|
|
41
|
+
<Trans i18nKey="serviceError.10174">Oops, the platform you are trying to connect does not exist. Please try another platform.</Trans>
|
|
42
|
+
),
|
|
43
|
+
10177: <Trans i18nKey="serviceError.10177">That username has been taken. Please choose another.</Trans>,
|
|
44
|
+
10152: <Trans i18nKey="serviceError.10152">Something went wrong. For more information please contact our support team</Trans>,
|
|
45
|
+
10149: <Trans i18nKey="serviceError.10149">Something went wrong. For more information please contact our support team</Trans>,
|
|
46
|
+
10148: <Trans i18nKey="serviceError.10148">Something went wrong. For more information please contact our support team</Trans>,
|
|
47
|
+
10180: <Trans i18nKey="serviceError.10180">The invitation link has expired. Please request a new link.</Trans>,
|
|
48
|
+
10190: (
|
|
49
|
+
<Trans i18nKey="serviceError.10190">
|
|
50
|
+
QR Code expired. Please reload the page and repeat the process to enable the authenticator app.
|
|
51
|
+
</Trans>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const LegalAdminErrorTranslationMap = {
|
|
11
|
+
40030: <Trans i18nKey="adminServiceError.40030">No localization, please add localization and try again</Trans>,
|
|
12
|
+
40043: <Trans i18nKey="adminServiceError.40043">Legal name is already published.</Trans>
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const LobbyAndMatchmakingAdminErrorTranslationMap = {
|
|
11
|
+
11403: <Trans i18nKey="adminServiceError.11403">Game mode already exists. Please try another one</Trans>,
|
|
12
|
+
510103: <Trans i18nKey="adminServiceError.510103">This game mode is already exists</Trans>
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const ReportingModerationAdminErrorTranslationMap = {
|
|
11
|
+
84103: <Trans i18nKey="adminServiceError.84103">Reason group name already exists. Please try another one</Trans>
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const RewardsAdminErrorTranslationMap = {
|
|
11
|
+
34071: <Trans i18nKey="adminServiceError.34071">Reward code already exists. Please try another one</Trans>
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const SeasonPassAdminErrorTranslationMap = {
|
|
11
|
+
49122: <Trans i18nKey="adminServiceError.49122">Invalid time range</Trans>,
|
|
12
|
+
49173: <Trans i18nKey="adminServiceError.49173">Reward code already exists in the Season</Trans>,
|
|
13
|
+
49179: <Trans i18nKey="adminServiceError.49179">Failed to delete reward. The Reward is in use.</Trans>,
|
|
14
|
+
49143: <Trans i18nKey="adminServiceError.49143">Season does not exist in namespace</Trans>,
|
|
15
|
+
30142: <Trans i18nKey="adminServiceError.30142">Published store does not exist in namespace</Trans>,
|
|
16
|
+
49141: <Trans i18nKey="adminServiceError.49141">Tier item does not exist in the store of namespace</Trans>,
|
|
17
|
+
49142: <Trans i18nKey="adminServiceError.49142">Pass item does not exist in the store of namespace</Trans>,
|
|
18
|
+
30341: (
|
|
19
|
+
<Trans i18nKey="adminServiceError.30341">
|
|
20
|
+
One or more of the included items are not active or published in your store. Please publish or remove them to continue
|
|
21
|
+
</Trans>
|
|
22
|
+
),
|
|
23
|
+
36141: <Trans i18nKey="adminServiceError.36141">Currency does not exist in namespace</Trans>,
|
|
24
|
+
49144: <Trans i18nKey="adminServiceError.49144">Reward does not exist</Trans>,
|
|
25
|
+
49171: <Trans i18nKey="adminServiceError.49171">Invalid season status</Trans>,
|
|
26
|
+
49172: <Trans i18nKey="adminServiceError.49172">Season is already ended</Trans>,
|
|
27
|
+
49175: <Trans i18nKey="adminServiceError.49175">Published season already exists in namespace</Trans>,
|
|
28
|
+
49176: <Trans i18nKey="adminServiceError.49176">Rewards are not provided</Trans>,
|
|
29
|
+
49177: <Trans i18nKey="adminServiceError.49177">Passes are not provided</Trans>,
|
|
30
|
+
49178: <Trans i18nKey="adminServiceError.49178">Tiers are not provided</Trans>,
|
|
31
|
+
49174: <Trans i18nKey="adminServiceError.49174">Pass already exists in the season</Trans>,
|
|
32
|
+
49121: <Trans i18nKey="adminServiceError.49121">Default language required in localizations</Trans>,
|
|
33
|
+
49145: <Trans i18nKey="adminServiceError.49145">Pass does not exist</Trans>
|
|
34
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const StatisticAdminErrorTranslationMap = {
|
|
11
|
+
12275: <Trans i18nKey="adminServiceError.12275">The default value must be within range of Min. Value & Max. Value</Trans>,
|
|
12
|
+
20000: <Trans i18nKey="adminServiceError.20000">Something went wrong. Please contact Administrator.</Trans>,
|
|
13
|
+
20002: <Trans i18nKey="adminServiceError.20002">Please correct the errors in the form to proceed</Trans>,
|
|
14
|
+
70131: <Trans i18nKey="adminServiceError.70131">Configuration does not exist</Trans>,
|
|
15
|
+
70132: <Trans i18nKey="adminServiceError.70132">Configuration already exist</Trans>,
|
|
16
|
+
70330: <Trans i18nKey="adminServiceError.70330">Sorry, we are unable to process this request</Trans>,
|
|
17
|
+
70331: <Trans i18nKey="adminServiceError.70331">Configuration does not exist</Trans>,
|
|
18
|
+
70334: <Trans i18nKey="adminServiceError.70334">Statistic value is not decreasable.</Trans>,
|
|
19
|
+
70335: <Trans i18nKey="adminServiceError.70335">User statistic item does not exist</Trans>,
|
|
20
|
+
70336: <Trans i18nKey="adminServiceError.70336">User statistic item already exist</Trans>,
|
|
21
|
+
70337: <Trans i18nKey="adminServiceError.70337">You've reached the max value for statistic</Trans>
|
|
22
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as React from 'react'
|
|
8
|
+
import { Trans } from 'react-i18next'
|
|
9
|
+
|
|
10
|
+
export const UgcAdminErrorTranslationMap = {
|
|
11
|
+
771403: <Trans i18nKey="adminServiceError.771403">Tag Name already exists. Please try another one</Trans>,
|
|
12
|
+
772804: <Trans i18nKey="adminServiceError.772804">Tag Name already exists. Please try another one</Trans>,
|
|
13
|
+
771703: <Trans i18nKey="adminServiceError.771703">Type Name already exists. Please try another one</Trans>,
|
|
14
|
+
771904: <Trans i18nKey="adminServiceError.771904">Type name already exists. Please try another one</Trans>
|
|
15
|
+
}
|
package/src/i18n.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2018-2019 AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import flatten from 'flat'
|
|
8
|
+
import i18next, { i18n, Resource } from 'i18next'
|
|
9
|
+
import { initReactI18next } from 'react-i18next'
|
|
10
|
+
import config from './config.json'
|
|
11
|
+
import deDE from './translations/de-DE.json'
|
|
12
|
+
import enUS from './translations/en-US.json'
|
|
13
|
+
import esES from './translations/es-ES.json'
|
|
14
|
+
import frFR from './translations/fr-FR.json'
|
|
15
|
+
import itIT from './translations/it-IT.json'
|
|
16
|
+
import jaJP from './translations/ja-JP.json'
|
|
17
|
+
import zhCN from './translations/zh-CN.json'
|
|
18
|
+
|
|
19
|
+
function isOnBrowser() {
|
|
20
|
+
try {
|
|
21
|
+
if (typeof window !== 'undefined') {
|
|
22
|
+
return true
|
|
23
|
+
}
|
|
24
|
+
// eslint-disable-next-line
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error(error)
|
|
27
|
+
}
|
|
28
|
+
return false
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const loadedLanguages: { [key: string]: { [key: string]: string } } = {
|
|
32
|
+
'en-US': enUS,
|
|
33
|
+
'fr-FR': frFR,
|
|
34
|
+
'it-IT': itIT,
|
|
35
|
+
'de-DE': deDE,
|
|
36
|
+
'es-ES': esES,
|
|
37
|
+
'ja-JP': jaJP,
|
|
38
|
+
'zh-CN': zhCN
|
|
39
|
+
}
|
|
40
|
+
const languageLocalStorageKey = 'i18nextLng'
|
|
41
|
+
const availableLanguageCodes = config.languageCodes
|
|
42
|
+
const translationResource = availableLanguageCodes.reduce((resources: Resource, languageCode: string) => {
|
|
43
|
+
// eslint-disable-next-line no-param-reassign
|
|
44
|
+
resources[languageCode] = {
|
|
45
|
+
// Loading unflattened resource
|
|
46
|
+
translation: flatten.unflatten(loadedLanguages[languageCode])
|
|
47
|
+
}
|
|
48
|
+
return resources
|
|
49
|
+
}, {})
|
|
50
|
+
|
|
51
|
+
export function getLocalStorageLanguage(instance?: i18n): string {
|
|
52
|
+
if (isOnBrowser()) {
|
|
53
|
+
const currentLanguageCode = localStorage.getItem(languageLocalStorageKey)
|
|
54
|
+
if (currentLanguageCode) {
|
|
55
|
+
const hasResource = instance && instance.hasResourceBundle(currentLanguageCode, 'translation')
|
|
56
|
+
const isAvailable = availableLanguageCodes.includes(currentLanguageCode)
|
|
57
|
+
if (hasResource || isAvailable) {
|
|
58
|
+
return currentLanguageCode
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return config.defaultLanguage
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
export const i18nInstance = i18next.use(initReactI18next).createInstance(
|
|
67
|
+
{
|
|
68
|
+
lng: getLocalStorageLanguage(),
|
|
69
|
+
fallbackLng: config.fallbackLanguage,
|
|
70
|
+
preload: availableLanguageCodes,
|
|
71
|
+
resources: translationResource,
|
|
72
|
+
initImmediate: false,
|
|
73
|
+
debug: process.env.NODE_ENV === 'development'
|
|
74
|
+
},
|
|
75
|
+
// tslint:disable-next-line no-empty
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
77
|
+
() => {}
|
|
78
|
+
) // Do not remove the callback. It will break the i18n
|
|
79
|
+
|
|
80
|
+
// tslint:disable-next-line no-any
|
|
81
|
+
export function t(key: string, options?: any) {
|
|
82
|
+
return i18nInstance.t(key, options)
|
|
83
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2019. AccelByte Inc. All Rights Reserved
|
|
3
|
+
* This is licensed software from AccelByte Inc, for limitations
|
|
4
|
+
* and restrictions contact your company contract manager.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { flatten } from 'flat'
|
|
8
|
+
import { ResourceKey } from 'i18next'
|
|
9
|
+
import * as React from 'react'
|
|
10
|
+
import { I18nextProvider, Trans } from 'react-i18next'
|
|
11
|
+
import { AugmentsAdminErrorTranslationMap } from './error-translation-map/augments-admin-error-translation-map'
|
|
12
|
+
import { BasicAdminErrorTranslationMap } from './error-translation-map/basic-admin-error-translation-map'
|
|
13
|
+
import { BasicErrorTranslationMap } from './error-translation-map/basic-error-translation-map'
|
|
14
|
+
import { EcommerceAdminErrorTranslationMap } from './error-translation-map/ecommerce-admin-error-translation-map'
|
|
15
|
+
import { EcommerceErrorTranslationMap } from './error-translation-map/ecommerce-error-translation-map'
|
|
16
|
+
import { GDPRerrorTranslationMap } from './error-translation-map/gdpr-error-translation-map'
|
|
17
|
+
import { IAMAdminErrorTranslationMap } from './error-translation-map/iam-admin-error-translation-map'
|
|
18
|
+
import { IAMErrorTranslationMap } from './error-translation-map/iam-error-translation-map'
|
|
19
|
+
import { LegalAdminErrorTranslationMap } from './error-translation-map/legal-admin-error-translation-map'
|
|
20
|
+
// tslint:disable-next-line:max-line-length
|
|
21
|
+
import { LobbyAndMatchmakingAdminErrorTranslationMap } from './error-translation-map/lobby-and-matchmaking-admin-error-translation-map'
|
|
22
|
+
// tslint:disable-next-line:max-line-length
|
|
23
|
+
import { ReportingModerationAdminErrorTranslationMap } from './error-translation-map/reportingmoderation-admin-error-translation-map'
|
|
24
|
+
import { RewardsAdminErrorTranslationMap } from './error-translation-map/rewards-admin-error-translation-map'
|
|
25
|
+
import { SeasonPassAdminErrorTranslationMap } from './error-translation-map/seasonpass-admin-error-translation-map'
|
|
26
|
+
import { StatisticAdminErrorTranslationMap } from './error-translation-map/statistic-admin-error-translation-map'
|
|
27
|
+
import { UgcAdminErrorTranslationMap } from './error-translation-map/ugc-admin-error-translation-map'
|
|
28
|
+
import { getLocalStorageLanguage, i18nInstance } from './i18n'
|
|
29
|
+
|
|
30
|
+
interface ServiceErrorProps {
|
|
31
|
+
errorCode: number
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const serviceErrorI18nInstance = i18nInstance
|
|
35
|
+
|
|
36
|
+
export const addI18nResourceServiceError = (languageCode: string, resource: ResourceKey, deep?: boolean, overwrite?: boolean) => {
|
|
37
|
+
i18nInstance.addResourceBundle(languageCode, 'translation', flatten.unflatten(resource), deep, overwrite)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// tslint:disable-next-line no-any
|
|
41
|
+
const isValidServiceError = (errorCode: number): errorCode is number => {
|
|
42
|
+
return typeof errorCode === 'number'
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const ServiceErrorTranslator = (props: ServiceErrorProps): JSX.Element | null => {
|
|
46
|
+
if (isValidServiceError(props.errorCode) && props.errorCode in serviceErrorTranslationMap) {
|
|
47
|
+
return serviceErrorTranslationMap[props.errorCode]
|
|
48
|
+
}
|
|
49
|
+
return null
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const Withi18nProvider = ({ children, lang }: { children: React.ReactNode; lang?: string }) => {
|
|
53
|
+
i18nInstance.changeLanguage(lang || getLocalStorageLanguage(i18nInstance))
|
|
54
|
+
return <I18nextProvider i18n={i18nInstance}>{children}</I18nextProvider>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// USED in Odin
|
|
58
|
+
export const translateServiceError = (errorCode: number, lang?: string, defaultMessage?: React.ReactNode) => {
|
|
59
|
+
if (isValidServiceError(errorCode) && errorCode in serviceErrorTranslationMap) {
|
|
60
|
+
return <Withi18nProvider lang={lang}>{serviceErrorTranslationMap[errorCode]}</Withi18nProvider>
|
|
61
|
+
}
|
|
62
|
+
if (defaultMessage) {
|
|
63
|
+
return defaultMessage
|
|
64
|
+
}
|
|
65
|
+
return (
|
|
66
|
+
<Withi18nProvider lang={lang}>
|
|
67
|
+
<Trans i18nKey="serviceError.unknown">Failed to complete the request</Trans>
|
|
68
|
+
</Withi18nProvider>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// USED in Admin Portal
|
|
73
|
+
export const translateServiceErrorForAdmin = (errorCode: number, lang?: string, defaultMessage?: React.ReactNode) => {
|
|
74
|
+
if (isValidServiceError(errorCode) && errorCode in adminServiceErrorTranslationMap) {
|
|
75
|
+
return <Withi18nProvider lang={lang}>{adminServiceErrorTranslationMap[errorCode]}</Withi18nProvider>
|
|
76
|
+
}
|
|
77
|
+
if (defaultMessage) {
|
|
78
|
+
return defaultMessage
|
|
79
|
+
}
|
|
80
|
+
return (
|
|
81
|
+
<Withi18nProvider lang={lang}>
|
|
82
|
+
<Trans i18nKey="serviceError.unknown">Failed to complete the request</Trans>
|
|
83
|
+
</Withi18nProvider>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const serviceErrorTranslationMap = Object.freeze({
|
|
88
|
+
...IAMErrorTranslationMap,
|
|
89
|
+
...BasicErrorTranslationMap,
|
|
90
|
+
...EcommerceErrorTranslationMap,
|
|
91
|
+
...GDPRerrorTranslationMap
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const adminServiceErrorTranslationMap = Object.freeze({
|
|
95
|
+
...IAMAdminErrorTranslationMap,
|
|
96
|
+
...StatisticAdminErrorTranslationMap,
|
|
97
|
+
...BasicAdminErrorTranslationMap,
|
|
98
|
+
...EcommerceErrorTranslationMap,
|
|
99
|
+
...EcommerceAdminErrorTranslationMap,
|
|
100
|
+
...LegalAdminErrorTranslationMap,
|
|
101
|
+
...LobbyAndMatchmakingAdminErrorTranslationMap,
|
|
102
|
+
...ReportingModerationAdminErrorTranslationMap,
|
|
103
|
+
...RewardsAdminErrorTranslationMap,
|
|
104
|
+
...UgcAdminErrorTranslationMap,
|
|
105
|
+
...SeasonPassAdminErrorTranslationMap,
|
|
106
|
+
...AugmentsAdminErrorTranslationMap
|
|
107
|
+
})
|