@accelbyte/error-translator 0.1.1-alpha.56 → 0.2.0-beta.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 (112) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{index.js → cjs/index.js} +3 -2
  3. package/dist/cjs/index.js.map +1 -0
  4. package/dist/{types/error-translation-map → error-translation-map}/augments-admin-error-translation-map.d.ts +0 -0
  5. package/dist/{types/error-translation-map → error-translation-map}/basic-admin-error-translation-map.d.ts +1 -0
  6. package/dist/{types/error-translation-map → error-translation-map}/basic-error-translation-map.d.ts +0 -0
  7. package/dist/{types/error-translation-map → error-translation-map}/common-admin-error-translation-map.d.ts +0 -0
  8. package/dist/{types/error-translation-map → error-translation-map}/common-error-translation-map.d.ts +0 -0
  9. package/dist/{types/error-translation-map → error-translation-map}/ecommerce-admin-error-translation-map.d.ts +0 -0
  10. package/dist/{types/error-translation-map → error-translation-map}/ecommerce-error-translation-map.d.ts +0 -0
  11. package/dist/{types/error-translation-map → error-translation-map}/gdpr-error-translation-map.d.ts +0 -0
  12. package/dist/{types/error-translation-map → error-translation-map}/iam-admin-error-translation-map.d.ts +0 -0
  13. package/dist/{types/error-translation-map → error-translation-map}/iam-error-translation-map.d.ts +0 -0
  14. package/dist/{types/error-translation-map → error-translation-map}/legal-admin-error-translation-map.d.ts +0 -0
  15. package/dist/{types/error-translation-map → error-translation-map}/lobby-and-matchmaking-admin-error-translation-map.d.ts +0 -0
  16. package/dist/{types/error-translation-map → error-translation-map}/reportingmoderation-admin-error-translation-map.d.ts +0 -0
  17. package/dist/{types/error-translation-map → error-translation-map}/rewards-admin-error-translation-map.d.ts +0 -0
  18. package/dist/{types/error-translation-map → error-translation-map}/seasonpass-admin-error-translation-map.d.ts +0 -0
  19. package/dist/{types/error-translation-map → error-translation-map}/statistic-admin-error-translation-map.d.ts +0 -0
  20. package/dist/{types/error-translation-map → error-translation-map}/ugc-admin-error-translation-map.d.ts +0 -0
  21. package/dist/es/config.json.js +4 -0
  22. package/dist/es/config.json.js.map +1 -0
  23. package/dist/es/error-translation-map/augments-admin-error-translation-map.js +14 -0
  24. package/dist/es/error-translation-map/augments-admin-error-translation-map.js.map +1 -0
  25. package/dist/es/error-translation-map/basic-admin-error-translation-map.js +31 -0
  26. package/dist/es/error-translation-map/basic-admin-error-translation-map.js.map +1 -0
  27. package/dist/es/error-translation-map/basic-error-translation-map.js +25 -0
  28. package/dist/es/error-translation-map/basic-error-translation-map.js.map +1 -0
  29. package/dist/es/error-translation-map/ecommerce-admin-error-translation-map.js +29 -0
  30. package/dist/es/error-translation-map/ecommerce-admin-error-translation-map.js.map +1 -0
  31. package/dist/es/error-translation-map/ecommerce-error-translation-map.js +24 -0
  32. package/dist/es/error-translation-map/ecommerce-error-translation-map.js.map +1 -0
  33. package/dist/es/error-translation-map/gdpr-error-translation-map.js +14 -0
  34. package/dist/es/error-translation-map/gdpr-error-translation-map.js.map +1 -0
  35. package/dist/es/error-translation-map/iam-admin-error-translation-map.js +55 -0
  36. package/dist/es/error-translation-map/iam-admin-error-translation-map.js.map +1 -0
  37. package/dist/es/error-translation-map/iam-error-translation-map.js +39 -0
  38. package/dist/es/error-translation-map/iam-error-translation-map.js.map +1 -0
  39. package/dist/es/error-translation-map/legal-admin-error-translation-map.js +15 -0
  40. package/dist/es/error-translation-map/legal-admin-error-translation-map.js.map +1 -0
  41. package/dist/es/error-translation-map/lobby-and-matchmaking-admin-error-translation-map.js +15 -0
  42. package/dist/es/error-translation-map/lobby-and-matchmaking-admin-error-translation-map.js.map +1 -0
  43. package/dist/es/error-translation-map/reportingmoderation-admin-error-translation-map.js +14 -0
  44. package/dist/es/error-translation-map/reportingmoderation-admin-error-translation-map.js.map +1 -0
  45. package/dist/es/error-translation-map/rewards-admin-error-translation-map.js +14 -0
  46. package/dist/es/error-translation-map/rewards-admin-error-translation-map.js.map +1 -0
  47. package/dist/es/error-translation-map/seasonpass-admin-error-translation-map.js +32 -0
  48. package/dist/es/error-translation-map/seasonpass-admin-error-translation-map.js.map +1 -0
  49. package/dist/es/error-translation-map/statistic-admin-error-translation-map.js +24 -0
  50. package/dist/es/error-translation-map/statistic-admin-error-translation-map.js.map +1 -0
  51. package/dist/es/error-translation-map/ugc-admin-error-translation-map.js +17 -0
  52. package/dist/es/error-translation-map/ugc-admin-error-translation-map.js.map +1 -0
  53. package/dist/es/i18n.js +76 -0
  54. package/dist/es/i18n.js.map +1 -0
  55. package/dist/es/index.js +2 -0
  56. package/dist/es/index.js.map +1 -0
  57. package/dist/es/service-error-translator.js +88 -0
  58. package/dist/es/service-error-translator.js.map +1 -0
  59. package/dist/es/translations/de-DE.json.js +4 -0
  60. package/dist/es/translations/de-DE.json.js.map +1 -0
  61. package/dist/es/translations/en-US.json.js +4 -0
  62. package/dist/es/translations/en-US.json.js.map +1 -0
  63. package/dist/es/translations/es-ES.json.js +4 -0
  64. package/dist/es/translations/es-ES.json.js.map +1 -0
  65. package/dist/es/translations/fr-FR.json.js +4 -0
  66. package/dist/es/translations/fr-FR.json.js.map +1 -0
  67. package/dist/es/translations/it-IT.json.js +4 -0
  68. package/dist/es/translations/it-IT.json.js.map +1 -0
  69. package/dist/es/translations/ja-JP.json.js +4 -0
  70. package/dist/es/translations/ja-JP.json.js.map +1 -0
  71. package/dist/es/translations/zh-CN.json.js +4 -0
  72. package/dist/es/translations/zh-CN.json.js.map +1 -0
  73. package/dist/{types/i18n.d.ts → i18n.d.ts} +0 -0
  74. package/dist/{types/index.d.ts → index.d.ts} +0 -0
  75. package/dist/{types/service-error-translator.d.ts → service-error-translator.d.ts} +0 -0
  76. package/package.json +8 -7
  77. package/dist/index.es.js +0 -437
  78. package/dist/index.es.js.map +0 -1
  79. package/dist/index.js.map +0 -1
  80. package/rollup.config.mjs +0 -73
  81. package/scripts/i18nbuilder.js +0 -144
  82. package/src/README.md +0 -41
  83. package/src/config.json +0 -13
  84. package/src/error-translation-map/augments-admin-error-translation-map.tsx +0 -12
  85. package/src/error-translation-map/basic-admin-error-translation-map.tsx +0 -30
  86. package/src/error-translation-map/basic-error-translation-map.tsx +0 -47
  87. package/src/error-translation-map/common-admin-error-translation-map.tsx +0 -16
  88. package/src/error-translation-map/common-error-translation-map.tsx +0 -16
  89. package/src/error-translation-map/ecommerce-admin-error-translation-map.tsx +0 -37
  90. package/src/error-translation-map/ecommerce-error-translation-map.tsx +0 -22
  91. package/src/error-translation-map/gdpr-error-translation-map.tsx +0 -16
  92. package/src/error-translation-map/iam-admin-error-translation-map.tsx +0 -64
  93. package/src/error-translation-map/iam-error-translation-map.tsx +0 -53
  94. package/src/error-translation-map/legal-admin-error-translation-map.tsx +0 -13
  95. package/src/error-translation-map/lobby-and-matchmaking-admin-error-translation-map.tsx +0 -13
  96. package/src/error-translation-map/reportingmoderation-admin-error-translation-map.tsx +0 -12
  97. package/src/error-translation-map/rewards-admin-error-translation-map.tsx +0 -12
  98. package/src/error-translation-map/seasonpass-admin-error-translation-map.tsx +0 -34
  99. package/src/error-translation-map/statistic-admin-error-translation-map.tsx +0 -22
  100. package/src/error-translation-map/ugc-admin-error-translation-map.tsx +0 -15
  101. package/src/i18n.ts +0 -83
  102. package/src/index.ts +0 -7
  103. package/src/service-error-translator.tsx +0 -107
  104. package/src/translations/de-DE.json +0 -37
  105. package/src/translations/en-US.json +0 -162
  106. package/src/translations/es-ES.json +0 -37
  107. package/src/translations/fr-FR.json +0 -37
  108. package/src/translations/it-IT.json +0 -37
  109. package/src/translations/ja-JP.json +0 -37
  110. package/src/translations/zh-CN.json +0 -162
  111. package/tsconfig.build.json +0 -17
  112. package/tsconfig.json +0 -18
