Skip to content

Commit

Permalink
fix: xrp lang translations (#597)
Browse files Browse the repository at this point in the history
Co-authored-by: Muzaffar Ahmad Bhat <[email protected]>
Co-authored-by: Muzaffar Ahmad Bhat <[email protected]>
  • Loading branch information
3 people authored Nov 11, 2024
1 parent 2a573ae commit 65ce27e
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 49 deletions.
6 changes: 6 additions & 0 deletions .changeset/loud-pillows-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@cypherock/cysync-core-constants': minor
'@cypherock/cysync-core': patch
---

added language translations for xrp strings
20 changes: 10 additions & 10 deletions packages/cysync-core-constants/src/i18n/lang/ar-AE.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@
"error": "أموال غير كافية",
"zeroAmount": "لا يمكن أن يكون المبلغ صفرًا",
"notOverDustThreshold": "المبلغ أقل من الحد الأدنى",
"amountBelowXrpReserve": "",
"balanceBelowXrpReserve": ""
"amountBelowXrpReserve": "عنوان المستلم غير نشط. أرسل ما لا يقل عن 10 XRP لتنشيطه.",
"balanceBelowXrpReserve": "لا يمكن أن يكون الرصيد أقل من 10 XRP"
},
"fees": {
"title": "الرسوم",
Expand All @@ -272,13 +272,13 @@
"error": "تم تجاوز الحد الأقصى للحرف (120 حرفاً)"
},
"destinationTag": {
"label": "",
"placeholder": "",
"error": ""
"label": "علامة الوجهة",
"placeholder": "اختياري",
"error": "القيمة مرتفعة جدًا"
},
"warning": "قد تلغى المعاملة إذا كانت الرسوم منخفضة جدًا",
"feeError": "المعاملة ذات الرسوم 0 غير مسموح بها",
"feeBelowMinError": "",
"feeBelowMinError": "ستفشل المعاملة مع رسم أقل من الحد الأدنى",
"notEnoughBalance": "أموال غير كافية لإجراء المعاملة",
"toggleText": {
"replace": "السماح باستبدال المعاملة (استبدال برسوم)",
Expand All @@ -295,7 +295,7 @@
"network": "رسوم الشبكة",
"debit": "المبلغ الإجمالي الذي سيتم خصمه",
"remarks": "ملاحظات شخصية",
"destinationTag": ""
"destinationTag": "علامة الوجهة"
},
"finalMessage": {
"button": "تحقق من المعاملات",
Expand Down Expand Up @@ -362,7 +362,7 @@
"optimism": "L2 "
},
"remarks": "ملاحظات شخصية",
"destinationTag": ""
"destinationTag": "علامة الوجهة"
},
"noData": {
"text": "لا توجد تعاملات حتى الآن",
Expand Down Expand Up @@ -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 للحصول على المساعدة"
}
}
},
Expand Down
20 changes: 10 additions & 10 deletions packages/cysync-core-constants/src/i18n/lang/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)",
Expand All @@ -295,7 +295,7 @@
"network": "Netzwerkgebühr",
"debit": "Gesamtbetrag",
"remarks": "Persönliche Notizen",
"destinationTag": ""
"destinationTag": "Ziel-Tag"
},
"finalMessage": {
"button": "Transaktionen prüfen",
Expand Down Expand Up @@ -362,7 +362,7 @@
"optimism": "L2 "
},
"remarks": "Persönliche Notizen",
"destinationTag": ""
"destinationTag": "Ziel-Tag"
},
"noData": {
"text": "Noch keine Transaktionen",
Expand Down Expand Up @@ -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."
}
}
},
Expand Down
20 changes: 10 additions & 10 deletions packages/cysync-core-constants/src/i18n/lang/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)",
Expand All @@ -295,7 +295,7 @@
"network": "Biaya Jaringan",
"debit": "Total yang didebet",
"remarks": "Catatan Pribadi",
"destinationTag": ""
"destinationTag": "Tag Tujuan"
},
"finalMessage": {
"button": "Periksa transaksi",
Expand Down Expand Up @@ -362,7 +362,7 @@
"optimism": "L2 "
},
"remarks": "Catatan Pribadi",
"destinationTag": ""
"destinationTag": "Tag Tujuan"
},
"noData": {
"text": "Belum ada transaksi",
Expand Down Expand Up @@ -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"
}
}
},
Expand Down
20 changes: 10 additions & 10 deletions packages/cysync-core-constants/src/i18n/lang/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@
"error": "资金不足",
"zeroAmount": "金额不能为零",
"notOverDustThreshold": "金额低于 dust limit",
"amountBelowXrpReserve": "",
"balanceBelowXrpReserve": ""
"amountBelowXrpReserve": "收件人地址未激活。发送至少 10 XRP 以激活。",
"balanceBelowXrpReserve": "余额不能低于 10 XRP"
},
"fees": {
"title": "费用",
Expand All @@ -272,13 +272,13 @@
"error": "超过最大字符限制 (120 个字符)"
},
"destinationTag": {
"label": "",
"placeholder": "",
"error": ""
"label": "目标标签",
"placeholder": "可选",
"error": "值过高"
},
"warning": "如果 fee 非常低,交易可能会被取消",
"feeError": "不允许 0 fee 的交易",
"feeBelowMinError": "",
"feeBelowMinError": "低于最低费用的交易将失败",
"notEnoughBalance": "交易资金不足",
"toggleText": {
"replace": "允许替换交易(通过 fee 替换)",
Expand All @@ -295,7 +295,7 @@
"network": "网络费用",
"debit": "总扣款",
"remarks": "个人笔记",
"destinationTag": ""
"destinationTag": "目标标签"
},
"finalMessage": {
"button": "检查交易",
Expand Down Expand Up @@ -362,7 +362,7 @@
"optimism": "L2 "
},
"remarks": "个人笔记",
"destinationTag": ""
"destinationTag": "目标标签"
},
"noData": {
"text": "暂无交易记录",
Expand Down Expand Up @@ -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 支持以获取帮助"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 3 additions & 7 deletions packages/cysync-core/src/utils/error/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 65ce27e

Please sign in to comment.