From f35f729c05cef09c071edd5b23c51f8b388f5927 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Tue, 7 Feb 2023 19:13:24 +0330 Subject: [PATCH 01/13] Remove the Token Symbol length limit. #9243 --- app/_locales/en/messages.json | 3 +++ ui/pages/import-token/import-token.component.js | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 7572190c18bc..3c8b58f0ce2c 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4422,6 +4422,9 @@ "symbolBetweenZeroTwelve": { "message": "Symbol must be 11 characters or fewer." }, + "symbolMustBeNonZero": { + "message": "Symbol length must be > 0." + }, "tenPercentIncreased": { "message": "10% increase" }, diff --git a/ui/pages/import-token/import-token.component.js b/ui/pages/import-token/import-token.component.js index ffda0ca122e4..997d0cd328cf 100644 --- a/ui/pages/import-token/import-token.component.js +++ b/ui/pages/import-token/import-token.component.js @@ -367,9 +367,8 @@ class ImportToken extends Component { const symbolLength = customSymbol.length; let customSymbolError = null; - if (symbolLength <= 0 || symbolLength >= 12) { - customSymbolError = this.context.t('symbolBetweenZeroTwelve'); - } + if (symbolLength == 0) + customSymbolError = this.context.t('symbolMustBeNonZero'); this.setState({ customSymbol, customSymbolError }); } From 8069c0125f4c9d4b2cad873df14a4b173d4d6a55 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Tue, 7 Feb 2023 19:52:54 +0330 Subject: [PATCH 02/13] To prevent misuse, limit the length to 100 --- app/_locales/am/messages.json | 4 ++-- app/_locales/ar/messages.json | 4 ++-- app/_locales/bg/messages.json | 4 ++-- app/_locales/bn/messages.json | 4 ++-- app/_locales/ca/messages.json | 4 ++-- app/_locales/cs/messages.json | 4 ++-- app/_locales/da/messages.json | 4 ++-- app/_locales/de/messages.json | 4 ++-- app/_locales/el/messages.json | 4 ++-- app/_locales/en/messages.json | 7 ++----- app/_locales/es/messages.json | 4 ++-- app/_locales/es_419/messages.json | 4 ++-- app/_locales/et/messages.json | 4 ++-- app/_locales/fa/messages.json | 4 ++-- app/_locales/fi/messages.json | 4 ++-- app/_locales/fil/messages.json | 4 ++-- app/_locales/fr/messages.json | 4 ++-- app/_locales/he/messages.json | 4 ++-- app/_locales/hi/messages.json | 4 ++-- app/_locales/hn/messages.json | 4 ++-- app/_locales/hr/messages.json | 4 ++-- app/_locales/ht/messages.json | 4 ++-- app/_locales/hu/messages.json | 2 +- app/_locales/id/messages.json | 4 ++-- app/_locales/it/messages.json | 2 +- app/_locales/ja/messages.json | 2 +- app/_locales/kn/messages.json | 2 +- app/_locales/ko/messages.json | 2 +- app/_locales/lt/messages.json | 4 ++-- app/_locales/lv/messages.json | 4 ++-- app/_locales/ms/messages.json | 4 ++-- app/_locales/nl/messages.json | 4 ++-- app/_locales/no/messages.json | 4 ++-- app/_locales/ph/messages.json | 4 ++-- app/_locales/pl/messages.json | 4 ++-- app/_locales/pt/messages.json | 4 ++-- app/_locales/pt_BR/messages.json | 4 ++-- app/_locales/ro/messages.json | 4 ++-- app/_locales/ru/messages.json | 4 ++-- app/_locales/sk/messages.json | 2 +- app/_locales/sl/messages.json | 4 ++-- app/_locales/sr/messages.json | 4 ++-- app/_locales/sv/messages.json | 4 ++-- app/_locales/sw/messages.json | 4 ++-- app/_locales/ta/messages.json | 4 ++-- app/_locales/th/messages.json | 4 ++-- app/_locales/tl/messages.json | 4 ++-- app/_locales/tr/messages.json | 4 ++-- app/_locales/uk/messages.json | 4 ++-- app/_locales/vi/messages.json | 4 ++-- app/_locales/zh_CN/messages.json | 2 +- app/_locales/zh_TW/messages.json | 4 ++-- ui/pages/import-token/import-token.component.js | 4 ++-- 53 files changed, 99 insertions(+), 102 deletions(-) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index c7bb730e55e5..ad084e61ae97 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -723,8 +723,8 @@ "symbol": { "message": "ምልክት" }, - "symbolBetweenZeroTwelve": { - "message": "ምልክቱ 11 ቁምፊዎች ወይም ከዚያ ያነሰ መሆን አለበት።" + "symbolBetweenZeroHundred": { + "message": "ምልክቱ 100 ቁምፊዎች ወይም ከዚያ ያነሰ መሆን አለበት።" }, "terms": { "message": "የአጠቃቀም ደንቦች" diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 392d7fdfabef..dc426cbe643d 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -735,8 +735,8 @@ "symbol": { "message": "رمز" }, - "symbolBetweenZeroTwelve": { - "message": "يجب أن يكون الرمز 11 حرفًا أو أقل." + "symbolBetweenZeroHundred": { + "message": "يجب أن يكون الرمز 100 حرفًا أو أقل." }, "terms": { "message": "شروط الاستخدام" diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index e4ce863f5439..822b4be0f287 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -734,8 +734,8 @@ "symbol": { "message": "Символ" }, - "symbolBetweenZeroTwelve": { - "message": "Символът трябва да е 11 символа или по-малко." + "symbolBetweenZeroHundred": { + "message": "Символът трябва да е 100 символа или по-малко." }, "terms": { "message": "Условия за ползване" diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 6ba3e132d82d..eb8a2b1a601f 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -732,8 +732,8 @@ "symbol": { "message": "প্রতীক" }, - "symbolBetweenZeroTwelve": { - "message": "প্রতীকটি 11 টি অক্ষর বা তার চেয়ে কম হতে হবে।" + "symbolBetweenZeroHundred": { + "message": "প্রতীকটি 100 টি অক্ষর বা তার চেয়ে কম হতে হবে।" }, "terms": { "message": "ব্যবহারের শর্তাবলী" diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index ab1da7841f7a..0851acd106ec 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -716,8 +716,8 @@ "symbol": { "message": "Símbol" }, - "symbolBetweenZeroTwelve": { - "message": "El símbol ha de tenir com a mínim 11 caràcters." + "symbolBetweenZeroHundred": { + "message": "El símbol ha de tenir com a mínim 100 caràcters." }, "terms": { "message": "Condicions d'ús" diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index 3b82640c9f61..c80a5d92f9ad 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -343,8 +343,8 @@ "supportCenter": { "message": "Navštivte naše centrum podpory" }, - "symbolBetweenZeroTwelve": { - "message": "Symbol musí mít 11 nebo méně znaků." + "symbolBetweenZeroHundred": { + "message": "Symbol musí mít 100 nebo méně znaků." }, "terms": { "message": "Podmínky použití" diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index 733b31dab2b9..c56163b2a38b 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -713,8 +713,8 @@ "switchNetworks": { "message": "Skift Netværk" }, - "symbolBetweenZeroTwelve": { - "message": "Symbolet skal være mindst 11 tegn." + "symbolBetweenZeroHundred": { + "message": "Symbolet skal være mindst 100 tegn." }, "terms": { "message": "Brugsbetingelser" diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index fceaa5ed5fb3..83e3ac180ad4 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Symbol" }, - "symbolBetweenZeroTwelve": { - "message": "Das Symbol darf maximal 11 Zeichen lang sein." + "symbolBetweenZeroHundred": { + "message": "Das Symbol darf maximal 100 Zeichen lang sein." }, "tenPercentIncreased": { "message": "10% Erhöhung" diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index d177839254a8..f3be0c71d34a 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Σύμβολο" }, - "symbolBetweenZeroTwelve": { - "message": "Το σύμβολο πρέπει να είναι τουλάχιστον 11 χαρακτήρες." + "symbolBetweenZeroHundred": { + "message": "Το σύμβολο πρέπει να είναι τουλάχιστον 100 χαρακτήρες." }, "tenPercentIncreased": { "message": "10% αύξηση" diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 3c8b58f0ce2c..ee63a24ec86e 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4419,11 +4419,8 @@ "symbol": { "message": "Symbol" }, - "symbolBetweenZeroTwelve": { - "message": "Symbol must be 11 characters or fewer." - }, - "symbolMustBeNonZero": { - "message": "Symbol length must be > 0." + "symbolBetweenZeroHundred": { + "message": "Symbol must be 100 characters or fewer." }, "tenPercentIncreased": { "message": "10% increase" diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index 0661e837ace3..f374aa2f4566 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroTwelve": { - "message": "El símbolo debe tener 11 caracteres o menos." + "symbolBetweenZeroHundred": { + "message": "El símbolo debe tener 100 caracteres o menos." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 98254c6fce0d..74be982f5d7a 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -2531,8 +2531,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroTwelve": { - "message": "El símbolo debe tener 11 caracteres o menos." + "symbolBetweenZeroHundred": { + "message": "El símbolo debe tener 100 caracteres o menos." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index f9a64457ea99..89a7bc92f2a7 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -728,8 +728,8 @@ "symbol": { "message": "Sümbol" }, - "symbolBetweenZeroTwelve": { - "message": "Sümbol peab olema 11 tähemärki või vähem." + "symbolBetweenZeroHundred": { + "message": "Sümbol peab olema 100 tähemärki või vähem." }, "terms": { "message": "Teenusetingimused" diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 6d61ed44d97d..1af6ce560387 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "سمبول" }, - "symbolBetweenZeroTwelve": { - "message": "نماد باید 11 کاراکتر یا کمتر باشد." + "symbolBetweenZeroHundred": { + "message": "نماد باید 100 کاراکتر یا کمتر باشد." }, "terms": { "message": "شرایط استفاده" diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 0cea114d6682..0ba1b3bbe2f5 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -735,8 +735,8 @@ "symbol": { "message": "Symboli" }, - "symbolBetweenZeroTwelve": { - "message": "Symbolin on oltava 11 merkkiä tai vähemmän." + "symbolBetweenZeroHundred": { + "message": "Symbolin on oltava 100 merkkiä tai vähemmän." }, "terms": { "message": "Käyttöehdot" diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 3f7d43347a64..8bcd3e99b316 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -656,8 +656,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroTwelve": { - "message": "Ang simbolo ay dapat na 11 character o mas kaunti." + "symbolBetweenZeroHundred": { + "message": "Ang simbolo ay dapat na 100 character o mas kaunti." }, "terms": { "message": "Mga Tuntunin ng Paggamit" diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 920ff11a7d39..6fb5dcd8a48e 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Symbole" }, - "symbolBetweenZeroTwelve": { - "message": "Le symbole doit comporter 11 caractères ou moins." + "symbolBetweenZeroHundred": { + "message": "Le symbole doit comporter 100 caractères ou moins." }, "tenPercentIncreased": { "message": "Augmentation de 10 %" diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 4e3ab6b6432d..ab0ea7a2ac96 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -735,8 +735,8 @@ "symbol": { "message": "סמל" }, - "symbolBetweenZeroTwelve": { - "message": "הסמל חייב להיות 11 תווים או פחות." + "symbolBetweenZeroHundred": { + "message": "הסמל חייב להיות 100 תווים או פחות." }, "terms": { "message": "תנאי שימוש" diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 7861fd19e0ee..684f3d751d00 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "प्रतीक" }, - "symbolBetweenZeroTwelve": { - "message": "प्रतीक 11 वर्ण या उससे कम का होना चाहिए।" + "symbolBetweenZeroHundred": { + "message": "प्रतीक 100 वर्ण या उससे कम का होना चाहिए।" }, "tenPercentIncreased": { "message": "10% बढ़ोत्तरी" diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index f94ab181c90d..c03abe5fcda7 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -305,8 +305,8 @@ "supportCenter": { "message": "हमारे सहायता केंद्र पर जाएं" }, - "symbolBetweenZeroTwelve": { - "message": "प्रतीक 11 वर्ण या उससे कम का होना चाहिए।" + "symbolBetweenZeroHundred": { + "message": "प्रतीक 100 वर्ण या उससे कम का होना चाहिए।" }, "terms": { "message": "उपयोग की शर्तें" diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 72c63d3151a8..487197ee2bdb 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -731,8 +731,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroTwelve": { - "message": "Simbol mora biti 11 znakova ili manje." + "symbolBetweenZeroHundred": { + "message": "Simbol mora biti 100 znakova ili manje." }, "terms": { "message": "Odredbe uporabe" diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 5b1aaf04f9d2..9ebc3548d06c 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -524,8 +524,8 @@ "supportCenter": { "message": "Vizite Sant Sipò Nou" }, - "symbolBetweenZeroTwelve": { - "message": "Senbòl yo dwe 11 karaktè oswa mwens." + "symbolBetweenZeroHundred": { + "message": "Senbòl yo dwe 100 karaktè oswa mwens." }, "terms": { "message": "Tèm pou itilize" diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 51270215da9b..8ab5668dad62 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -731,7 +731,7 @@ "symbol": { "message": "Szimbólum" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "A szimbólum 0 és 12 karakter között kell legyen." }, "terms": { diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index dd49e11ed34c..171bb76b9d5b 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroTwelve": { - "message": "Simbol harus terdiri dari 11 karakter atau kurang." + "symbolBetweenZeroHundred": { + "message": "Simbol harus terdiri dari 100 karakter atau kurang." }, "tenPercentIncreased": { "message": "Meningkat 10%" diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index fc9e9a4d1200..2ee9e86a9ef4 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1763,7 +1763,7 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "Il simbolo deve essere lungo tra 0 e 12 caratteri." }, "terms": { diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 6121b09dde46..7c88b976f622 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -3890,7 +3890,7 @@ "symbol": { "message": "シンボル" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "シンボルは11文字以下にする必要があります。" }, "tenPercentIncreased": { diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 77e9199313b3..c00f2084809a 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -738,7 +738,7 @@ "symbol": { "message": "ಚಿಹ್ನೆ" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "ಚಿಹ್ನೆಯು 0 ಮತ್ತು 12 ಅಕ್ಷರಗಳ ನಡುವೆ ಇರಬೇಕು." }, "terms": { diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 61a439b52abf..c8b58a753128 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -3890,7 +3890,7 @@ "symbol": { "message": "기호" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "기호는 11자 이하여야 합니다." }, "tenPercentIncreased": { diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 3b08314312d4..2a000a965cb7 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "Simbolis" }, - "symbolBetweenZeroTwelve": { - "message": "Simbolis turi būti ne ilgesnis nei 11 simbolių." + "symbolBetweenZeroHundred": { + "message": "Simbolis turi būti ne ilgesnis nei 100 simbolių." }, "terms": { "message": "Naudojimo sąlygos" diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 2ffc66e5c00e..a2231db64e76 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -734,8 +734,8 @@ "symbol": { "message": "Simbols" }, - "symbolBetweenZeroTwelve": { - "message": "Simbolā nedrīkst būt vairāk par 11 rakstzīmēm." + "symbolBetweenZeroHundred": { + "message": "Simbolā nedrīkst būt vairāk par 100 rakstzīmēm." }, "terms": { "message": "Lietošanas noteikumi" diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 5c304cd4777e..855416403654 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -718,8 +718,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroTwelve": { - "message": "Simbol mestilah 11 aksara atau kurang." + "symbolBetweenZeroHundred": { + "message": "Simbol mestilah 100 aksara atau kurang." }, "terms": { "message": "Syarat-syarat Penggunaan" diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index fc8a1e7fdfe0..b6e7c7b18c92 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -298,8 +298,8 @@ "supportCenter": { "message": "Bezoek ons ​​ondersteuningscentrum" }, - "symbolBetweenZeroTwelve": { - "message": "Symbool moet 11 tekens of minder zijn." + "symbolBetweenZeroHundred": { + "message": "Symbool moet 100 tekens of minder zijn." }, "terms": { "message": "Gebruiksvoorwaarden" diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 2df0252ef401..5c65e65f4d8e 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -716,8 +716,8 @@ "switchNetworks": { "message": "Bytt nettverk " }, - "symbolBetweenZeroTwelve": { - "message": "Symbolet må være 11 tegn eller færre." + "symbolBetweenZeroHundred": { + "message": "Symbolet må være 100 tegn eller færre." }, "terms": { "message": "Brukervilkår" diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index ca47dc9053c5..9dfab5276d78 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -1708,8 +1708,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroTwelve": { - "message": "Dapat ay 11 character o mas kaunti ang simbolo." + "symbolBetweenZeroHundred": { + "message": "Dapat ay 100 character o mas kaunti ang simbolo." }, "terms": { "message": "Mga Tuntunin ng Paggamit" diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 348798703340..00fe0f381398 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -729,8 +729,8 @@ "switchNetworks": { "message": "Zmień sieci" }, - "symbolBetweenZeroTwelve": { - "message": "Symbol musi mieć maksymalnie 11 znaków." + "symbolBetweenZeroHundred": { + "message": "Symbol musi mieć maksymalnie 100 znaków." }, "terms": { "message": "Regulamin" diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 93adcfea89f4..ffb6f32ddd55 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroTwelve": { - "message": "O símbolo deve ter 11 caracteres ou menos." + "symbolBetweenZeroHundred": { + "message": "O símbolo deve ter 100 caracteres ou menos." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 6c949ccfc1d2..557f59ac05f3 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -2531,8 +2531,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroTwelve": { - "message": "O símbolo deve ter até 11 caracteres." + "symbolBetweenZeroHundred": { + "message": "O símbolo deve ter até 100 caracteres." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index 2ecf4a992950..a2fb8487b17f 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -725,8 +725,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroTwelve": { - "message": "Simbolul trebuie să fie de 11 caractere sau mai puțin." + "symbolBetweenZeroHundred": { + "message": "Simbolul trebuie să fie de 100 caractere sau mai puțin." }, "terms": { "message": "Termeni și condiții" diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 03d546df99e0..4070d8ba0a47 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Символ" }, - "symbolBetweenZeroTwelve": { - "message": "Символ должен состоять из 11 или менее знаков." + "symbolBetweenZeroHundred": { + "message": "Символ должен состоять из 100 или менее знаков." }, "tenPercentIncreased": { "message": "Увеличение на 10%" diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 6b0057045917..222f85c194d6 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -707,7 +707,7 @@ "switchNetworks": { "message": "Prepnúť siete" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "Symbol musí být mezi 0 a 12 znaky." }, "terms": { diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index bbc88645ea71..697f162a491a 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -726,8 +726,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroTwelve": { - "message": "Simbol mora biti največ 11 znakov ali manj." + "symbolBetweenZeroHundred": { + "message": "Simbol mora biti največ 100 znakov ali manj." }, "terms": { "message": "Pogoji uporabe" diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index b95229b5098e..436bc1008165 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -729,8 +729,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroTwelve": { - "message": "Simbol mora biti 11 znakova ili manje." + "symbolBetweenZeroHundred": { + "message": "Simbol mora biti 100 znakova ili manje." }, "terms": { "message": "Uslovi korišćenja" diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 75a70e467c30..4ec1908e9de8 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -719,8 +719,8 @@ "switchNetworks": { "message": "Växla nätverk" }, - "symbolBetweenZeroTwelve": { - "message": "Symbolen måste vara 11 tecken eller färre." + "symbolBetweenZeroHundred": { + "message": "Symbolen måste vara 100 tecken eller färre." }, "terms": { "message": "Användarvillkor" diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 5ec90f52f210..42c5643a0180 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -716,8 +716,8 @@ "symbol": { "message": "Ishara" }, - "symbolBetweenZeroTwelve": { - "message": "Alama lazima iwe na herufi 11 au chache." + "symbolBetweenZeroHundred": { + "message": "Alama lazima iwe na herufi 100 au chache." }, "terms": { "message": "Masharti ya Matumizi" diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index 53b5a906ede2..bd00ca6e332c 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -413,8 +413,8 @@ "supportCenter": { "message": "எங்கள் ஆதரவு மையத்தைப் பார்வையிடவும்" }, - "symbolBetweenZeroTwelve": { - "message": "கசின்னம் 11 எழுத்துக்கள் அல்லது குறைவாக இருக்க வேண்டும்." + "symbolBetweenZeroHundred": { + "message": "கசின்னம் 100 எழுத்துக்கள் அல்லது குறைவாக இருக்க வேண்டும்." }, "terms": { "message": "பயன்பாட்டு விதிமுறைகளை" diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 23e312863fbd..509c572dcfd2 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -374,8 +374,8 @@ "symbol": { "message": "เครื่องหมาย" }, - "symbolBetweenZeroTwelve": { - "message": "สัญลักษณ์จะต้องมีความยาว 11 ตัวอักษร" + "symbolBetweenZeroHundred": { + "message": "สัญลักษณ์จะต้องมีความยาว 100 ตัวอักษร" }, "terms": { "message": "ข้อตกลงในการใช้งาน" diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index bb47c161fed5..b49ed306427b 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroTwelve": { - "message": "Dapat ay 11 character o mas kaunti ang simbolo." + "symbolBetweenZeroHundred": { + "message": "Dapat ay 100 character o mas kaunti ang simbolo." }, "tenPercentIncreased": { "message": "10% na dagdag" diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index ebabab1c7855..e18643f03d6d 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Sembol" }, - "symbolBetweenZeroTwelve": { - "message": "Sembol en fazla 11 karakter olmalıdır." + "symbolBetweenZeroHundred": { + "message": "Sembol en fazla 100 karakter olmalıdır." }, "tenPercentIncreased": { "message": "%10 artış" diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index acfaf09abca3..a4b21d7cf7a6 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "Символ" }, - "symbolBetweenZeroTwelve": { - "message": "Символ повинен містити 11 символів або менше." + "symbolBetweenZeroHundred": { + "message": "Символ повинен містити 100 символів або менше." }, "terms": { "message": "Умови використання" diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 120efa397a7e..063aa0a6a962 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Ký hiệu" }, - "symbolBetweenZeroTwelve": { - "message": "Ký hiệu không được dài quá 11 ký tự." + "symbolBetweenZeroHundred": { + "message": "Ký hiệu không được dài quá 100 ký tự." }, "tenPercentIncreased": { "message": "Tăng 10%" diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index ffe567145ead..5bba4e4a4bc2 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -3890,7 +3890,7 @@ "symbol": { "message": "符号" }, - "symbolBetweenZeroTwelve": { + "symbolBetweenZeroHundred": { "message": "符号不得超过11个字符。" }, "tenPercentIncreased": { diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 486ea922d7f2..ab0b02ea1efd 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -1384,8 +1384,8 @@ "symbol": { "message": "符號" }, - "symbolBetweenZeroTwelve": { - "message": "符號不得超過 11 個字元。" + "symbolBetweenZeroHundred": { + "message": "符號不得超過 100 個字元。" }, "terms": { "message": "使用條款" diff --git a/ui/pages/import-token/import-token.component.js b/ui/pages/import-token/import-token.component.js index 997d0cd328cf..645724a93c0f 100644 --- a/ui/pages/import-token/import-token.component.js +++ b/ui/pages/import-token/import-token.component.js @@ -367,8 +367,8 @@ class ImportToken extends Component { const symbolLength = customSymbol.length; let customSymbolError = null; - if (symbolLength == 0) - customSymbolError = this.context.t('symbolMustBeNonZero'); + if (symbolLength == 0 || symbolLength >= 100) + customSymbolError = this.context.t('symbolBetweenZeroHundred'); this.setState({ customSymbol, customSymbolError }); } From 57acbcab8dbde060b22e9450c8a78d0d4b368a75 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Thu, 27 Apr 2023 04:51:00 +0000 Subject: [PATCH 03/13] lint fix --- ui/pages/import-token/import-token.component.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/pages/import-token/import-token.component.js b/ui/pages/import-token/import-token.component.js index 645724a93c0f..436ceb96be9f 100644 --- a/ui/pages/import-token/import-token.component.js +++ b/ui/pages/import-token/import-token.component.js @@ -367,8 +367,9 @@ class ImportToken extends Component { const symbolLength = customSymbol.length; let customSymbolError = null; - if (symbolLength == 0 || symbolLength >= 100) + if (symbolLength === 0 || symbolLength >= 100) { customSymbolError = this.context.t('symbolBetweenZeroHundred'); + } this.setState({ customSymbol, customSymbolError }); } From 84c163504a6118b0c4f1089708d6718e48ffe561 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Mon, 8 May 2023 07:31:34 +0000 Subject: [PATCH 04/13] Make it parametric --- app/_locales/am/messages.json | 4 ++-- app/_locales/ar/messages.json | 4 ++-- app/_locales/bg/messages.json | 4 ++-- app/_locales/bn/messages.json | 4 ++-- app/_locales/ca/messages.json | 4 ++-- app/_locales/cs/messages.json | 4 ++-- app/_locales/da/messages.json | 4 ++-- app/_locales/de/messages.json | 4 ++-- app/_locales/el/messages.json | 4 ++-- app/_locales/en/messages.json | 4 ++-- app/_locales/es/messages.json | 4 ++-- app/_locales/es_419/messages.json | 4 ++-- app/_locales/et/messages.json | 4 ++-- app/_locales/fa/messages.json | 4 ++-- app/_locales/fi/messages.json | 4 ++-- app/_locales/fil/messages.json | 4 ++-- app/_locales/fr/messages.json | 4 ++-- app/_locales/he/messages.json | 4 ++-- app/_locales/hi/messages.json | 4 ++-- app/_locales/hn/messages.json | 4 ++-- app/_locales/hr/messages.json | 4 ++-- app/_locales/ht/messages.json | 4 ++-- app/_locales/hu/messages.json | 4 ++-- app/_locales/id/messages.json | 4 ++-- app/_locales/it/messages.json | 4 ++-- app/_locales/ja/messages.json | 4 ++-- app/_locales/kn/messages.json | 4 ++-- app/_locales/ko/messages.json | 4 ++-- app/_locales/lt/messages.json | 4 ++-- app/_locales/lv/messages.json | 4 ++-- app/_locales/ms/messages.json | 4 ++-- app/_locales/nl/messages.json | 4 ++-- app/_locales/no/messages.json | 4 ++-- app/_locales/ph/messages.json | 4 ++-- app/_locales/pl/messages.json | 4 ++-- app/_locales/pt/messages.json | 4 ++-- app/_locales/pt_BR/messages.json | 4 ++-- app/_locales/ro/messages.json | 4 ++-- app/_locales/ru/messages.json | 4 ++-- app/_locales/sk/messages.json | 4 ++-- app/_locales/sl/messages.json | 4 ++-- app/_locales/sr/messages.json | 4 ++-- app/_locales/sv/messages.json | 4 ++-- app/_locales/sw/messages.json | 4 ++-- app/_locales/ta/messages.json | 4 ++-- app/_locales/th/messages.json | 4 ++-- app/_locales/tl/messages.json | 4 ++-- app/_locales/tr/messages.json | 4 ++-- app/_locales/uk/messages.json | 4 ++-- app/_locales/vi/messages.json | 4 ++-- app/_locales/zh_CN/messages.json | 4 ++-- app/_locales/zh_TW/messages.json | 4 ++-- shared/constants/tokens.js | 5 +++++ ui/pages/import-token/import-token.component.js | 6 +++--- 54 files changed, 112 insertions(+), 107 deletions(-) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index ad084e61ae97..16b86b36324f 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -723,8 +723,8 @@ "symbol": { "message": "ምልክት" }, - "symbolBetweenZeroHundred": { - "message": "ምልክቱ 100 ቁምፊዎች ወይም ከዚያ ያነሰ መሆን አለበት።" + "invalidSymbolLength": { + "message": "ምልክቱ $1 ቁምፊዎች ወይም ከዚያ ያነሰ መሆን አለበት።" }, "terms": { "message": "የአጠቃቀም ደንቦች" diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index dc426cbe643d..040fad4a9fd3 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -735,8 +735,8 @@ "symbol": { "message": "رمز" }, - "symbolBetweenZeroHundred": { - "message": "يجب أن يكون الرمز 100 حرفًا أو أقل." + "invalidSymbolLength": { + "message": "يجب أن يكون الرمز $1 حرفًا أو أقل." }, "terms": { "message": "شروط الاستخدام" diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index 822b4be0f287..1f11648cd6e9 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -734,8 +734,8 @@ "symbol": { "message": "Символ" }, - "symbolBetweenZeroHundred": { - "message": "Символът трябва да е 100 символа или по-малко." + "invalidSymbolLength": { + "message": "Символът трябва да е $1 символа или по-малко." }, "terms": { "message": "Условия за ползване" diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index eb8a2b1a601f..3aa07ca7e8c0 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -732,8 +732,8 @@ "symbol": { "message": "প্রতীক" }, - "symbolBetweenZeroHundred": { - "message": "প্রতীকটি 100 টি অক্ষর বা তার চেয়ে কম হতে হবে।" + "invalidSymbolLength": { + "message": "প্রতীকটি $1 টি অক্ষর বা তার চেয়ে কম হতে হবে।" }, "terms": { "message": "ব্যবহারের শর্তাবলী" diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index 0851acd106ec..12294fbbff19 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -716,8 +716,8 @@ "symbol": { "message": "Símbol" }, - "symbolBetweenZeroHundred": { - "message": "El símbol ha de tenir com a mínim 100 caràcters." + "invalidSymbolLength": { + "message": "El símbol ha de tenir com a mínim $1 caràcters." }, "terms": { "message": "Condicions d'ús" diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index c80a5d92f9ad..8e047ea9dbcc 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -343,8 +343,8 @@ "supportCenter": { "message": "Navštivte naše centrum podpory" }, - "symbolBetweenZeroHundred": { - "message": "Symbol musí mít 100 nebo méně znaků." + "invalidSymbolLength": { + "message": "Symbol musí mít $1 nebo méně znaků." }, "terms": { "message": "Podmínky použití" diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index c56163b2a38b..e8bf1bcba433 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -713,8 +713,8 @@ "switchNetworks": { "message": "Skift Netværk" }, - "symbolBetweenZeroHundred": { - "message": "Symbolet skal være mindst 100 tegn." + "invalidSymbolLength": { + "message": "Symbolet skal være mindst $1 tegn." }, "terms": { "message": "Brugsbetingelser" diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index 83e3ac180ad4..db361d306c9a 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Symbol" }, - "symbolBetweenZeroHundred": { - "message": "Das Symbol darf maximal 100 Zeichen lang sein." + "invalidSymbolLength": { + "message": "Das Symbol darf maximal $1 Zeichen lang sein." }, "tenPercentIncreased": { "message": "10% Erhöhung" diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index f3be0c71d34a..b61db0001c81 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Σύμβολο" }, - "symbolBetweenZeroHundred": { - "message": "Το σύμβολο πρέπει να είναι τουλάχιστον 100 χαρακτήρες." + "invalidSymbolLength": { + "message": "Το σύμβολο πρέπει να είναι τουλάχιστον $1 χαρακτήρες." }, "tenPercentIncreased": { "message": "10% αύξηση" diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index ee63a24ec86e..0866fcfb5f3e 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -4419,8 +4419,8 @@ "symbol": { "message": "Symbol" }, - "symbolBetweenZeroHundred": { - "message": "Symbol must be 100 characters or fewer." + "invalidSymbolLength": { + "message": "Symbol must be $1 characters or fewer." }, "tenPercentIncreased": { "message": "10% increase" diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index f374aa2f4566..1178692e1685 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroHundred": { - "message": "El símbolo debe tener 100 caracteres o menos." + "invalidSymbolLength": { + "message": "El símbolo debe tener $1 caracteres o menos." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index 74be982f5d7a..38ca0f7a89a0 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -2531,8 +2531,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroHundred": { - "message": "El símbolo debe tener 100 caracteres o menos." + "invalidSymbolLength": { + "message": "El símbolo debe tener $1 caracteres o menos." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 89a7bc92f2a7..928664d8ed17 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -728,8 +728,8 @@ "symbol": { "message": "Sümbol" }, - "symbolBetweenZeroHundred": { - "message": "Sümbol peab olema 100 tähemärki või vähem." + "invalidSymbolLength": { + "message": "Sümbol peab olema $1 tähemärki või vähem." }, "terms": { "message": "Teenusetingimused" diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 1af6ce560387..04d7c9993b8b 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "سمبول" }, - "symbolBetweenZeroHundred": { - "message": "نماد باید 100 کاراکتر یا کمتر باشد." + "invalidSymbolLength": { + "message": "نماد باید $1 کاراکتر یا کمتر باشد." }, "terms": { "message": "شرایط استفاده" diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 0ba1b3bbe2f5..a69776f2b7c2 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -735,8 +735,8 @@ "symbol": { "message": "Symboli" }, - "symbolBetweenZeroHundred": { - "message": "Symbolin on oltava 100 merkkiä tai vähemmän." + "invalidSymbolLength": { + "message": "Symbolin on oltava $1 merkkiä tai vähemmän." }, "terms": { "message": "Käyttöehdot" diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 8bcd3e99b316..0a64c4058f08 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -656,8 +656,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroHundred": { - "message": "Ang simbolo ay dapat na 100 character o mas kaunti." + "invalidSymbolLength": { + "message": "Ang simbolo ay dapat na $1 character o mas kaunti." }, "terms": { "message": "Mga Tuntunin ng Paggamit" diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 6fb5dcd8a48e..cac058e27f0a 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Symbole" }, - "symbolBetweenZeroHundred": { - "message": "Le symbole doit comporter 100 caractères ou moins." + "invalidSymbolLength": { + "message": "Le symbole doit comporter $1 caractères ou moins." }, "tenPercentIncreased": { "message": "Augmentation de 10 %" diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index ab0ea7a2ac96..e32c24c2e747 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -735,8 +735,8 @@ "symbol": { "message": "סמל" }, - "symbolBetweenZeroHundred": { - "message": "הסמל חייב להיות 100 תווים או פחות." + "invalidSymbolLength": { + "message": "הסמל חייב להיות $1 תווים או פחות." }, "terms": { "message": "תנאי שימוש" diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 684f3d751d00..08d9d1ca820d 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "प्रतीक" }, - "symbolBetweenZeroHundred": { - "message": "प्रतीक 100 वर्ण या उससे कम का होना चाहिए।" + "invalidSymbolLength": { + "message": "प्रतीक $1 वर्ण या उससे कम का होना चाहिए।" }, "tenPercentIncreased": { "message": "10% बढ़ोत्तरी" diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index c03abe5fcda7..bfc724c43e44 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -305,8 +305,8 @@ "supportCenter": { "message": "हमारे सहायता केंद्र पर जाएं" }, - "symbolBetweenZeroHundred": { - "message": "प्रतीक 100 वर्ण या उससे कम का होना चाहिए।" + "invalidSymbolLength": { + "message": "प्रतीक $1 वर्ण या उससे कम का होना चाहिए।" }, "terms": { "message": "उपयोग की शर्तें" diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 487197ee2bdb..2d1f83b13b35 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -731,8 +731,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroHundred": { - "message": "Simbol mora biti 100 znakova ili manje." + "invalidSymbolLength": { + "message": "Simbol mora biti $1 znakova ili manje." }, "terms": { "message": "Odredbe uporabe" diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 9ebc3548d06c..3b83e6e270ed 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -524,8 +524,8 @@ "supportCenter": { "message": "Vizite Sant Sipò Nou" }, - "symbolBetweenZeroHundred": { - "message": "Senbòl yo dwe 100 karaktè oswa mwens." + "invalidSymbolLength": { + "message": "Senbòl yo dwe $1 karaktè oswa mwens." }, "terms": { "message": "Tèm pou itilize" diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 8ab5668dad62..37d214d9dcaf 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -731,8 +731,8 @@ "symbol": { "message": "Szimbólum" }, - "symbolBetweenZeroHundred": { - "message": "A szimbólum 0 és 12 karakter között kell legyen." + "invalidSymbolLength": { + "message": "A szimbólum legfeljebb $1 karakterből állhat." }, "terms": { "message": "Használati feltételek" diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 171bb76b9d5b..5900adb73663 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroHundred": { - "message": "Simbol harus terdiri dari 100 karakter atau kurang." + "invalidSymbolLength": { + "message": "Simbol harus terdiri dari $1 karakter atau kurang." }, "tenPercentIncreased": { "message": "Meningkat 10%" diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 2ee9e86a9ef4..c7b9d214befb 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1763,8 +1763,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroHundred": { - "message": "Il simbolo deve essere lungo tra 0 e 12 caratteri." + "invalidSymbolLength": { + "message": "Il simbolo deve contenere un massimo di $1 caratteri." }, "terms": { "message": "Termini di Uso" diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index 7c88b976f622..8164b8193592 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "シンボル" }, - "symbolBetweenZeroHundred": { - "message": "シンボルは11文字以下にする必要があります。" + "invalidSymbolLength": { + "message": "シンボルは $1文字以下にする必要があります。" }, "tenPercentIncreased": { "message": "10% の増加" diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index c00f2084809a..b465c2a5927e 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "ಚಿಹ್ನೆ" }, - "symbolBetweenZeroHundred": { - "message": "ಚಿಹ್ನೆಯು 0 ಮತ್ತು 12 ಅಕ್ಷರಗಳ ನಡುವೆ ಇರಬೇಕು." + "invalidSymbolLength": { + "message": "ಚಿಹ್ನೆಯು $1 ಅಥವಾ ಅದಕ್ಕಿಂತ ಕಡಿಮೆ ಅಕ್ಷರಗಳಾಗಿರಬೇಕು." }, "terms": { "message": "ಬಳಕೆಯ ನಿಯಮಗಳು" diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index c8b58a753128..eb7eb408c2c6 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "기호" }, - "symbolBetweenZeroHundred": { - "message": "기호는 11자 이하여야 합니다." + "invalidSymbolLength": { + "message": "기호는 $1자 이하여야 합니다." }, "tenPercentIncreased": { "message": "10% 인상" diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index 2a000a965cb7..144f1cdd59ac 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "Simbolis" }, - "symbolBetweenZeroHundred": { - "message": "Simbolis turi būti ne ilgesnis nei 100 simbolių." + "invalidSymbolLength": { + "message": "Simbolis turi būti ne ilgesnis nei $1 simbolių." }, "terms": { "message": "Naudojimo sąlygos" diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index a2231db64e76..62a2379e93c5 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -734,8 +734,8 @@ "symbol": { "message": "Simbols" }, - "symbolBetweenZeroHundred": { - "message": "Simbolā nedrīkst būt vairāk par 100 rakstzīmēm." + "invalidSymbolLength": { + "message": "Simbolā nedrīkst būt vairāk par $1 rakstzīmēm." }, "terms": { "message": "Lietošanas noteikumi" diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 855416403654..7b33a13bae53 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -718,8 +718,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroHundred": { - "message": "Simbol mestilah 100 aksara atau kurang." + "invalidSymbolLength": { + "message": "Simbol mestilah $1 aksara atau kurang." }, "terms": { "message": "Syarat-syarat Penggunaan" diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index b6e7c7b18c92..328a415dc09c 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -298,8 +298,8 @@ "supportCenter": { "message": "Bezoek ons ​​ondersteuningscentrum" }, - "symbolBetweenZeroHundred": { - "message": "Symbool moet 100 tekens of minder zijn." + "invalidSymbolLength": { + "message": "Symbool moet $1 tekens of minder zijn." }, "terms": { "message": "Gebruiksvoorwaarden" diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 5c65e65f4d8e..8757e4a4b359 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -716,8 +716,8 @@ "switchNetworks": { "message": "Bytt nettverk " }, - "symbolBetweenZeroHundred": { - "message": "Symbolet må være 100 tegn eller færre." + "invalidSymbolLength": { + "message": "Symbolet må være $1 tegn eller færre." }, "terms": { "message": "Brukervilkår" diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 9dfab5276d78..a3497b6ca735 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -1708,8 +1708,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroHundred": { - "message": "Dapat ay 100 character o mas kaunti ang simbolo." + "invalidSymbolLength": { + "message": "Dapat ay $1 character o mas kaunti ang simbolo." }, "terms": { "message": "Mga Tuntunin ng Paggamit" diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 00fe0f381398..3ea4f97e99e3 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -729,8 +729,8 @@ "switchNetworks": { "message": "Zmień sieci" }, - "symbolBetweenZeroHundred": { - "message": "Symbol musi mieć maksymalnie 100 znaków." + "invalidSymbolLength": { + "message": "Symbol musi mieć maksymalnie $1 znaków." }, "terms": { "message": "Regulamin" diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index ffb6f32ddd55..c48c0caacb65 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroHundred": { - "message": "O símbolo deve ter 100 caracteres ou menos." + "invalidSymbolLength": { + "message": "O símbolo deve ter $1 caracteres ou menos." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 557f59ac05f3..3f3fc0decb1d 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -2531,8 +2531,8 @@ "symbol": { "message": "Símbolo" }, - "symbolBetweenZeroHundred": { - "message": "O símbolo deve ter até 100 caracteres." + "invalidSymbolLength": { + "message": "O símbolo deve ter até $1 caracteres." }, "tenPercentIncreased": { "message": "10% de aumento" diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index a2fb8487b17f..44613a845cd6 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -725,8 +725,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroHundred": { - "message": "Simbolul trebuie să fie de 100 caractere sau mai puțin." + "invalidSymbolLength": { + "message": "Simbolul trebuie să fie de $1 caractere sau mai puțin." }, "terms": { "message": "Termeni și condiții" diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 4070d8ba0a47..1cc5dc17c702 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Символ" }, - "symbolBetweenZeroHundred": { - "message": "Символ должен состоять из 100 или менее знаков." + "invalidSymbolLength": { + "message": "Символ должен состоять из $1 или менее знаков." }, "tenPercentIncreased": { "message": "Увеличение на 10%" diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index 222f85c194d6..5ddf401b355a 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -707,8 +707,8 @@ "switchNetworks": { "message": "Prepnúť siete" }, - "symbolBetweenZeroHundred": { - "message": "Symbol musí být mezi 0 a 12 znaky." + "invalidSymbolLength": { + "message": "Symbol musí mít $1 nebo méně znaků." }, "terms": { "message": "Podmínky použití" diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index 697f162a491a..37bc7d173901 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -726,8 +726,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroHundred": { - "message": "Simbol mora biti največ 100 znakov ali manj." + "invalidSymbolLength": { + "message": "Simbol mora biti največ $1 znakov ali manj." }, "terms": { "message": "Pogoji uporabe" diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 436bc1008165..cf0d6148a33d 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -729,8 +729,8 @@ "symbol": { "message": "Simbol" }, - "symbolBetweenZeroHundred": { - "message": "Simbol mora biti 100 znakova ili manje." + "invalidSymbolLength": { + "message": "Simbol mora biti $1 znakova ili manje." }, "terms": { "message": "Uslovi korišćenja" diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index 4ec1908e9de8..6ae24c1ed2f3 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -719,8 +719,8 @@ "switchNetworks": { "message": "Växla nätverk" }, - "symbolBetweenZeroHundred": { - "message": "Symbolen måste vara 100 tecken eller färre." + "invalidSymbolLength": { + "message": "Symbolen måste vara $1 tecken eller färre." }, "terms": { "message": "Användarvillkor" diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index 42c5643a0180..8177850f779c 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -716,8 +716,8 @@ "symbol": { "message": "Ishara" }, - "symbolBetweenZeroHundred": { - "message": "Alama lazima iwe na herufi 100 au chache." + "invalidSymbolLength": { + "message": "Alama lazima iwe na herufi $1 au chache." }, "terms": { "message": "Masharti ya Matumizi" diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index bd00ca6e332c..e7a1bf42a725 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -413,8 +413,8 @@ "supportCenter": { "message": "எங்கள் ஆதரவு மையத்தைப் பார்வையிடவும்" }, - "symbolBetweenZeroHundred": { - "message": "கசின்னம் 100 எழுத்துக்கள் அல்லது குறைவாக இருக்க வேண்டும்." + "invalidSymbolLength": { + "message": "கசின்னம் $1 எழுத்துக்கள் அல்லது குறைவாக இருக்க வேண்டும்." }, "terms": { "message": "பயன்பாட்டு விதிமுறைகளை" diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index 509c572dcfd2..3ca027d347f3 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -374,8 +374,8 @@ "symbol": { "message": "เครื่องหมาย" }, - "symbolBetweenZeroHundred": { - "message": "สัญลักษณ์จะต้องมีความยาว 100 ตัวอักษร" + "invalidSymbolLength": { + "message": "สัญลักษณ์จะต้องมีความยาว $1 ตัวอักษร" }, "terms": { "message": "ข้อตกลงในการใช้งาน" diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index b49ed306427b..fb803c525542 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Simbolo" }, - "symbolBetweenZeroHundred": { - "message": "Dapat ay 100 character o mas kaunti ang simbolo." + "invalidSymbolLength": { + "message": "Dapat ay $1 character o mas kaunti ang simbolo." }, "tenPercentIncreased": { "message": "10% na dagdag" diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index e18643f03d6d..6efbc6eaede8 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Sembol" }, - "symbolBetweenZeroHundred": { - "message": "Sembol en fazla 100 karakter olmalıdır." + "invalidSymbolLength": { + "message": "Sembol en fazla $1 karakter olmalıdır." }, "tenPercentIncreased": { "message": "%10 artış" diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index a4b21d7cf7a6..b51b1765e3b4 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -738,8 +738,8 @@ "symbol": { "message": "Символ" }, - "symbolBetweenZeroHundred": { - "message": "Символ повинен містити 100 символів або менше." + "invalidSymbolLength": { + "message": "Символ повинен містити $1 символів або менше." }, "terms": { "message": "Умови використання" diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 063aa0a6a962..0892fc9c296e 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "Ký hiệu" }, - "symbolBetweenZeroHundred": { - "message": "Ký hiệu không được dài quá 100 ký tự." + "invalidSymbolLength": { + "message": "Ký hiệu không được dài quá $1 ký tự." }, "tenPercentIncreased": { "message": "Tăng 10%" diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 5bba4e4a4bc2..dc6ad74d05ba 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -3890,8 +3890,8 @@ "symbol": { "message": "符号" }, - "symbolBetweenZeroHundred": { - "message": "符号不得超过11个字符。" + "invalidSymbolLength": { + "message": "符号不得超过$1个字符。" }, "tenPercentIncreased": { "message": "增加10%" diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index ab0b02ea1efd..cfe7a63ec57d 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -1384,8 +1384,8 @@ "symbol": { "message": "符號" }, - "symbolBetweenZeroHundred": { - "message": "符號不得超過 100 個字元。" + "invalidSymbolLength": { + "message": "符號不得超過 $1 個字元。" }, "terms": { "message": "使用條款" diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index ee2d9acbee16..e8b5e465595d 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -48,3 +48,8 @@ export const MAX_TOKEN_ALLOWANCE_AMOUNT = new BigNumber(2) export const NUM_W_OPT_DECIMAL_COMMA_OR_DOT_REGEX = /^[0-9]{1,}([,.][0-9]{1,})?$/u; export const DECIMAL_REGEX = /\.(\d*)/u; + +export const VALID_SYMBOL_LENGTH = { + min: 1, + max: 100, +}; \ No newline at end of file diff --git a/ui/pages/import-token/import-token.component.js b/ui/pages/import-token/import-token.component.js index 436ceb96be9f..8fdad359e65d 100644 --- a/ui/pages/import-token/import-token.component.js +++ b/ui/pages/import-token/import-token.component.js @@ -25,7 +25,7 @@ import { } from '../../helpers/constants/design-system'; import Button from '../../components/ui/button'; import { TokenStandard } from '../../../shared/constants/transaction'; -import { STATIC_MAINNET_TOKEN_LIST } from '../../../shared/constants/tokens'; +import { STATIC_MAINNET_TOKEN_LIST, VALID_SYMBOL_LENGTH, } from '../../../shared/constants/tokens'; import TokenSearch from './token-search'; import TokenList from './token-list'; @@ -367,8 +367,8 @@ class ImportToken extends Component { const symbolLength = customSymbol.length; let customSymbolError = null; - if (symbolLength === 0 || symbolLength >= 100) { - customSymbolError = this.context.t('symbolBetweenZeroHundred'); + if (symbolLength < VALID_SYMBOL_LENGTH.min || symbolLength >= VALID_SYMBOL_LENGTH.max) { + customSymbolError = this.context.t('invalidSymbolLength').replace(' $1', VALID_SYMBOL_LENGTH.max); } this.setState({ customSymbol, customSymbolError }); From 938f3baae34cb28b48d483afba3aed0d20ec3455 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Mon, 15 Apr 2024 04:18:04 +0000 Subject: [PATCH 05/13] fix: off-by-one error (localised messages use inclusive valid range) --- .../multichain/import-tokens-modal/import-tokens-modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js index 7b8ed113572b..9d1fc876f718 100644 --- a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js +++ b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js @@ -256,7 +256,7 @@ export const ImportTokensModal = ({ onClose }) => { const symbolLength = symbol.length; let symbolError = null; - if (symbolLength < VALID_SYMBOL_LENGTH.min || symbolLength >= VALID_SYMBOL_LENGTH.max) { + if (symbolLength < VALID_SYMBOL_LENGTH.min || symbolLength > VALID_SYMBOL_LENGTH.max) { symbolError = t('invalidSymbolLength').replace('$1', VALID_SYMBOL_LENGTH.max); } From e3c8218436fdaf6e38852a7d373a0a739d1b0218 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Mon, 15 Apr 2024 04:21:31 +0000 Subject: [PATCH 06/13] chore: hardcoded symbol min length 1 --- shared/constants/tokens.js | 5 +---- .../multichain/import-tokens-modal/import-tokens-modal.js | 6 +++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index 0fb592356036..6827a3b55379 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -51,7 +51,4 @@ export const NUM_W_OPT_DECIMAL_COMMA_OR_DOT_REGEX = /^[0-9]{1,}([,.][0-9]{1,})?$/u; export const DECIMAL_REGEX = /\.(\d*)/u; -export const VALID_SYMBOL_LENGTH = { - min: 1, - max: 100, -}; +export const MAX_SYMBOL_LENGTH = 100; diff --git a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js index 9d1fc876f718..a5c75e1aa4da 100644 --- a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js +++ b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js @@ -76,7 +76,7 @@ import { import { addHexPrefix } from '../../../../app/scripts/lib/util'; import { STATIC_MAINNET_TOKEN_LIST, - VALID_SYMBOL_LENGTH, + MAX_SYMBOL_LENGTH, } from '../../../../shared/constants/tokens'; import { AssetType, @@ -256,8 +256,8 @@ export const ImportTokensModal = ({ onClose }) => { const symbolLength = symbol.length; let symbolError = null; - if (symbolLength < VALID_SYMBOL_LENGTH.min || symbolLength > VALID_SYMBOL_LENGTH.max) { - symbolError = t('invalidSymbolLength').replace('$1', VALID_SYMBOL_LENGTH.max); + if (symbolLength < 1 || symbolLength > MAX_SYMBOL_LENGTH) { + symbolError = t('invalidSymbolLength').replace('$1', MAX_SYMBOL_LENGTH); } setCustomSymbol(symbol); From 08758b3a0df91b6e7eab1d8ea83532c8f0562141 Mon Sep 17 00:00:00 2001 From: legobt <6wbvkn0j@anonaddy.me> Date: Mon, 15 Apr 2024 04:58:04 +0000 Subject: [PATCH 07/13] lint:fix --- app/_locales/am/messages.json | 6 +++--- app/_locales/ar/messages.json | 6 +++--- app/_locales/bg/messages.json | 6 +++--- app/_locales/bn/messages.json | 6 +++--- app/_locales/ca/messages.json | 6 +++--- app/_locales/cs/messages.json | 6 +++--- app/_locales/da/messages.json | 6 +++--- app/_locales/de/messages.json | 6 +++--- app/_locales/el/messages.json | 6 +++--- app/_locales/en/messages.json | 6 +++--- app/_locales/es/messages.json | 6 +++--- app/_locales/es_419/messages.json | 6 +++--- app/_locales/et/messages.json | 6 +++--- app/_locales/fa/messages.json | 6 +++--- app/_locales/fi/messages.json | 6 +++--- app/_locales/fil/messages.json | 6 +++--- app/_locales/fr/messages.json | 6 +++--- app/_locales/he/messages.json | 6 +++--- app/_locales/hi/messages.json | 6 +++--- app/_locales/hn/messages.json | 6 +++--- app/_locales/hr/messages.json | 6 +++--- app/_locales/ht/messages.json | 6 +++--- app/_locales/hu/messages.json | 6 +++--- app/_locales/id/messages.json | 6 +++--- app/_locales/it/messages.json | 6 +++--- app/_locales/ja/messages.json | 6 +++--- app/_locales/kn/messages.json | 6 +++--- app/_locales/ko/messages.json | 6 +++--- app/_locales/lt/messages.json | 6 +++--- app/_locales/lv/messages.json | 6 +++--- app/_locales/ms/messages.json | 6 +++--- app/_locales/nl/messages.json | 6 +++--- app/_locales/no/messages.json | 6 +++--- app/_locales/ph/messages.json | 6 +++--- app/_locales/pl/messages.json | 6 +++--- app/_locales/pt/messages.json | 6 +++--- app/_locales/pt_BR/messages.json | 6 +++--- app/_locales/ro/messages.json | 6 +++--- app/_locales/ru/messages.json | 6 +++--- app/_locales/sk/messages.json | 6 +++--- app/_locales/sl/messages.json | 6 +++--- app/_locales/sr/messages.json | 6 +++--- app/_locales/sv/messages.json | 6 +++--- app/_locales/sw/messages.json | 6 +++--- app/_locales/ta/messages.json | 6 +++--- app/_locales/th/messages.json | 6 +++--- app/_locales/tl/messages.json | 6 +++--- app/_locales/tr/messages.json | 6 +++--- app/_locales/uk/messages.json | 6 +++--- app/_locales/vi/messages.json | 6 +++--- app/_locales/zh_CN/messages.json | 6 +++--- app/_locales/zh_TW/messages.json | 6 +++--- 52 files changed, 156 insertions(+), 156 deletions(-) diff --git a/app/_locales/am/messages.json b/app/_locales/am/messages.json index cac32465fefe..93c95da3ec48 100644 --- a/app/_locales/am/messages.json +++ b/app/_locales/am/messages.json @@ -360,6 +360,9 @@ "invalidSeedPhrase": { "message": "የተሳሳተ የዘር ሐረግ" }, + "invalidSymbolLength": { + "message": "ምልክቱ $1 ቁምፊዎች ወይም ከዚያ ያነሰ መሆን አለበት።" + }, "jsonFile": { "message": "JSON ፋይል", "description": "format for importing an account" @@ -678,9 +681,6 @@ "symbol": { "message": "ምልክት" }, - "invalidSymbolLength": { - "message": "ምልክቱ $1 ቁምፊዎች ወይም ከዚያ ያነሰ መሆን አለበት።" - }, "terms": { "message": "የአጠቃቀም ደንቦች" }, diff --git a/app/_locales/ar/messages.json b/app/_locales/ar/messages.json index 3342b889cf30..3d2258bff8ee 100644 --- a/app/_locales/ar/messages.json +++ b/app/_locales/ar/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "عبارة أمان غير صحيحة" }, + "invalidSymbolLength": { + "message": "يجب أن يكون الرمز $1 حرفًا أو أقل." + }, "jsonFile": { "message": "ملف JSON ", "description": "format for importing an account" @@ -690,9 +693,6 @@ "symbol": { "message": "رمز" }, - "invalidSymbolLength": { - "message": "يجب أن يكون الرمز $1 حرفًا أو أقل." - }, "terms": { "message": "شروط الاستخدام" }, diff --git a/app/_locales/bg/messages.json b/app/_locales/bg/messages.json index c2191e2b7f77..52e0b460f731 100644 --- a/app/_locales/bg/messages.json +++ b/app/_locales/bg/messages.json @@ -365,6 +365,9 @@ "invalidSeedPhrase": { "message": "Невалидна фраза зародиш" }, + "invalidSymbolLength": { + "message": "Символът трябва да е $1 символа или по-малко." + }, "jsonFile": { "message": "JSON файл", "description": "format for importing an account" @@ -689,9 +692,6 @@ "symbol": { "message": "Символ" }, - "invalidSymbolLength": { - "message": "Символът трябва да е $1 символа или по-малко." - }, "terms": { "message": "Условия за ползване" }, diff --git a/app/_locales/bn/messages.json b/app/_locales/bn/messages.json index 7e438c30050c..af4f3d430e19 100644 --- a/app/_locales/bn/messages.json +++ b/app/_locales/bn/messages.json @@ -366,6 +366,9 @@ "invalidSeedPhrase": { "message": "অবৈধ সীড ফ্রেজ" }, + "invalidSymbolLength": { + "message": "প্রতীকটি $1 টি অক্ষর বা তার চেয়ে কম হতে হবে।" + }, "jsonFile": { "message": "JSON ফাইল", "description": "format for importing an account" @@ -687,9 +690,6 @@ "symbol": { "message": "প্রতীক" }, - "invalidSymbolLength": { - "message": "প্রতীকটি $1 টি অক্ষর বা তার চেয়ে কম হতে হবে।" - }, "terms": { "message": "ব্যবহারের শর্তাবলী" }, diff --git a/app/_locales/ca/messages.json b/app/_locales/ca/messages.json index af1863080ad6..e69d289bbd64 100644 --- a/app/_locales/ca/messages.json +++ b/app/_locales/ca/messages.json @@ -356,6 +356,9 @@ "invalidSeedPhrase": { "message": "Frase de recuperació no vàlida" }, + "invalidSymbolLength": { + "message": "El símbol ha de tenir com a mínim $1 caràcters." + }, "jsonFile": { "message": "Arxiu JSON", "description": "format for importing an account" @@ -674,9 +677,6 @@ "symbol": { "message": "Símbol" }, - "invalidSymbolLength": { - "message": "El símbol ha de tenir com a mínim $1 caràcters." - }, "terms": { "message": "Condicions d'ús" }, diff --git a/app/_locales/cs/messages.json b/app/_locales/cs/messages.json index 096218bb55bf..1da8e5c34d08 100644 --- a/app/_locales/cs/messages.json +++ b/app/_locales/cs/messages.json @@ -166,6 +166,9 @@ "invalidRPC": { "message": "Neplatné RPC URI" }, + "invalidSymbolLength": { + "message": "Symbol musí mít $1 nebo méně znaků." + }, "jsonFile": { "message": "JSON soubor", "description": "format for importing an account" @@ -322,9 +325,6 @@ "supportCenter": { "message": "Navštivte naše centrum podpory" }, - "invalidSymbolLength": { - "message": "Symbol musí mít $1 nebo méně znaků." - }, "terms": { "message": "Podmínky použití" }, diff --git a/app/_locales/da/messages.json b/app/_locales/da/messages.json index d9da597d306b..d375eb169dac 100644 --- a/app/_locales/da/messages.json +++ b/app/_locales/da/messages.json @@ -362,6 +362,9 @@ "invalidSeedPhrase": { "message": "Ugyldig backupsætning" }, + "invalidSymbolLength": { + "message": "Symbolet skal være mindst $1 tegn." + }, "jsonFile": { "message": "JSON-fil", "description": "format for importing an account" @@ -668,9 +671,6 @@ "switchNetworks": { "message": "Skift Netværk" }, - "invalidSymbolLength": { - "message": "Symbolet skal være mindst $1 tegn." - }, "terms": { "message": "Brugsbetingelser" }, diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index d9ccff9d405f..8ba94ab184b7 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Ungültige Eingabe! Die geheime Wiederherstellungsphrase berücksichtigt Groß- und Kleinschreibung." }, + "invalidSymbolLength": { + "message": "Das Symbol darf maximal $1 Zeichen lang sein." + }, "ipfsGateway": { "message": "IPFS-Gateway" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Symbol" }, - "invalidSymbolLength": { - "message": "Das Symbol darf maximal $1 Zeichen lang sein." - }, "tenPercentIncreased": { "message": "10 % Erhöhung" }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index 53bf16668a57..9a982f3bc5ed 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Μη έγκυρη εισαγωγή! Η Μυστική σας Φράση Ανάκτησης κάνει διάκριση πεζών/κεφαλαίων." }, + "invalidSymbolLength": { + "message": "Το σύμβολο πρέπει να αποτελείται από $1 ή λιγότερους χαρακτήρες." + }, "ipfsGateway": { "message": "Πύλη IPFS" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Σύμβολο" }, - "invalidSymbolLength": { - "message": "Το σύμβολο πρέπει να αποτελείται από $1 ή λιγότερους χαρακτήρες." - }, "tenPercentIncreased": { "message": "10% αύξηση" }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index c56164a0cb9b..26532f038977 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2313,6 +2313,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Invalid input! Secret Recovery Phrase is case sensitive." }, + "invalidSymbolLength": { + "message": "Symbol must be $1 characters or fewer." + }, "ipfsGateway": { "message": "IPFS gateway" }, @@ -5375,9 +5378,6 @@ "symbol": { "message": "Symbol" }, - "invalidSymbolLength": { - "message": "Symbol must be $1 characters or fewer." - }, "tenPercentIncreased": { "message": "10% increase" }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index a9922f96a3e5..22f872179329 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "¡Entrada inválida! La frase secreta de recuperación distingue entre mayúsculas y minúsculas." }, + "invalidSymbolLength": { + "message": "El símbolo debe tener $1 caracteres o menos." + }, "ipfsGateway": { "message": "Puerta de enlace de IPFS" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Símbolo" }, - "invalidSymbolLength": { - "message": "El símbolo debe tener $1 caracteres o menos." - }, "tenPercentIncreased": { "message": "10 % de aumento" }, diff --git a/app/_locales/es_419/messages.json b/app/_locales/es_419/messages.json index c341bb827dd5..1765def22146 100644 --- a/app/_locales/es_419/messages.json +++ b/app/_locales/es_419/messages.json @@ -1096,6 +1096,9 @@ "invalidSeedPhrase": { "message": "Frase secreta de recuperación no válida" }, + "invalidSymbolLength": { + "message": "El símbolo debe tener $1 caracteres o menos." + }, "jsDeliver": { "message": "jsDeliver" }, @@ -2300,9 +2303,6 @@ "symbol": { "message": "Símbolo" }, - "invalidSymbolLength": { - "message": "El símbolo debe tener $1 caracteres o menos." - }, "tenPercentIncreased": { "message": "10% de aumento" }, diff --git a/app/_locales/et/messages.json b/app/_locales/et/messages.json index 1ee475e2ac0d..408b692f874f 100644 --- a/app/_locales/et/messages.json +++ b/app/_locales/et/messages.json @@ -365,6 +365,9 @@ "invalidSeedPhrase": { "message": "Vigane seemnefraas" }, + "invalidSymbolLength": { + "message": "Sümbol peab olema $1 tähemärki või vähem." + }, "jsonFile": { "message": "JSON-laiendiga fail", "description": "format for importing an account" @@ -683,9 +686,6 @@ "symbol": { "message": "Sümbol" }, - "invalidSymbolLength": { - "message": "Sümbol peab olema $1 tähemärki või vähem." - }, "terms": { "message": "Teenusetingimused" }, diff --git a/app/_locales/fa/messages.json b/app/_locales/fa/messages.json index 123d4cf1cf14..1b59fe329294 100644 --- a/app/_locales/fa/messages.json +++ b/app/_locales/fa/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "عبارت بازیابی نا معتبر" }, + "invalidSymbolLength": { + "message": "نماد باید $1 کاراکتر یا کمتر باشد." + }, "jsonFile": { "message": "فایل JSON", "description": "format for importing an account" @@ -693,9 +696,6 @@ "symbol": { "message": "سمبول" }, - "invalidSymbolLength": { - "message": "نماد باید $1 کاراکتر یا کمتر باشد." - }, "terms": { "message": "شرایط استفاده" }, diff --git a/app/_locales/fi/messages.json b/app/_locales/fi/messages.json index 42878be94076..72a50ccc11dc 100644 --- a/app/_locales/fi/messages.json +++ b/app/_locales/fi/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "Virheellinen salausteksti" }, + "invalidSymbolLength": { + "message": "Symbolin on oltava $1 merkkiä tai vähemmän." + }, "jsonFile": { "message": "JSON-tiedosto", "description": "format for importing an account" @@ -690,9 +693,6 @@ "symbol": { "message": "Symboli" }, - "invalidSymbolLength": { - "message": "Symbolin on oltava $1 merkkiä tai vähemmän." - }, "terms": { "message": "Käyttöehdot" }, diff --git a/app/_locales/fil/messages.json b/app/_locales/fil/messages.json index 1d5873acb41c..94d4578ace52 100644 --- a/app/_locales/fil/messages.json +++ b/app/_locales/fil/messages.json @@ -326,6 +326,9 @@ "invalidSeedPhrase": { "message": "Hindi valid ang seed phrase" }, + "invalidSymbolLength": { + "message": "Ang simbolo ay dapat na $1 character o mas kaunti." + }, "knownAddressRecipient": { "message": "Kilalang address ng contract." }, @@ -611,9 +614,6 @@ "symbol": { "message": "Simbolo" }, - "invalidSymbolLength": { - "message": "Ang simbolo ay dapat na $1 character o mas kaunti." - }, "terms": { "message": "Mga Tuntunin ng Paggamit" }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 1dd4e02485f3..46e87ee2f98a 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -1973,6 +1973,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Entrée invalide ! La phrase secrète de récupération est sensible à la casse." }, + "invalidSymbolLength": { + "message": "Le symbole doit comporter $1 caractères ou moins." + }, "ipfsGateway": { "message": "Passerelle IPFS" }, @@ -4263,9 +4266,6 @@ "symbol": { "message": "Symbole" }, - "invalidSymbolLength": { - "message": "Le symbole doit comporter $1 caractères ou moins." - }, "tenPercentIncreased": { "message": "Augmentation de 10 %" }, diff --git a/app/_locales/he/messages.json b/app/_locales/he/messages.json index 67b40ecb71ee..3a0573c57207 100644 --- a/app/_locales/he/messages.json +++ b/app/_locales/he/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "seed phrase לא חוקי" }, + "invalidSymbolLength": { + "message": "הסמל חייב להיות $1 תווים או פחות." + }, "jsonFile": { "message": "קובץ JSON", "description": "format for importing an account" @@ -690,9 +693,6 @@ "symbol": { "message": "סמל" }, - "invalidSymbolLength": { - "message": "הסמל חייב להיות $1 תווים או פחות." - }, "terms": { "message": "תנאי שימוש" }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 3e60bf5e0225..9fc9e5694edc 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "ग़लत निवेश! गुप्त पुनर्प्राप्ति वाक्यांश केस संवेदी है।" }, + "invalidSymbolLength": { + "message": "प्रतीक $1 करैक्टर या उससे कम का होना चाहिए।" + }, "ipfsGateway": { "message": "IPFS गेटवे" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "प्रतीक" }, - "invalidSymbolLength": { - "message": "प्रतीक $1 करैक्टर या उससे कम का होना चाहिए।" - }, "tenPercentIncreased": { "message": "10% बढ़ोत्तरी" }, diff --git a/app/_locales/hn/messages.json b/app/_locales/hn/messages.json index 79cfbf8bc2f9..2cbfdc614cf1 100644 --- a/app/_locales/hn/messages.json +++ b/app/_locales/hn/messages.json @@ -152,6 +152,9 @@ "invalidRPC": { "message": "अमान्य RPC कै URI" }, + "invalidSymbolLength": { + "message": "प्रतीक $1 वर्ण या उससे कम का होना चाहिए।" + }, "jsonFile": { "message": "JSON फ़ाइल", "description": "format for importing an account" @@ -287,9 +290,6 @@ "supportCenter": { "message": "हमारे सहायता केंद्र पर जाएं" }, - "invalidSymbolLength": { - "message": "प्रतीक $1 वर्ण या उससे कम का होना चाहिए।" - }, "terms": { "message": "उपयोग की शर्तें" }, diff --git a/app/_locales/hr/messages.json b/app/_locales/hr/messages.json index 9dd195a140b7..1bf1f9584fc0 100644 --- a/app/_locales/hr/messages.json +++ b/app/_locales/hr/messages.json @@ -365,6 +365,9 @@ "invalidSeedPhrase": { "message": "Nevaljana početna rečenica" }, + "invalidSymbolLength": { + "message": "Simbol mora biti $1 znakova ili manje." + }, "jsonFile": { "message": "Datoteka JSON", "description": "format for importing an account" @@ -686,9 +689,6 @@ "symbol": { "message": "Simbol" }, - "invalidSymbolLength": { - "message": "Simbol mora biti $1 znakova ili manje." - }, "terms": { "message": "Odredbe uporabe" }, diff --git a/app/_locales/ht/messages.json b/app/_locales/ht/messages.json index 61017b260acf..218a5236c478 100644 --- a/app/_locales/ht/messages.json +++ b/app/_locales/ht/messages.json @@ -248,6 +248,9 @@ "invalidSeedPhrase": { "message": "Seed fraz pa valab" }, + "invalidSymbolLength": { + "message": "Senbòl yo dwe $1 karaktè oswa mwens." + }, "jsonFile": { "message": "JSON Dosye", "description": "format for importing an account" @@ -497,9 +500,6 @@ "supportCenter": { "message": "Vizite Sant Sipò Nou" }, - "invalidSymbolLength": { - "message": "Senbòl yo dwe $1 karaktè oswa mwens." - }, "terms": { "message": "Tèm pou itilize" }, diff --git a/app/_locales/hu/messages.json b/app/_locales/hu/messages.json index 01dedc183fc1..a4db9e0d5580 100644 --- a/app/_locales/hu/messages.json +++ b/app/_locales/hu/messages.json @@ -365,6 +365,9 @@ "invalidSeedPhrase": { "message": "Érvénytelen seed mondat" }, + "invalidSymbolLength": { + "message": "A szimbólum legfeljebb $1 karakterből állhat." + }, "jsonFile": { "message": "JSON-fájl", "description": "format for importing an account" @@ -686,9 +689,6 @@ "symbol": { "message": "Szimbólum" }, - "invalidSymbolLength": { - "message": "A szimbólum legfeljebb $1 karakterből állhat." - }, "terms": { "message": "Használati feltételek" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 710757c98af3..fa59f213d286 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Masukan tidak valid! Frasa Pemulihan Rahasia peka terhadap huruf besar/kecil." }, + "invalidSymbolLength": { + "message": "Simbol harus terdiri dari $1 karakter atau lebih sedikit." + }, "ipfsGateway": { "message": "Gateway IPFS" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Simbol" }, - "invalidSymbolLength": { - "message": "Simbol harus terdiri dari $1 karakter atau lebih sedikit." - }, "tenPercentIncreased": { "message": "Meningkat 10%" }, diff --git a/app/_locales/it/messages.json b/app/_locales/it/messages.json index 8525205c3f71..b30a883045c5 100644 --- a/app/_locales/it/messages.json +++ b/app/_locales/it/messages.json @@ -1034,6 +1034,9 @@ "invalidSeedPhrase": { "message": "Frase seed non valida" }, + "invalidSymbolLength": { + "message": "Il simbolo deve contenere un massimo di $1 caratteri." + }, "jsonFile": { "message": "File JSON", "description": "format for importing an account" @@ -1671,9 +1674,6 @@ "symbol": { "message": "Simbolo" }, - "invalidSymbolLength": { - "message": "Il simbolo deve contenere un massimo di $1 caratteri." - }, "terms": { "message": "Termini di Uso" }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index c180a11cced1..c1b4706b517a 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "入力値が無効です!シークレットリカバリーフレーズは大文字・小文字が区別されます。" }, + "invalidSymbolLength": { + "message": "シンボルは $1文字以下にする必要があります。" + }, "ipfsGateway": { "message": "IPFSゲートウェイ" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "シンボル" }, - "invalidSymbolLength": { - "message": "シンボルは $1文字以下にする必要があります。" - }, "tenPercentIncreased": { "message": "10%の増加" }, diff --git a/app/_locales/kn/messages.json b/app/_locales/kn/messages.json index 6aba2957feed..c0b2f8f9392f 100644 --- a/app/_locales/kn/messages.json +++ b/app/_locales/kn/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "ಅಮಾನ್ಯವಾದ ಸೀಡ್ ಫ್ರೇಸ್" }, + "invalidSymbolLength": { + "message": "ಚಿಹ್ನೆಯು $1 ಅಥವಾ ಅದಕ್ಕಿಂತ ಕಡಿಮೆ ಅಕ್ಷರಗಳಾಗಿರಬೇಕು." + }, "jsonFile": { "message": "JSON ಫೈಲ್", "description": "format for importing an account" @@ -693,9 +696,6 @@ "symbol": { "message": "ಚಿಹ್ನೆ" }, - "invalidSymbolLength": { - "message": "ಚಿಹ್ನೆಯು $1 ಅಥವಾ ಅದಕ್ಕಿಂತ ಕಡಿಮೆ ಅಕ್ಷರಗಳಾಗಿರಬೇಕು." - }, "terms": { "message": "ಬಳಕೆಯ ನಿಯಮಗಳು" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 0f27792f32e7..758f9754bfab 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "입력 오류: 비밀복구구문은 대소문자를 구분해야 합니다." }, + "invalidSymbolLength": { + "message": "기호는 $1자 이하여야 합니다." + }, "ipfsGateway": { "message": "IPFS 게이트웨이" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "기호" }, - "invalidSymbolLength": { - "message": "기호는 $1자 이하여야 합니다." - }, "tenPercentIncreased": { "message": "10% 인상" }, diff --git a/app/_locales/lt/messages.json b/app/_locales/lt/messages.json index d2ca87de5b11..f4226b345d1b 100644 --- a/app/_locales/lt/messages.json +++ b/app/_locales/lt/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "Netinkama atkūrimo frazė" }, + "invalidSymbolLength": { + "message": "Simbolis turi būti ne ilgesnis nei $1 simbolių." + }, "jsonFile": { "message": "JSON failas", "description": "format for importing an account" @@ -693,9 +696,6 @@ "symbol": { "message": "Simbolis" }, - "invalidSymbolLength": { - "message": "Simbolis turi būti ne ilgesnis nei $1 simbolių." - }, "terms": { "message": "Naudojimo sąlygos" }, diff --git a/app/_locales/lv/messages.json b/app/_locales/lv/messages.json index 3507f2956c9a..8d86e163dc2a 100644 --- a/app/_locales/lv/messages.json +++ b/app/_locales/lv/messages.json @@ -365,6 +365,9 @@ "invalidSeedPhrase": { "message": "Nederīga atkopšanas frāze" }, + "invalidSymbolLength": { + "message": "Simbolā nedrīkst būt vairāk par $1 rakstzīmēm." + }, "jsonFile": { "message": "JSON datne", "description": "format for importing an account" @@ -689,9 +692,6 @@ "symbol": { "message": "Simbols" }, - "invalidSymbolLength": { - "message": "Simbolā nedrīkst būt vairāk par $1 rakstzīmēm." - }, "terms": { "message": "Lietošanas noteikumi" }, diff --git a/app/_locales/ms/messages.json b/app/_locales/ms/messages.json index 1e89183e81ec..64d96ff48db9 100644 --- a/app/_locales/ms/messages.json +++ b/app/_locales/ms/messages.json @@ -358,6 +358,9 @@ "invalidSeedPhrase": { "message": "Ungkapan benih tidak sah" }, + "invalidSymbolLength": { + "message": "Simbol mestilah $1 aksara atau kurang." + }, "jsonFile": { "message": "Fail JSON", "description": "format for importing an account" @@ -673,9 +676,6 @@ "symbol": { "message": "Simbol" }, - "invalidSymbolLength": { - "message": "Simbol mestilah $1 aksara atau kurang." - }, "terms": { "message": "Syarat-syarat Penggunaan" }, diff --git a/app/_locales/nl/messages.json b/app/_locales/nl/messages.json index ea4375a2b44b..230ddcc478e4 100644 --- a/app/_locales/nl/messages.json +++ b/app/_locales/nl/messages.json @@ -149,6 +149,9 @@ "invalidRPC": { "message": "Ongeldige RPC-URI" }, + "invalidSymbolLength": { + "message": "Symbool moet $1 tekens of minder zijn." + }, "jsonFile": { "message": "JSON-bestand", "description": "format for importing an account" @@ -280,9 +283,6 @@ "supportCenter": { "message": "Bezoek ons ​​ondersteuningscentrum" }, - "invalidSymbolLength": { - "message": "Symbool moet $1 tekens of minder zijn." - }, "terms": { "message": "Gebruiksvoorwaarden" }, diff --git a/app/_locales/no/messages.json b/app/_locales/no/messages.json index 7548de8c6cbb..788a79b868c7 100644 --- a/app/_locales/no/messages.json +++ b/app/_locales/no/messages.json @@ -356,6 +356,9 @@ "invalidSeedPhrase": { "message": "Ugyldig mnemonisk gjenopprettingsfrase" }, + "invalidSymbolLength": { + "message": "Symbolet må være $1 tegn eller færre." + }, "jsonFile": { "message": "JSON-fil", "description": "format for importing an account" @@ -671,9 +674,6 @@ "switchNetworks": { "message": "Bytt nettverk " }, - "invalidSymbolLength": { - "message": "Symbolet må være $1 tegn eller færre." - }, "terms": { "message": "Brukervilkår" }, diff --git a/app/_locales/ph/messages.json b/app/_locales/ph/messages.json index 9aec944d33c1..89afd5207b6a 100644 --- a/app/_locales/ph/messages.json +++ b/app/_locales/ph/messages.json @@ -743,6 +743,9 @@ "invalidSeedPhrase": { "message": "Invalid na Secret Recovery Phrase" }, + "invalidSymbolLength": { + "message": "Dapat ay $1 character o mas kaunti ang simbolo." + }, "jsonFile": { "message": "JSON File", "description": "format for importing an account" @@ -1596,9 +1599,6 @@ "symbol": { "message": "Simbolo" }, - "invalidSymbolLength": { - "message": "Dapat ay $1 character o mas kaunti ang simbolo." - }, "terms": { "message": "Mga Tuntunin ng Paggamit" }, diff --git a/app/_locales/pl/messages.json b/app/_locales/pl/messages.json index 9e50d2de0105..f890120438ee 100644 --- a/app/_locales/pl/messages.json +++ b/app/_locales/pl/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "Nieprawidłowa fraza seed" }, + "invalidSymbolLength": { + "message": "Symbol musi mieć maksymalnie $1 znaków." + }, "jsonFile": { "message": "Plik JSON", "description": "format for importing an account" @@ -684,9 +687,6 @@ "switchNetworks": { "message": "Zmień sieci" }, - "invalidSymbolLength": { - "message": "Symbol musi mieć maksymalnie $1 znaków." - }, "terms": { "message": "Regulamin" }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index 6f1ea453fe34..e64ae094c766 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Entrada inválida! A Frase de Recuperação Secreta diferencia maiúsculas de minúsculas." }, + "invalidSymbolLength": { + "message": "O símbolo deve ter $1 caracteres ou menos." + }, "ipfsGateway": { "message": "Gateway IPFS" }, @@ -4264,9 +4267,6 @@ "symbol": { "message": "Símbolo" }, - "invalidSymbolLength": { - "message": "O símbolo deve ter $1 caracteres ou menos." - }, "tenPercentIncreased": { "message": "10% de aumento" }, diff --git a/app/_locales/pt_BR/messages.json b/app/_locales/pt_BR/messages.json index 80b2275d22e5..dd893b217c0e 100644 --- a/app/_locales/pt_BR/messages.json +++ b/app/_locales/pt_BR/messages.json @@ -1096,6 +1096,9 @@ "invalidSeedPhrase": { "message": "Frase de Recuperação Secreta inválida" }, + "invalidSymbolLength": { + "message": "O símbolo deve ter até $1 caracteres." + }, "jsDeliver": { "message": "jsDeliver" }, @@ -2304,9 +2307,6 @@ "symbol": { "message": "Símbolo" }, - "invalidSymbolLength": { - "message": "O símbolo deve ter até $1 caracteres." - }, "tenPercentIncreased": { "message": "10% de aumento" }, diff --git a/app/_locales/ro/messages.json b/app/_locales/ro/messages.json index bd8aafb5016b..37454fb1eb94 100644 --- a/app/_locales/ro/messages.json +++ b/app/_locales/ro/messages.json @@ -359,6 +359,9 @@ "invalidSeedPhrase": { "message": "Expresie sursă nevalidă" }, + "invalidSymbolLength": { + "message": "Simbolul trebuie să fie de $1 caractere sau mai puțin." + }, "jsonFile": { "message": "Fișier JSON", "description": "format for importing an account" @@ -680,9 +683,6 @@ "symbol": { "message": "Simbol" }, - "invalidSymbolLength": { - "message": "Simbolul trebuie să fie de $1 caractere sau mai puțin." - }, "terms": { "message": "Termeni și condiții" }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index 29d6f826264e..e7a7790e8754 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Введены недействительные данные! Секретная фраза для восстановления чувствительна к регистру." }, + "invalidSymbolLength": { + "message": "Символ должен состоять из $1 или менее знаков." + }, "ipfsGateway": { "message": "Шлюз IPFS" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Символ" }, - "invalidSymbolLength": { - "message": "Символ должен состоять из $1 или менее знаков." - }, "tenPercentIncreased": { "message": "Увеличение на 10%" }, diff --git a/app/_locales/sk/messages.json b/app/_locales/sk/messages.json index d0525a0520f5..6721c222ae69 100644 --- a/app/_locales/sk/messages.json +++ b/app/_locales/sk/messages.json @@ -356,6 +356,9 @@ "invalidSeedPhrase": { "message": "Neplatná seed fráza" }, + "invalidSymbolLength": { + "message": "Symbol musí mít $1 nebo méně znaků." + }, "jsonFile": { "message": "JSON soubor", "description": "format for importing an account" @@ -662,9 +665,6 @@ "switchNetworks": { "message": "Prepnúť siete" }, - "invalidSymbolLength": { - "message": "Symbol musí mít $1 nebo méně znaků." - }, "terms": { "message": "Podmínky použití" }, diff --git a/app/_locales/sl/messages.json b/app/_locales/sl/messages.json index fabe7dc0dd34..94f2ba2b7e61 100644 --- a/app/_locales/sl/messages.json +++ b/app/_locales/sl/messages.json @@ -363,6 +363,9 @@ "invalidSeedPhrase": { "message": "Neveljavna seed phrase" }, + "invalidSymbolLength": { + "message": "Simbol mora biti največ $1 znakov ali manj." + }, "jsonFile": { "message": "Datoteka JSON", "description": "format for importing an account" @@ -681,9 +684,6 @@ "symbol": { "message": "Simbol" }, - "invalidSymbolLength": { - "message": "Simbol mora biti največ $1 znakov ali manj." - }, "terms": { "message": "Pogoji uporabe" }, diff --git a/app/_locales/sr/messages.json b/app/_locales/sr/messages.json index 2f5714e8e729..227bcceb6037 100644 --- a/app/_locales/sr/messages.json +++ b/app/_locales/sr/messages.json @@ -366,6 +366,9 @@ "invalidSeedPhrase": { "message": "Nevažeća seed fraza" }, + "invalidSymbolLength": { + "message": "Simbol mora biti $1 znakova ili manje." + }, "jsonFile": { "message": "JSON datoteka", "description": "format for importing an account" @@ -684,9 +687,6 @@ "symbol": { "message": "Simbol" }, - "invalidSymbolLength": { - "message": "Simbol mora biti $1 znakova ili manje." - }, "terms": { "message": "Uslovi korišćenja" }, diff --git a/app/_locales/sv/messages.json b/app/_locales/sv/messages.json index fcdd280587a1..8b3526063054 100644 --- a/app/_locales/sv/messages.json +++ b/app/_locales/sv/messages.json @@ -359,6 +359,9 @@ "invalidSeedPhrase": { "message": "Ogiltig" }, + "invalidSymbolLength": { + "message": "Symbolen måste vara $1 tecken eller färre." + }, "jsonFile": { "message": "JSON-fil", "description": "format for importing an account" @@ -674,9 +677,6 @@ "switchNetworks": { "message": "Växla nätverk" }, - "invalidSymbolLength": { - "message": "Symbolen måste vara $1 tecken eller färre." - }, "terms": { "message": "Användarvillkor" }, diff --git a/app/_locales/sw/messages.json b/app/_locales/sw/messages.json index adef0468e142..701e530f50ac 100644 --- a/app/_locales/sw/messages.json +++ b/app/_locales/sw/messages.json @@ -356,6 +356,9 @@ "invalidSeedPhrase": { "message": "Kirai kianzio batili" }, + "invalidSymbolLength": { + "message": "Alama lazima iwe na herufi $1 au chache." + }, "jsonFile": { "message": "Faili la JSON", "description": "format for importing an account" @@ -671,9 +674,6 @@ "symbol": { "message": "Ishara" }, - "invalidSymbolLength": { - "message": "Alama lazima iwe na herufi $1 au chache." - }, "terms": { "message": "Masharti ya Matumizi" }, diff --git a/app/_locales/ta/messages.json b/app/_locales/ta/messages.json index cc8db4032a4e..eabff202f27a 100644 --- a/app/_locales/ta/messages.json +++ b/app/_locales/ta/messages.json @@ -200,6 +200,9 @@ "invalidRPC": { "message": "தவறான RPC URI" }, + "invalidSymbolLength": { + "message": "கசின்னம் $1 எழுத்துக்கள் அல்லது குறைவாக இருக்க வேண்டும்." + }, "jsonFile": { "message": "JSON கோப்பு", "description": "format for importing an account" @@ -389,9 +392,6 @@ "supportCenter": { "message": "எங்கள் ஆதரவு மையத்தைப் பார்வையிடவும்" }, - "invalidSymbolLength": { - "message": "கசின்னம் $1 எழுத்துக்கள் அல்லது குறைவாக இருக்க வேண்டும்." - }, "terms": { "message": "பயன்பாட்டு விதிமுறைகளை" }, diff --git a/app/_locales/th/messages.json b/app/_locales/th/messages.json index a4fab5f0f343..2cd5ce6f0da1 100644 --- a/app/_locales/th/messages.json +++ b/app/_locales/th/messages.json @@ -194,6 +194,9 @@ "invalidRPC": { "message": "RPC URI ไม่ถูกต้อง" }, + "invalidSymbolLength": { + "message": "สัญลักษณ์จะต้องมีความยาว $1 ตัวอักษร" + }, "jsonFile": { "message": "ไฟล์ JSON", "description": "format for importing an account" @@ -356,9 +359,6 @@ "symbol": { "message": "เครื่องหมาย" }, - "invalidSymbolLength": { - "message": "สัญลักษณ์จะต้องมีความยาว $1 ตัวอักษร" - }, "terms": { "message": "ข้อตกลงในการใช้งาน" }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index dccd306d6f2a..942479f0e281 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Di-wastong input! Ang Lihim na Parirala sa Pagbawi ay case sensitive." }, + "invalidSymbolLength": { + "message": "Dapat ay $1 character o mas kaunti ang simbolo." + }, "ipfsGateway": { "message": "IPFS gateway" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Simbolo" }, - "invalidSymbolLength": { - "message": "Dapat ay $1 character o mas kaunti ang simbolo." - }, "tenPercentIncreased": { "message": "10% na dagdag" }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 2f1675f5455b..1cbe5a4d63d1 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Giriş geçersiz! Gizli Kurtarma İfadesi büyük/küçük harf duyarlıdır." }, + "invalidSymbolLength": { + "message": "Sembol en fazla $1 karakter olmalıdır." + }, "ipfsGateway": { "message": "IPFS ağ geçidi" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Sembol" }, - "invalidSymbolLength": { - "message": "Sembol en fazla $1 karakter olmalıdır." - }, "tenPercentIncreased": { "message": "%10 artış" }, diff --git a/app/_locales/uk/messages.json b/app/_locales/uk/messages.json index e69f959287ee..6e457ce39460 100644 --- a/app/_locales/uk/messages.json +++ b/app/_locales/uk/messages.json @@ -369,6 +369,9 @@ "invalidSeedPhrase": { "message": "Недійсна seed-фраза" }, + "invalidSymbolLength": { + "message": "Символ повинен містити $1 символів або менше." + }, "jsonFile": { "message": "Файл JSON", "description": "format for importing an account" @@ -693,9 +696,6 @@ "symbol": { "message": "Символ" }, - "invalidSymbolLength": { - "message": "Символ повинен містити $1 символів або менше." - }, "terms": { "message": "Умови використання" }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 2ea49146e6f0..930926c5a161 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "Nội dung nhập không hợp lệ! Cụm từ khôi phục bí mật phân biệt chữ hoa và chữ thường." }, + "invalidSymbolLength": { + "message": "Ký hiệu không được dài quá $1 ký tự." + }, "ipfsGateway": { "message": "Cổng IPFS" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "Ký hiệu" }, - "invalidSymbolLength": { - "message": "Ký hiệu không được dài quá $1 ký tự." - }, "tenPercentIncreased": { "message": "Tăng 10%" }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 0c8b64d95a18..cdb3550ee7e3 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -1970,6 +1970,9 @@ "invalidSeedPhraseCaseSensitive": { "message": "输入无效!私钥助记词须区分大小写。" }, + "invalidSymbolLength": { + "message": "符号不得超过$1个字符。" + }, "ipfsGateway": { "message": "IPFS网关" }, @@ -4260,9 +4263,6 @@ "symbol": { "message": "符号" }, - "invalidSymbolLength": { - "message": "符号不得超过$1个字符。" - }, "tenPercentIncreased": { "message": "增加10%" }, diff --git a/app/_locales/zh_TW/messages.json b/app/_locales/zh_TW/messages.json index 56530e3cc8b5..ad19677f584d 100644 --- a/app/_locales/zh_TW/messages.json +++ b/app/_locales/zh_TW/messages.json @@ -751,6 +751,9 @@ "invalidSeedPhrase": { "message": "無效的助憶詞" }, + "invalidSymbolLength": { + "message": "符號不得超過 $1 個字元。" + }, "jsonFile": { "message": "JSON 格式檔案", "description": "format for importing an account" @@ -1324,9 +1327,6 @@ "symbol": { "message": "符號" }, - "invalidSymbolLength": { - "message": "符號不得超過 $1 個字元。" - }, "terms": { "message": "使用條款" }, From 208e4be7802d934cefe9cc2c954834b26ff911d9 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Wed, 21 Aug 2024 11:49:21 +0000 Subject: [PATCH 08/13] fix(comment): typo. --- shared/modules/swaps.utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/modules/swaps.utils.js b/shared/modules/swaps.utils.js index 799f17d1df85..196e0eb5962d 100644 --- a/shared/modules/swaps.utils.js +++ b/shared/modules/swaps.utils.js @@ -22,7 +22,7 @@ export function isSwapsDefaultTokenAddress(address, chainId) { * * @param {string} symbol - The string to compare to the default token symbol * @param {string} chainId - The hex encoded chain ID of the default swaps token to check - * @returns {boolean} Whether the symbl is the provided chain's default token symbol + * @returns {boolean} Whether the symbol is the provided chain's default token symbol */ export function isSwapsDefaultTokenSymbol(symbol, chainId) { if (!symbol || !chainId) { From 866210021927ceda7d5a9f8772c807518875e0cb Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Wed, 21 Aug 2024 15:01:33 +0000 Subject: [PATCH 09/13] refactor(ellipsify): only apply if the length is more than ELLIPSIFY_LENGTH. --- shared/constants/tokens.js | 2 ++ .../asset-picker-amount/asset-picker/asset-picker.tsx | 6 +----- ui/pages/confirmations/send/send.utils.js | 11 ++++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index f67dba883cff..dfa179337de9 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -52,3 +52,5 @@ export const NUM_W_OPT_DECIMAL_COMMA_OR_DOT_REGEX = export const DECIMAL_REGEX = /\.(\d*)/u; export const MAX_SYMBOL_LENGTH = 100; + +export const ELLIPSIFY_LENGTH = 13; // 6 (start) + 4 (end) + 3 (...) \ No newline at end of file diff --git a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx index ea382450fbd1..63c2d3e23647 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx @@ -46,8 +46,6 @@ import { } from '../../../../../shared/constants/metametrics'; import { ellipsify } from '../../../../pages/confirmations/send/send.utils'; -const ELLIPSIFY_LENGTH = 13; // 6 (start) + 4 (end) + 3 (...) - export type AssetPickerProps = { asset: Asset; /** @@ -215,9 +213,7 @@ export function AssetPicker({ color={TextColor.textAlternative} > # - {String(asset.details.tokenId).length < ELLIPSIFY_LENGTH - ? asset.details.tokenId - : ellipsify(String(asset.details.tokenId), 6, 4)} + {ellipsify(String(asset.details.tokenId))} )} diff --git a/ui/pages/confirmations/send/send.utils.js b/ui/pages/confirmations/send/send.utils.js index e5e787142fa1..3310635ec73d 100644 --- a/ui/pages/confirmations/send/send.utils.js +++ b/ui/pages/confirmations/send/send.utils.js @@ -8,6 +8,7 @@ import { NFT_TRANSFER_FROM_FUNCTION_SIGNATURE, NFT_SAFE_TRANSFER_FROM_FUNCTION_SIGNATURE, } from './send.constants'; +import { ELLIPSIFY_LENGTH } from '../../../../shared/constants/tokens'; export { addGasBuffer, @@ -177,10 +178,18 @@ function getAssetTransferData({ sendToken, fromAddress, toAddress, amount }) { } } +/** + * Truncates a given string to a specified length by displaying start and end parts with ellipsis ('...'). + * Returns full string if under ELLIPSIFY_LENGTH. + * @param {Token Name or Symbol} text - The input string to be truncated. + * @param {number} first - The number of characters to display at the beginning of the string (default is 6). + * @param {number} last - The number of characters to display at the end of the string (default is 4). + * @returns {string} A truncated version of the input string. + */ function ellipsify(text, first = 6, last = 4) { if (!text) { return ''; } - return `${text.slice(0, first)}...${text.slice(-last)}`; + return (text.length < ELLIPSIFY_LENGTH) ? text : `${text.slice(0, first)}...${text.slice(-last)}`; } From f8e573b27502dc9bc24acc7d682f0e5224f12e3f Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Wed, 21 Aug 2024 19:19:57 +0000 Subject: [PATCH 10/13] chore(rename): token symbol length. --- shared/constants/tokens.js | 3 ++- .../multichain/import-tokens-modal/import-tokens-modal.js | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index dfa179337de9..085e26800016 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -51,6 +51,7 @@ export const NUM_W_OPT_DECIMAL_COMMA_OR_DOT_REGEX = /^[0-9]{1,}([,.][0-9]{1,})?$/u; export const DECIMAL_REGEX = /\.(\d*)/u; -export const MAX_SYMBOL_LENGTH = 100; +export const MAX_VALID_SYMBOL_LENGTH = 100; +export const MAX_SYMBOL_DISPLAY_LENGTH = 18; export const ELLIPSIFY_LENGTH = 13; // 6 (start) + 4 (end) + 3 (...) \ No newline at end of file diff --git a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js index 0922f07c7c9c..b9ab54f9558a 100644 --- a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js +++ b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js @@ -76,7 +76,7 @@ import { import { addHexPrefix } from '../../../../app/scripts/lib/util'; import { STATIC_MAINNET_TOKEN_LIST, - MAX_SYMBOL_LENGTH, + MAX_VALID_SYMBOL_LENGTH, } from '../../../../shared/constants/tokens'; import { AssetType, @@ -256,8 +256,8 @@ export const ImportTokensModal = ({ onClose }) => { const symbolLength = symbol.length; let symbolError = null; - if (symbolLength < 1 || symbolLength > MAX_SYMBOL_LENGTH) { - symbolError = t('invalidSymbolLength').replace('$1', MAX_SYMBOL_LENGTH); + if (symbolLength < 1 || symbolLength > MAX_VALID_SYMBOL_LENGTH) { + symbolError = t('invalidSymbolLength').replace('$1', MAX_VALID_SYMBOL_LENGTH); } setCustomSymbol(symbol); From 9e5f02868015ed47764970a456f6372469ff6c67 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Wed, 21 Aug 2024 20:14:20 +0000 Subject: [PATCH 11/13] feat(token_symbol): ellipsify. --- .../token-list-item/token-list-item.js | 16 +++++++++------- ui/hooks/useTokensToSearch.js | 12 +++++++----- ui/pages/asset/components/asset-page.tsx | 9 ++++++--- ui/pages/confirmations/hooks/useAssetDetails.js | 3 ++- ui/pages/confirmations/send/send.utils.js | 7 +++++-- ui/pages/swaps/selected-token/selected-token.js | 5 +++-- ui/pages/swaps/swaps.util.ts | 8 +++++++- 7 files changed, 39 insertions(+), 21 deletions(-) diff --git a/ui/components/multichain/token-list-item/token-list-item.js b/ui/components/multichain/token-list-item/token-list-item.js index ed69d6638b37..bdd76183b785 100644 --- a/ui/components/multichain/token-list-item/token-list-item.js +++ b/ui/components/multichain/token-list-item/token-list-item.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import classnames from 'classnames'; +import { ellipsify } from '../../../pages/confirmations/send/send.utils'; import { zeroAddress } from 'ethereumjs-util'; import { AlignItems, @@ -121,7 +122,8 @@ export const TokenListItem = ({ tokensMarketData?.[address]?.pricePercentChange1d; const tokenTitle = getTokenTitle(); - const tokenMainTitleToDisplay = showPercentage ? tokenTitle : tokenSymbol; + const tokenSymbolEllipsified = ellipsify(tokenSymbol); + let tokenMainTitleToDisplay = showPercentage ? ellipsify(tokenTitle) : tokenSymbolEllipsified; const stakeableTitle = ( @@ -341,7 +343,7 @@ export const TokenListItem = ({ variant={TextVariant.bodyMd} textAlign={TextAlign.End} > - {primary} {isNativeCurrency ? '' : tokenSymbol} + {primary} {isNativeCurrency ? '' : tokenSymbolEllipsified} ) : ( @@ -367,7 +369,7 @@ export const TokenListItem = ({ variant={TextVariant.bodyMd} textAlign={TextAlign.End} > - {primary} {isNativeCurrency ? '' : tokenSymbol} + {primary} {isNativeCurrency ? '' : tokenSymbolEllipsified} )} @@ -388,7 +390,7 @@ export const TokenListItem = ({ {t('nativeTokenScamWarningTitle')} - {t('nativeTokenScamWarningDescription', [tokenSymbol])} + {t('nativeTokenScamWarningDescription', [tokenSymbolEllipsified])} 0) { // This condition improves performance significantly, because it only gets a contract exchange rate @@ -43,7 +45,7 @@ export function getRenderableTokenData( conversionRate, currentCurrency, string, - symbol, + symbolEllipsified, true, ) || ''; const rawFiat = formattedFiat @@ -52,7 +54,7 @@ export function getRenderableTokenData( conversionRate, currentCurrency, string, - symbol, + symbolEllipsified, false, ) : ''; @@ -81,10 +83,10 @@ export function getRenderableTokenData( return { ...token, - primaryLabel: symbol, + primaryLabel: symbolEllipsified, secondaryLabel: name || tokenList[address?.toLowerCase()]?.name, rightPrimaryLabel: - string && `${new BigNumber(string).round(6).toString()} ${symbol}`, + string && `${new BigNumber(string).round(6).toString()} ${symbolEllipsified}`, rightSecondaryLabel: formattedFiat, iconUrl: usedIconUrl, identiconAddress: usedIconUrl ? null : address, diff --git a/ui/pages/asset/components/asset-page.tsx b/ui/pages/asset/components/asset-page.tsx index f10158e08ae3..f6cd90140964 100644 --- a/ui/pages/asset/components/asset-page.tsx +++ b/ui/pages/asset/components/asset-page.tsx @@ -44,6 +44,7 @@ import CoinButtons from '../../../components/app/wallet-overview/coin-buttons'; import { getIsNativeTokenBuyable } from '../../../ducks/ramps'; import AssetChart from './chart/asset-chart'; import TokenButtons from './token-buttons'; +import { ellipsify } from '../../confirmations/send/send.utils'; /** Information about a native or token asset */ export type Asset = ( @@ -149,9 +150,11 @@ const AssetPage = ({ onClick={() => history.push(DEFAULT_ROUTE)} /> - {name && symbol && name !== symbol - ? `${name} (${symbol})` - : name ?? symbol} + {ellipsify( + name && symbol && name !== symbol + ? `${name} (${symbol})` + : name ?? symbol + )} {optionsButton} diff --git a/ui/pages/confirmations/hooks/useAssetDetails.js b/ui/pages/confirmations/hooks/useAssetDetails.js index 2d447c7f5995..f20a443bff0a 100644 --- a/ui/pages/confirmations/hooks/useAssetDetails.js +++ b/ui/pages/confirmations/hooks/useAssetDetails.js @@ -10,6 +10,7 @@ import { import { isEqualCaseInsensitive } from '../../../../shared/modules/string-utils'; import { usePrevious } from '../../../hooks/usePrevious'; import { useTokenTracker } from '../../../hooks/useTokenTracker'; +import { ellipsify } from '../send/send.utils'; export function useAssetDetails(tokenAddress, userAddress, transactionData) { const dispatch = useDispatch(); @@ -85,7 +86,7 @@ export function useAssetDetails(tokenAddress, userAddress, transactionData) { tokenAmount, assetAddress: tokenAddress, assetStandard: standard, - tokenSymbol: symbol ?? '', + tokenSymbol: ellipsify(symbol) ?? '', tokenImage: image, userBalance: balance, assetName: name, diff --git a/ui/pages/confirmations/send/send.utils.js b/ui/pages/confirmations/send/send.utils.js index 3310635ec73d..670ae4a89ddc 100644 --- a/ui/pages/confirmations/send/send.utils.js +++ b/ui/pages/confirmations/send/send.utils.js @@ -8,7 +8,7 @@ import { NFT_TRANSFER_FROM_FUNCTION_SIGNATURE, NFT_SAFE_TRANSFER_FROM_FUNCTION_SIGNATURE, } from './send.constants'; -import { ELLIPSIFY_LENGTH } from '../../../../shared/constants/tokens'; +import { MAX_SYMBOL_DISPLAY_LENGTH } from '../../../../shared/constants/tokens'; export { addGasBuffer, @@ -191,5 +191,8 @@ function ellipsify(text, first = 6, last = 4) { return ''; } - return (text.length < ELLIPSIFY_LENGTH) ? text : `${text.slice(0, first)}...${text.slice(-last)}`; + return ( + text.length < MAX_SYMBOL_DISPLAY_LENGTH) ? + text : + `${text.slice(0, first)}...${text.slice(-last)}`; } diff --git a/ui/pages/swaps/selected-token/selected-token.js b/ui/pages/swaps/selected-token/selected-token.js index 516dbdc246e3..dd19247ee36e 100644 --- a/ui/pages/swaps/selected-token/selected-token.js +++ b/ui/pages/swaps/selected-token/selected-token.js @@ -10,6 +10,7 @@ import { import { IconColor } from '../../../helpers/constants/design-system'; import UrlIcon from '../../../components/ui/url-icon'; import { I18nContext } from '../../../contexts/i18n'; +import { ellipsify } from '../../confirmations/send/send.utils'; export default function SelectedToken({ onClick, @@ -45,7 +46,7 @@ export default function SelectedToken({ )}
- {selectedToken?.symbol || t('swapSelectAToken')} + {ellipsify(selectedToken?.symbol) || t('swapSelectAToken')}
diff --git a/ui/pages/swaps/swaps.util.ts b/ui/pages/swaps/swaps.util.ts index ce06d4ef37f8..74df93c4256f 100644 --- a/ui/pages/swaps/swaps.util.ts +++ b/ui/pages/swaps/swaps.util.ts @@ -44,6 +44,7 @@ import { sumHexes, } from '../../../shared/modules/conversion.utils'; import { EtherDenomination } from '../../../shared/constants/common'; +import { ellipsify } from '../confirmations/send/send.utils'; const CACHE_REFRESH_FIVE_MINUTES = 300000; const USD_CURRENCY_CODE = 'usd'; @@ -124,12 +125,17 @@ export async function fetchToken( chainId: any, ): Promise { const tokenUrl = getBaseApi('token', chainId); - return await fetchWithCache({ + const token = await fetchWithCache({ url: `${tokenUrl}?address=${contractAddress}`, fetchOptions: { method: 'GET', headers: clientIdHeader }, cacheOptions: { cacheRefreshTime: CACHE_REFRESH_FIVE_MINUTES }, functionName: 'fetchToken', }); + + if (token?.symbol) token.symbol = ellipsify(token.symbol); + if (token.name) token.name = ellipsify(token.name); + + return token; } export async function fetchBlockedTokens( From bcb93bc4a43fc47978137db3055bcdeb20b28db2 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Wed, 21 Aug 2024 20:15:06 +0000 Subject: [PATCH 12/13] fix(search): make the symbol uppercase when searching. --- ui/pages/swaps/list-with-search/list-with-search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/pages/swaps/list-with-search/list-with-search.js b/ui/pages/swaps/list-with-search/list-with-search.js index 6208e6d0f8bb..fa37f68e0244 100644 --- a/ui/pages/swaps/list-with-search/list-with-search.js +++ b/ui/pages/swaps/list-with-search/list-with-search.js @@ -92,7 +92,7 @@ export default function ListWithSearch({ } } else { filteredItems = filter(itemsToSearch, function (item) { - return item.symbol.includes(trimmedNewSearchQueryUpperCase); + return item.symbol.toUpperCase().includes(trimmedNewSearchQueryUpperCase); }); } const results = newSearchQuery === '' ? itemsToSearch : filteredItems; From 35fadb1becf2f05ed90f47792e96dd2b407b2932 Mon Sep 17 00:00:00 2001 From: MehdizadeMilad Date: Wed, 21 Aug 2024 20:20:41 +0000 Subject: [PATCH 13/13] chore(formatting): apply linter. --- shared/constants/tokens.js | 2 +- .../asset-picker-amount/asset-picker/asset-picker.tsx | 3 +-- .../import-tokens-modal/import-tokens-modal.js | 5 ++++- .../multichain/token-list-item/token-list-item.js | 6 ++++-- ui/hooks/useTokensToSearch.js | 3 ++- ui/pages/asset/components/asset-page.tsx | 4 ++-- ui/pages/confirmations/send/send.utils.js | 10 +++++----- ui/pages/swaps/list-with-search/list-with-search.js | 4 +++- ui/pages/swaps/swaps.util.ts | 8 ++++++-- 9 files changed, 28 insertions(+), 17 deletions(-) diff --git a/shared/constants/tokens.js b/shared/constants/tokens.js index 085e26800016..1e44a5b3d53b 100644 --- a/shared/constants/tokens.js +++ b/shared/constants/tokens.js @@ -54,4 +54,4 @@ export const DECIMAL_REGEX = /\.(\d*)/u; export const MAX_VALID_SYMBOL_LENGTH = 100; export const MAX_SYMBOL_DISPLAY_LENGTH = 18; -export const ELLIPSIFY_LENGTH = 13; // 6 (start) + 4 (end) + 3 (...) \ No newline at end of file +export const ELLIPSIFY_LENGTH = 13; // 6 (start) + 4 (end) + 3 (...) diff --git a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx index 63c2d3e23647..27b8e4046bec 100644 --- a/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx +++ b/ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx @@ -212,8 +212,7 @@ export function AssetPicker({ variant={TextVariant.bodySm} color={TextColor.textAlternative} > - # - {ellipsify(String(asset.details.tokenId))} + #{ellipsify(String(asset.details.tokenId))} )} diff --git a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js index b9ab54f9558a..b1aac8777d8c 100644 --- a/ui/components/multichain/import-tokens-modal/import-tokens-modal.js +++ b/ui/components/multichain/import-tokens-modal/import-tokens-modal.js @@ -257,7 +257,10 @@ export const ImportTokensModal = ({ onClose }) => { let symbolError = null; if (symbolLength < 1 || symbolLength > MAX_VALID_SYMBOL_LENGTH) { - symbolError = t('invalidSymbolLength').replace('$1', MAX_VALID_SYMBOL_LENGTH); + symbolError = t('invalidSymbolLength').replace( + '$1', + MAX_VALID_SYMBOL_LENGTH, + ); } setCustomSymbol(symbol); diff --git a/ui/components/multichain/token-list-item/token-list-item.js b/ui/components/multichain/token-list-item/token-list-item.js index bdd76183b785..78f6a9b330c9 100644 --- a/ui/components/multichain/token-list-item/token-list-item.js +++ b/ui/components/multichain/token-list-item/token-list-item.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import classnames from 'classnames'; -import { ellipsify } from '../../../pages/confirmations/send/send.utils'; import { zeroAddress } from 'ethereumjs-util'; +import { ellipsify } from '../../../pages/confirmations/send/send.utils'; import { AlignItems, BackgroundColor, @@ -123,7 +123,9 @@ export const TokenListItem = ({ const tokenTitle = getTokenTitle(); const tokenSymbolEllipsified = ellipsify(tokenSymbol); - let tokenMainTitleToDisplay = showPercentage ? ellipsify(tokenTitle) : tokenSymbolEllipsified; + const tokenMainTitleToDisplay = showPercentage + ? ellipsify(tokenTitle) + : tokenSymbolEllipsified; const stakeableTitle = ( diff --git a/ui/pages/confirmations/send/send.utils.js b/ui/pages/confirmations/send/send.utils.js index 670ae4a89ddc..e5c9da36ef8b 100644 --- a/ui/pages/confirmations/send/send.utils.js +++ b/ui/pages/confirmations/send/send.utils.js @@ -3,12 +3,12 @@ import { encode } from '@metamask/abi-utils'; import { addHexPrefix } from '../../../../app/scripts/lib/util'; import { TokenStandard } from '../../../../shared/constants/transaction'; import { Numeric } from '../../../../shared/modules/Numeric'; +import { MAX_SYMBOL_DISPLAY_LENGTH } from '../../../../shared/constants/tokens'; import { TOKEN_TRANSFER_FUNCTION_SIGNATURE, NFT_TRANSFER_FROM_FUNCTION_SIGNATURE, NFT_SAFE_TRANSFER_FROM_FUNCTION_SIGNATURE, } from './send.constants'; -import { MAX_SYMBOL_DISPLAY_LENGTH } from '../../../../shared/constants/tokens'; export { addGasBuffer, @@ -181,6 +181,7 @@ function getAssetTransferData({ sendToken, fromAddress, toAddress, amount }) { /** * Truncates a given string to a specified length by displaying start and end parts with ellipsis ('...'). * Returns full string if under ELLIPSIFY_LENGTH. + * * @param {Token Name or Symbol} text - The input string to be truncated. * @param {number} first - The number of characters to display at the beginning of the string (default is 6). * @param {number} last - The number of characters to display at the end of the string (default is 4). @@ -191,8 +192,7 @@ function ellipsify(text, first = 6, last = 4) { return ''; } - return ( - text.length < MAX_SYMBOL_DISPLAY_LENGTH) ? - text : - `${text.slice(0, first)}...${text.slice(-last)}`; + return text.length < MAX_SYMBOL_DISPLAY_LENGTH + ? text + : `${text.slice(0, first)}...${text.slice(-last)}`; } diff --git a/ui/pages/swaps/list-with-search/list-with-search.js b/ui/pages/swaps/list-with-search/list-with-search.js index fa37f68e0244..b038696968cb 100644 --- a/ui/pages/swaps/list-with-search/list-with-search.js +++ b/ui/pages/swaps/list-with-search/list-with-search.js @@ -92,7 +92,9 @@ export default function ListWithSearch({ } } else { filteredItems = filter(itemsToSearch, function (item) { - return item.symbol.toUpperCase().includes(trimmedNewSearchQueryUpperCase); + return item.symbol + .toUpperCase() + .includes(trimmedNewSearchQueryUpperCase); }); } const results = newSearchQuery === '' ? itemsToSearch : filteredItems; diff --git a/ui/pages/swaps/swaps.util.ts b/ui/pages/swaps/swaps.util.ts index 74df93c4256f..26c84465c597 100644 --- a/ui/pages/swaps/swaps.util.ts +++ b/ui/pages/swaps/swaps.util.ts @@ -132,8 +132,12 @@ export async function fetchToken( functionName: 'fetchToken', }); - if (token?.symbol) token.symbol = ellipsify(token.symbol); - if (token.name) token.name = ellipsify(token.name); + if (token?.symbol) { + token.symbol = ellipsify(token.symbol); + } + if (token.name) { + token.name = ellipsify(token.name); + } return token; }