@@ -1,53 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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
- }
@@ -1,13 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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
- }
@@ -1,12 +0,0 @@
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
- }
@@ -1,34 +0,0 @@
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
- }
@@ -1,22 +0,0 @@
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
- }
@@ -1,15 +0,0 @@
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 DELETED
@@ -1,83 +0,0 @@
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 DELETED
@@ -1,7 +0,0 @@
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
- export * from './service-error-translator'
@@ -1,107 +0,0 @@
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
- })
@@ -1,37 +0,0 @@
1
- {
2
- "serviceError.10130": "Leider können wir diese Anfrage nicht bearbeiten.",
3
- "serviceError.10133": "Du musst eine neue E-Mail-Adresse eingeben.",
4
- "serviceError.10136": "Leider hast du den Code zu oft falsch eingegeben. Bitte fordere einen neuen Code an.",
5
- "serviceError.10137": "Leider ist der eingegebene Code abgelaufen. Bitte fordere einen neuen an.",
6
- "serviceError.10138": "Der eingegebene Code ist leider ungültig. Bitte versuche es erneut.",
7
- "serviceError.10139": "Hoppla! Es scheint, als hättest du das Spiel noch nicht gespielt. Bitte spiele zuerst das Spiel, bevor du mit dieser Aktion fortfährst.",
8
- "serviceError.10140": "Benutzer ist bereits verifiziert.",
9
- "serviceError.10142": "Leider darf dein neues Passwort nicht mit deinem alten übereinstimmen.",
10
- "serviceError.10143": "Das eingegebene Passwort stimmt nicht überein. Bitte vergewissere dich, dass du das richtige Passwort eingegeben hast.",
11
- "serviceError.10148": "Etwas ist schiefgelaufen. Für weitere Informationen wende dich bitte an unser Support-Team.",
12
- "serviceError.10149": "Etwas ist schiefgelaufen. Für weitere Informationen wende dich bitte an unser Support-Team.",
13
- "serviceError.10152": "Etwas ist schiefgelaufen. Für weitere Informationen wende dich bitte an unser Support-Team.",
14
- "serviceError.10153": "Benutzer existiert bereits.",
15
- "serviceError.10154": "Land existiert nicht.",
16
- "serviceError.10170": "Du hast deine E-Mail-Adresse bereits mit deinem Konto verknüpft.",
17
- "serviceError.10171": "Diese E-Mail-Adresse ist nicht registriert.",
18
- "serviceError.10172": "Dein Konto ist bereits verknüpft.",
19
- "serviceError.10173": "Leider wurde dieses Plattformkonto bereits mit einem anderen Benutzerkonto verknüpft.",
20
- "serviceError.10174": "Hoppla! Die Plattform, die du verknüpfen möchtest, existiert nicht. Bitte versuche es mit einer anderen Plattform.",
21
- "serviceError.10177": "Dieser Benutzername ist bereits vergeben. Bitte wähle einen anderen Namen.",
22
- "serviceError.11233": "Fehler: Ländergruppe existiert nicht. Bitte wende dich für Hilfe an unser Support-Team.",
23
- "serviceError.11337": "Fehler: Benutzerprofil existiert nicht. Bitte wende dich für Hilfe an unser Support-Team.",
24
- "serviceError.11440": "Fehler: Benutzerprofil existiert nicht. Bitte wende dich für Hilfe an unser Support-Team.",
25
- "serviceError.11441": "Fehler: Benutzerprofil existiert bereits. Bitte wende dich für Hilfe an unser Support-Team.",
26
- "serviceError.13122": "Das eingegebene Passwort stimmt nicht überein. Bitte vergewissere dich, dass du das richtige Passwort eingegeben hast.",
27
- "serviceError.20000": "Etwas ist schiefgelaufen. Für weitere Informationen wende dich bitte an unser Support-Team.",
28
- "serviceError.20001": "Leider ist die Seite, auf die du zugreifen möchtest, öffentlich nicht verfügbar.",
29
- "serviceError.20002": "Bitte korrigiere die Fehler im Formular, um fortzufahren.",
30
- "serviceError.20007": "Du hast zu viele Codes angefordert. Bitte versuche es später erneut.",
31
- "serviceError.20008": "Benutzer existiert nicht.",
32
- "serviceError.20013": "Leider bist du nicht berechtigt, diese Aktion auszuführen oder auf diese Seite zuzugreifen.",
33
- "serviceError.20017": "Hoppla! Es scheint, als hättest du das Spiel noch nicht gespielt. Bitte spiele zuerst das Spiel, bevor du mit dieser Aktion fortfährst.",
34
- "serviceError.20019": "Etwas ist schiefgelaufen. Für weitere Informationen wende dich bitte an unser Support-Team.",
35
- "serviceError.20022": "Etwas ist schiefgelaufen. Für weitere Informationen wende dich bitte an unser Support-Team.",
36
- "serviceError.unknown": "Anfrage konnte nicht abgeschlossen werden."
37
- }
@@ -1,162 +0,0 @@
1
- {
2
- "adminServiceError.10130": "Age does not meet the age restriction",
3
- "adminServiceError.10133": "Email address is already taken",
4
- "adminServiceError.10136": "Sorry, you've entered the codes incorrectly too many times. Please request a new one",
5
- "adminServiceError.10137": "Verification code is expired",
6
- "adminServiceError.10138": "Verification code does not match",
7
- "adminServiceError.10139": "Platform account does not exist",
8
- "adminServiceError.10140": "User is already verified",
9
- "adminServiceError.10142": "Sorry, your new password cannot be the same as the old one",
10
- "adminServiceError.10143": "The password that you entered does not match. Please make sure you input the correct password",
11
- "adminServiceError.10145": "Only Publisher Admin can perform this action",
12
- "adminServiceError.10146": "user id not match",
13
- "adminServiceError.10148": "Something went wrong. Please contact Administrator.",
14
- "adminServiceError.10149": "Something went wrong. Please contact Administrator.",
15
- "adminServiceError.10152": "Something went wrong. Please contact Administrator.",
16
- "adminServiceError.10153": "User already exists",
17
- "adminServiceError.10154": "Country does not exist",
18
- "adminServiceError.10156": "Role does not exist",
19
- "adminServiceError.10157": "Role does not exist",
20
- "adminServiceError.10158": "Ban does not exist",
21
- "adminServiceError.10159": "Only Role Manager can perform this action",
22
- "adminServiceError.10160": "User already has the role",
23
- "adminServiceError.10161": "User is already registered as role member",
24
- "adminServiceError.10169": "Age restriction does not exist",
25
- "adminServiceError.10170": "User already has platform account",
26
- "adminServiceError.10171": "Email address is not registered",
27
- "adminServiceError.10177": "Username is already taken. Please try something different.",
28
- "adminServiceError.10190": "QR Code expired. Please reload the page and repeat the process to enable the authenticator app.",
29
- "adminServiceError.10364": "Client already exists",
30
- "adminServiceError.10365": "Client does not exist",
31
- "adminServiceError.10456": "Role does not exist",
32
- "adminServiceError.10457": "Failed to add role member, the role is not an admin role",
33
- "adminServiceError.10459": "Only Role Manager can perform this action",
34
- "adminServiceError.10466": "invalid role members",
35
- "adminServiceError.10467": "Admin role must have at least 1 role manager",
36
- "adminServiceError.10468": "User already registered as role manager",
37
- "adminServiceError.10469": "User already registered as role member",
38
- "adminServiceError.11014045": "Failed to export Logs. No log found.",
39
- "adminServiceError.11132": "You've reached the maximum upload limit.",
40
- "adminServiceError.11233": "Region does not exist",
41
- "adminServiceError.11234": "The country already registered in another region",
42
- "adminServiceError.11235": "Region already exists",
43
- "adminServiceError.11336": "Namespace already exists",
44
- "adminServiceError.11337": "Namespace does not exist",
45
- "adminServiceError.11403": "Game mode already exists. Please try another one",
46
- "adminServiceError.11440": "User profile does not exist",
47
- "adminServiceError.11469": "User does not exist",
48
- "adminServiceError.11540": "User profile does not exist",
49
- "adminServiceError.11621": "API Key is invalid. Please try again with the correct one.",
50
- "adminServiceError.20000": "Something went wrong. Please contact Administrator.",
51
- "adminServiceError.20001": "Sorry, you are not authorized for selected action",
52
- "adminServiceError.20002": "Please correct the errors in the form to proceed",
53
- "adminServiceError.20006": "The item is already updated by another admin. Please refresh the page.",
54
- "adminServiceError.20007": "You have requested too many codes. Please try again later.",
55
- "adminServiceError.20008": "User does not exist",
56
- "adminServiceError.20013": "Sorry, you have no permission to do this action or access this page",
57
- "adminServiceError.20017": "The user must be linked to the item's namespace before entitled to the selected item",
58
- "adminServiceError.20019": "Something went wrong. Please contact Administrator.",
59
- "adminServiceError.20022": "Something went wrong. You've sent an invalid request.",
60
- "adminServiceError.30071": "This item cannot be deselected while the associated bundle/option box/loot box is still selected",
61
- "adminServiceError.30072": "This category cannot be deselected while there are still items selected within it.",
62
- "adminServiceError.30074": "This item cannot be deselected while the associated subscription is still selected",
63
- "adminServiceError.30075": "This display cannot be deselected while the associated section is still selected",
64
- "adminServiceError.30141": "The draft store does not exist or deleted in namespace",
65
- "adminServiceError.30142": "Published store does not exist in namespace",
66
- "adminServiceError.30326": "Subscription item cannot be bundled",
67
- "adminServiceError.30327": "Invalid item trial price",
68
- "adminServiceError.30341": "One or more of the included items are not active or published in your store. Please publish or remove them to continue",
69
- "adminServiceError.30374": "SKU already exist. Please try again.",
70
- "adminServiceError.31178": "Entitlement out of time range",
71
- "adminServiceError.33271": "Payment configuration for the selected namespace and region already exists.",
72
- "adminServiceError.34042": "Failed to update reward condition. Please remove or change any inactive or deleted items.",
73
- "adminServiceError.34071": "Reward code already exists. Please try another one",
74
- "adminServiceError.36141": "Currency does not exist in namespace",
75
- "adminServiceError.37171": "Code Redemption Name already exists. Try again.",
76
- "adminServiceError.37221": "Upload file failed. It's either empty or file extension is not acceptable",
77
- "adminServiceError.37271": "Key Group Name is already exists.",
78
- "adminServiceError.38122": "Subscription end date required",
79
- "adminServiceError.40030": "No localization, please add localization and try again",
80
- "adminServiceError.40043": "Legal name is already published.",
81
- "adminServiceError.40141": "Subscription does not exist",
82
- "adminServiceError.49121": "Default language required in localizations",
83
- "adminServiceError.49122": "Invalid time range",
84
- "adminServiceError.49141": "Tier item does not exist in the store of namespace",
85
- "adminServiceError.49142": "Pass item does not exist in the store of namespace",
86
- "adminServiceError.49143": "Season does not exist in namespace",
87
- "adminServiceError.49144": "Reward does not exist",
88
- "adminServiceError.49145": "Pass does not exist",
89
- "adminServiceError.49171": "Invalid season status",
90
- "adminServiceError.49172": "Season is already ended",
91
- "adminServiceError.49173": "Reward code already exists in the Season",
92
- "adminServiceError.49174": "Pass already exists in the season",
93
- "adminServiceError.49175": "Published season already exists in namespace",
94
- "adminServiceError.49176": "Rewards are not provided",
95
- "adminServiceError.49177": "Passes are not provided",
96
- "adminServiceError.49178": "Tiers are not provided",
97
- "adminServiceError.49179": "Failed to delete reward. The Reward is in use.",
98
- "adminServiceError.510103": "This game mode is already exist",
99
- "adminServiceError.70131": "Configuration does not exist",
100
- "adminServiceError.70132": "Configuration already exist",
101
- "adminServiceError.70330": "Sorry, we are unable to process this request",
102
- "adminServiceError.70331": "Configuration does not exist",
103
- "adminServiceError.70334": "Statistic value is not decreasable.",
104
- "adminServiceError.70335": "User statistic item does not exist",
105
- "adminServiceError.70336": "User statistic item already exist",
106
- "adminServiceError.70337": "You've reached the max value for statistic",
107
- "adminServiceError.771403": "Tag Name already exists. Please try another one",
108
- "adminServiceError.771703": "Type Name already exists. Please try another one",
109
- "adminServiceError.771904": "Type name already exists. Please try another one",
110
- "adminServiceError.772804": "Tag Name already exists. Please try another one",
111
- "adminServiceError.84103": "Reason group name already exists. Please try another one",
112
- "adminServiceError.12275": "The default value must be within range of Min. Value & Max. Value",
113
- "serviceError.10130": "Sorry, we are unable to process this request",
114
- "serviceError.10133": "Sorry, you must enter a new email address",
115
- "serviceError.10136": "Sorry, you've entered the codes incorrectly too many times. Please request a new one",
116
- "serviceError.10137": "Sorry, the code you entered is expired. Please request a new one.",
117
- "serviceError.10138": "Sorry, the code you entered is invalid. Please try again.",
118
- "serviceError.10139": "Oops, it seems you haven't play the game yet. Please play the game before proceed with this action",
119
- "serviceError.10140": "User is already verified",
120
- "serviceError.10142": "Sorry, your new password cannot be the same as the old one",
121
- "serviceError.10143": "The password that you entered does not match. Please make sure you input the correct password",
122
- "serviceError.10148": "Something went wrong. For more information please contact our support team",
123
- "serviceError.10149": "Something went wrong. For more information please contact our support team",
124
- "serviceError.10152": "Something went wrong. For more information please contact our support team",
125
- "serviceError.10153": "User already exists",
126
- "serviceError.10154": "Country does not exist",
127
- "serviceError.10170": "Oops, you are already linked your email address to your account.",
128
- "serviceError.10171": "This email address is not registered",
129
- "serviceError.10172": "Sorry, your account is already linked.",
130
- "serviceError.10173": "Sorry, platform account has already linked with another user account.",
131
- "serviceError.10174": "Oops, the platform you are trying to connect does not exist. Please try another platform.",
132
- "serviceError.10177": "That username has been taken. Please choose another.",
133
- "serviceError.10180": "The invitation link has expired. Please request a new link.",
134
- "serviceError.10190": "QR Code expired. Please reload the page and repeat the process to enable the authenticator app.",
135
- "serviceError.11132": "You've reached the maximum upload limit.",
136
- "serviceError.11233": "Error: Country group does not exist. If you see this error, please contact our support team for immediate assistance",
137
- "serviceError.11337": "Error: User profile does not exist. If you see this error, please contact our support team for immediate assistance",
138
- "serviceError.11440": "Error: User profile does not exist. If you see this error, please contact our support team for immediate assistance",
139
- "serviceError.11441": "Error: User profile is already exist. If you see this error, please contact our support team for immediate assistance",
140
- "serviceError.13122": "The password that you entered does not match. Please make sure you input the correct password",
141
- "serviceError.20000": "Something went wrong. For more information please contact our support team",
142
- "serviceError.20001": "Sorry, the page you want to access is publicly unavailable.",
143
- "serviceError.20002": "Please correct the errors in the form to proceed",
144
- "serviceError.20007": "You have requested too many codes. Please try again later.",
145
- "serviceError.20008": "User does not exist",
146
- "serviceError.20013": "Sorry, you have no permission to do this action or access this page",
147
- "serviceError.20017": "Oops, it seems you haven't play the game yet. Please play the game before proceed with this action",
148
- "serviceError.20019": "Something went wrong. For more information please contact our support team",
149
- "serviceError.20022": "Something went wrong. For more information please contact our support team",
150
- "serviceError.30121": "Failed to import store. Imported file is invalid. Please try again.",
151
- "serviceError.30122": "Failed to publish store. Language/Region does not match. Please try again.",
152
- "serviceError.30171": "Failed to update store. Language/Region does not match. Please try again.",
153
- "serviceError.30172": "Failed to update store. Language/Region does not match. Please try again.",
154
- "serviceError.31177": "You cannot make this purchase because it includes one or more items you already own.",
155
- "serviceError.35121": "The maximum amount per day has been exceeded.",
156
- "serviceError.35122": "The maximum amount per transaction has been exceeded.",
157
- "serviceError.35125": "The maximum balance amount has been exceeded.",
158
- "serviceError.38121": "You can only purchase 1 copy of this item.",
159
- "serviceError.38171": "Sorry, you already own this item",
160
- "serviceError.31145": "Sorry! The item you've selected doesn't exist in this Option Box.",
161
- "serviceError.unknown": "Failed to complete the request"
162
- }
@@ -1,37 +0,0 @@
1
- {
2
- "serviceError.10130": "Lo sentimos. No se ha podido procesar la solicitud.",
3
- "serviceError.10133": "Debes introducir una nueva dirección de correo.",
4
- "serviceError.10136": "Has introducido el código incorrecto demasiadas veces. Solicita uno nuevo.",
5
- "serviceError.10137": "El código que has introducido ha caducado. Solicita uno nuevo.",
6
- "serviceError.10138": "El código que has introducido no es válido. Inténtalo de nuevo.",
7
- "serviceError.10139": "¡Vaya! Parece que aún no has jugado al juego. Antes de proceder con esta acción, debes jugar al juego.",
8
- "serviceError.10140": "El usuario ya está verificado.",
9
- "serviceError.10142": "Tu nueva contraseña no puede ser la misma que la antigua.",
10
- "serviceError.10143": "La contraseña que has introducido no coincide. Comprueba que hayas escrito la contraseña correcta.",
11
- "serviceError.10148": "Ha habido un problema. Para más información, ponte en contacto con nuestro equipo de atención al cliente.",
12
- "serviceError.10149": "Ha habido un problema. Para más información, ponte en contacto con nuestro equipo de atención al cliente.",
13
- "serviceError.10152": "Ha habido un problema. Para más información, ponte en contacto con nuestro equipo de atención al cliente.",
14
- "serviceError.10153": "El usuario ya existe.",
15
- "serviceError.10154": "El país no existe.",
16
- "serviceError.10170": "Ya has vinculado tu dirección de correo a tu cuenta.",
17
- "serviceError.10171": "Este correo electrónico no está registrado.",
18
- "serviceError.10172": "Tu cuenta ya está vinculada.",
19
- "serviceError.10173": "La cuenta de la plataforma ya se ha vinculado a otra cuenta de usuario.",
20
- "serviceError.10174": "¡Vaya! La plataforma a la que intentas conectarte no existe. Inténtalo con otra plataforma.",
21
- "serviceError.10177": "El nombre de usuario ya está en uso. Elige otro nombre distinto.",
22
- "serviceError.11233": "Error: El grupo del país no existe. Ponte en contacto con el equipo de atención al cliente para que te ayuden a solucionar el problema.",
23
- "serviceError.11337": "Error: El perfil de usuario no existe. Ponte en contacto con el equipo de atención al cliente para que te ayuden a solucionar el problema.",
24
- "serviceError.11440": "Error: El perfil de usuario no existe. Ponte en contacto con el equipo de atención al cliente para que te ayuden a solucionar el problema.",
25
- "serviceError.11441": "Error: El perfil de usuario ya existe. Ponte en contacto con el equipo de atención al cliente para que te ayuden a solucionar el problema.",
26
- "serviceError.13122": "La contraseña que has introducido no coincide. Comprueba que hayas escrito la contraseña correcta.",
27
- "serviceError.20000": "Ha habido un problema. Para más información, ponte en contacto con nuestro equipo de atención al cliente.",
28
- "serviceError.20001": "La página a la que intentas acceder no es de acceso público.",
29
- "serviceError.20002": "Corrige los errores del formulario antes de continuar.",
30
- "serviceError.20007": "Has solicitado demasiados códigos. Inténtalo más tarde.",
31
- "serviceError.20008": "El usuario no existe.",
32
- "serviceError.20013": "No tienes permiso para realizar esta acción o acceder a esta página.",
33
- "serviceError.20017": "¡Vaya! Parece que aún no has jugado al juego. Antes de proceder con esta acción, debes jugar al juego.",
34
- "serviceError.20019": "Ha habido un problema. Para más información, ponte en contacto con nuestro equipo de atención al cliente.",
35
- "serviceError.20022": "Ha habido un problema. Para más información, ponte en contacto con nuestro equipo de atención al cliente.",
36
- "serviceError.unknown": "Error al completar la solicitud."
37
- }