From 65ce27ee7ebb9c48222772dd90d05a9eda867542 Mon Sep 17 00:00:00 2001 From: Tejasv Sharma <37572049+TejasvOnly@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:48:21 +0530 Subject: [PATCH] fix: xrp lang translations (#597) Co-authored-by: Muzaffar Ahmad Bhat Co-authored-by: Muzaffar Ahmad Bhat <90454199+muzaffarbhat07@users.noreply.github.com> --- .changeset/loud-pillows-relax.md | 6 ++++++ .../src/i18n/lang/ar-AE.json | 20 +++++++++---------- .../src/i18n/lang/de-DE.json | 20 +++++++++---------- .../src/i18n/lang/id-ID.json | 20 +++++++++---------- .../src/i18n/lang/zh-CN.json | 20 +++++++++---------- .../src/types/serverCoinError/index.ts | 3 ++- packages/cysync-core/src/utils/error/index.ts | 10 +++------- pnpm-lock.yaml | 2 +- 8 files changed, 52 insertions(+), 49 deletions(-) create mode 100644 .changeset/loud-pillows-relax.md diff --git a/.changeset/loud-pillows-relax.md b/.changeset/loud-pillows-relax.md new file mode 100644 index 000000000..8566e6e61 --- /dev/null +++ b/.changeset/loud-pillows-relax.md @@ -0,0 +1,6 @@ +--- +'@cypherock/cysync-core-constants': minor +'@cypherock/cysync-core': patch +--- + +added language translations for xrp strings diff --git a/packages/cysync-core-constants/src/i18n/lang/ar-AE.json b/packages/cysync-core-constants/src/i18n/lang/ar-AE.json index 3781f1cfc..da227aa51 100644 --- a/packages/cysync-core-constants/src/i18n/lang/ar-AE.json +++ b/packages/cysync-core-constants/src/i18n/lang/ar-AE.json @@ -259,8 +259,8 @@ "error": "أموال غير كافية", "zeroAmount": "لا يمكن أن يكون المبلغ صفرًا", "notOverDustThreshold": "المبلغ أقل من الحد الأدنى", - "amountBelowXrpReserve": "", - "balanceBelowXrpReserve": "" + "amountBelowXrpReserve": "عنوان المستلم غير نشط. أرسل ما لا يقل عن 10 XRP لتنشيطه.", + "balanceBelowXrpReserve": "لا يمكن أن يكون الرصيد أقل من 10 XRP" }, "fees": { "title": "الرسوم", @@ -272,13 +272,13 @@ "error": "تم تجاوز الحد الأقصى للحرف (120 حرفاً)" }, "destinationTag": { - "label": "", - "placeholder": "", - "error": "" + "label": "علامة الوجهة", + "placeholder": "اختياري", + "error": "القيمة مرتفعة جدًا" }, "warning": "قد تلغى المعاملة إذا كانت الرسوم منخفضة جدًا", "feeError": "المعاملة ذات الرسوم 0 غير مسموح بها", - "feeBelowMinError": "", + "feeBelowMinError": "ستفشل المعاملة مع رسم أقل من الحد الأدنى", "notEnoughBalance": "أموال غير كافية لإجراء المعاملة", "toggleText": { "replace": "السماح باستبدال المعاملة (استبدال برسوم)", @@ -295,7 +295,7 @@ "network": "رسوم الشبكة", "debit": "المبلغ الإجمالي الذي سيتم خصمه", "remarks": "ملاحظات شخصية", - "destinationTag": "" + "destinationTag": "علامة الوجهة" }, "finalMessage": { "button": "تحقق من المعاملات", @@ -362,7 +362,7 @@ "optimism": "L2 " }, "remarks": "ملاحظات شخصية", - "destinationTag": "" + "destinationTag": "علامة الوجهة" }, "noData": { "text": "لا توجد تعاملات حتى الآن", @@ -1032,8 +1032,8 @@ "serverCoinErrors": { "default": { "DEF_0000": { - "heading": "Something went wrong", - "subtext": "Try again and if the problem persists, contact Cypherock support for assistance" + "heading": "حدث خطأ ما", + "subtext": "حاول مرة أخرى وإذا استمرت المشكلة، اتصل بدعم Cypherock للحصول على المساعدة" } } }, diff --git a/packages/cysync-core-constants/src/i18n/lang/de-DE.json b/packages/cysync-core-constants/src/i18n/lang/de-DE.json index 61acc7c45..c8f817299 100644 --- a/packages/cysync-core-constants/src/i18n/lang/de-DE.json +++ b/packages/cysync-core-constants/src/i18n/lang/de-DE.json @@ -259,8 +259,8 @@ "error": "Unzureichende Mittel", "zeroAmount": "Betrag kann nicht null sein", "notOverDustThreshold": "Betrag ist geringer als dust limit", - "amountBelowXrpReserve": "", - "balanceBelowXrpReserve": "" + "amountBelowXrpReserve": "Empfängeradresse ist inaktiv. Senden Sie mindestens 10 XRP, um sie zu aktivieren.", + "balanceBelowXrpReserve": "Das Guthaben kann 10 XRP nicht unterschreiten" }, "fees": { "title": "Gebühren", @@ -272,13 +272,13 @@ "error": "Maximale Zeichengrenze überschritten (120 Zeichen)" }, "destinationTag": { - "label": "", - "placeholder": "", - "error": "" + "label": "Ziel-Tag", + "placeholder": "Optional", + "error": "Wert zu hoch" }, "warning": "Die Transaktion könnte abgebrochen werden, wenn die Gebühren sehr niedrig sind", "feeError": "Transaktionen ohne Gebühr sind nicht erlaubt", - "feeBelowMinError": "", + "feeBelowMinError": "Transaktion mit einer Gebühr unterhalb des Minimums wird fehlschlagen", "notEnoughBalance": "Unzureichende Mittel für die Transaktion", "toggleText": { "replace": "Erlauben Sie, die Transaktion zu ersetzen (Replace by fees)", @@ -295,7 +295,7 @@ "network": "Netzwerkgebühr", "debit": "Gesamtbetrag", "remarks": "Persönliche Notizen", - "destinationTag": "" + "destinationTag": "Ziel-Tag" }, "finalMessage": { "button": "Transaktionen prüfen", @@ -362,7 +362,7 @@ "optimism": "L2 " }, "remarks": "Persönliche Notizen", - "destinationTag": "" + "destinationTag": "Ziel-Tag" }, "noData": { "text": "Noch keine Transaktionen", @@ -1037,8 +1037,8 @@ "serverCoinErrors": { "default": { "DEF_0000": { - "heading": "Something went wrong", - "subtext": "Try again and if the problem persists, contact Cypherock support for assistance" + "heading": "Etwas ist schief gelaufen", + "subtext": "Versuchen Sie es erneut, und wenn das Problem weiterhin besteht, kontaktieren Sie den Cypherock-Support für Unterstützung." } } }, diff --git a/packages/cysync-core-constants/src/i18n/lang/id-ID.json b/packages/cysync-core-constants/src/i18n/lang/id-ID.json index 354a9eeb0..c1f95e733 100644 --- a/packages/cysync-core-constants/src/i18n/lang/id-ID.json +++ b/packages/cysync-core-constants/src/i18n/lang/id-ID.json @@ -259,8 +259,8 @@ "error": "Dana tidak mencukupi", "zeroAmount": "Jumlah tidak boleh nol", "notOverDustThreshold": "Jumlah lebih rendah dari dust limit", - "amountBelowXrpReserve": "", - "balanceBelowXrpReserve": "" + "amountBelowXrpReserve": "Alamat penerima tidak aktif. Kirim setidaknya 10 XRP untuk mengaktifkannya.", + "balanceBelowXrpReserve": "Saldo tidak boleh kurang dari 10 XRP" }, "fees": { "title": "Biaya", @@ -272,13 +272,13 @@ "error": "Batas karakter maksimum terlampaui (120 karakter)" }, "destinationTag": { - "label": "", - "placeholder": "", - "error": "" + "label": "Tag Tujuan", + "placeholder": "Opsional", + "error": "Nilai terlalu tinggi" }, "warning": "Transaksi bisa dibatalkan jika biaya terlalu rendah", "feeError": "Transaksi dengan 0 fee tidak diizinkan", - "feeBelowMinError": "", + "feeBelowMinError": "Transaksi dengan fee yang lebih rendah dari minimum akan gagal", "notEnoughBalance": "Dana tidak mencukupi untuk transaksi", "toggleText": { "replace": "Izinkan transaksi untuk digantikan (Ganti dengan biaya)", @@ -295,7 +295,7 @@ "network": "Biaya Jaringan", "debit": "Total yang didebet", "remarks": "Catatan Pribadi", - "destinationTag": "" + "destinationTag": "Tag Tujuan" }, "finalMessage": { "button": "Periksa transaksi", @@ -362,7 +362,7 @@ "optimism": "L2 " }, "remarks": "Catatan Pribadi", - "destinationTag": "" + "destinationTag": "Tag Tujuan" }, "noData": { "text": "Belum ada transaksi", @@ -1037,8 +1037,8 @@ "serverCoinErrors": { "default": { "DEF_0000": { - "heading": "Something went wrong", - "subtext": "Try again and if the problem persists, contact Cypherock support for assistance" + "heading": "Terjadi kesalahan", + "subtext": "Coba lagi dan jika masalah berlanjut, hubungi dukungan Cypherock untuk bantuan" } } }, diff --git a/packages/cysync-core-constants/src/i18n/lang/zh-CN.json b/packages/cysync-core-constants/src/i18n/lang/zh-CN.json index 644d1f936..ded00b4ed 100644 --- a/packages/cysync-core-constants/src/i18n/lang/zh-CN.json +++ b/packages/cysync-core-constants/src/i18n/lang/zh-CN.json @@ -259,8 +259,8 @@ "error": "资金不足", "zeroAmount": "金额不能为零", "notOverDustThreshold": "金额低于 dust limit", - "amountBelowXrpReserve": "", - "balanceBelowXrpReserve": "" + "amountBelowXrpReserve": "收件人地址未激活。发送至少 10 XRP 以激活。", + "balanceBelowXrpReserve": "余额不能低于 10 XRP" }, "fees": { "title": "费用", @@ -272,13 +272,13 @@ "error": "超过最大字符限制 (120 个字符)" }, "destinationTag": { - "label": "", - "placeholder": "", - "error": "" + "label": "目标标签", + "placeholder": "可选", + "error": "值过高" }, "warning": "如果 fee 非常低,交易可能会被取消", "feeError": "不允许 0 fee 的交易", - "feeBelowMinError": "", + "feeBelowMinError": "低于最低费用的交易将失败", "notEnoughBalance": "交易资金不足", "toggleText": { "replace": "允许替换交易(通过 fee 替换)", @@ -295,7 +295,7 @@ "network": "网络费用", "debit": "总扣款", "remarks": "个人笔记", - "destinationTag": "" + "destinationTag": "目标标签" }, "finalMessage": { "button": "检查交易", @@ -362,7 +362,7 @@ "optimism": "L2 " }, "remarks": "个人笔记", - "destinationTag": "" + "destinationTag": "目标标签" }, "noData": { "text": "暂无交易记录", @@ -1032,8 +1032,8 @@ "serverCoinErrors": { "default": { "DEF_0000": { - "heading": "Something went wrong", - "subtext": "Try again and if the problem persists, contact Cypherock support for assistance" + "heading": "出现问题", + "subtext": "请重试,如果问题仍然存在,请联系 Cypherock 支持以获取帮助" } } }, diff --git a/packages/cysync-core-constants/src/types/serverCoinError/index.ts b/packages/cysync-core-constants/src/types/serverCoinError/index.ts index 3c25ea943..a7b53582d 100644 --- a/packages/cysync-core-constants/src/types/serverCoinError/index.ts +++ b/packages/cysync-core-constants/src/types/serverCoinError/index.ts @@ -13,7 +13,8 @@ export type CoinFamilyWithDefault = export enum DefaultCoinErrorType { DEFAULT = 'DEF_0000', } -// fill this variable as u define coin errors: ServerCoinErrorTypes = DefaultErrorType | XrpErrorType | BtcErrorType | EvmErrorType + +// fill this variable as u define coin errors: ServerCoinErrorTypes = DefaultErrorType | XrpServerErrorType | BtcServerErrorType | EvmServerErrorType export type ServerCoinErrorTypes = DefaultCoinErrorType; interface ServerCoinErrorParams { diff --git a/packages/cysync-core/src/utils/error/index.ts b/packages/cysync-core/src/utils/error/index.ts index 4ee76c35c..6050816d0 100644 --- a/packages/cysync-core/src/utils/error/index.ts +++ b/packages/cysync-core/src/utils/error/index.ts @@ -32,11 +32,7 @@ export * from './types'; */ const identifyServerErrors = (error: any) => { if (error?.isAxiosError) { - if ( - error.response && - error.response.data?.coinError && - error.response.data?.coinErrorCode - ) { + if (error.response && error.response.data?.coinErrorCode) { return new ServerCoinError({ coinFamily: error.response.data.coinFamily, code: error.response.data.coinErrorCode, @@ -117,10 +113,10 @@ export const getParsedError = (params: { heading = errorToParse.message ?? (serverCoinErrors && - serverCoinErrors[errorToParse.code as ServerCoinErrorTypes].heading); + serverCoinErrors[errorToParse.code as ServerCoinErrorTypes]?.heading); subtext = serverCoinErrors && - serverCoinErrors[errorToParse.code as ServerCoinErrorTypes].subtext; + serverCoinErrors[errorToParse.code as ServerCoinErrorTypes]?.subtext; details = getServerCoinErrorHandlingDetails(errorToParse.code) ?? details; } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f44126a0..93b5a2202 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -19654,7 +19654,7 @@ packages: pretty-format: 29.7.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@18.15.11)(typescript@4.9.5) + ts-node: 10.9.1(@types/node@20.5.1)(typescript@4.9.5) transitivePeerDependencies: - babel-plugin-macros - supports-color