Updated on 2026-08-14

This commit is contained in:
Tangem 2022-04-15 00:22:42 +03:00
parent 7cf2836cfc
commit 609959e07f
4 changed files with 8 additions and 4 deletions

View file

@ -36,13 +36,15 @@ private class AddCustomTokenConverter(
AddCustomTokenError.InvalidContractAddress -> R.string.custom_token_creation_error_invalid_contract_address
AddCustomTokenError.NetworkIsNotSelected -> R.string.custom_token_creation_error_network_not_selected
AddCustomTokenError.InvalidDerivationPath -> R.string.custom_token_creation_error_invalid_derivation_path
AddCustomTokenError.InvalidDecimalsCount -> R.string.custom_token_creation_error_wrong_decimals
AddCustomTokenError.FieldIsEmpty -> R.string.custom_token_creation_error_empty_fields
AddCustomTokenError.InvalidDecimalsCount -> {
context.getString(R.string.custom_token_creation_error_wrong_decimals, 30)
}
AddCustomTokenError.FieldIsEmpty -> R.string.custom_token_creation_error_required_field
else -> null
}
return when (rawMessage) {
is Int -> context.getString(rawMessage)
// is String -> rawMessage
is String -> rawMessage
else -> "Unknown error: ${customTokenError::class.java.simpleName}"
}
}

View file

@ -68,7 +68,7 @@ private fun AllInOne() {
)
// unknown
ContractAddressButton(
name = "unk",
name = "unknown",
address = "0x1111111111111111112111111111111111111113"
)
}

View file

@ -202,6 +202,7 @@
<string name="token_icon">Значок токена</string>
<string name="add_custom_token_title" translatable="false">Добавить токен</string>
<string name="custom_token_contract_address_input_title">Адрес контракта</string>
<string name="custom_token_creation_error_required_field">Обязательное поле</string>
<string name="custom_token_creation_error_network_not_selected">Пожалуйста, выберите сеть</string>
<string name="custom_token_creation_error_empty_fields">Пожалуйста, заполните все поля</string>
<string name="custom_token_creation_error_wrong_decimals">Количество знаков после запятой должно быть корректным числом не больше %d</string>

View file

@ -84,6 +84,7 @@
<string name="add_custom_token_title" translatable="false">Add Token</string>
<string name="custom_token_contract_address_input_title" translatable="false">Contract address</string>
<string name="custom_token_creation_error_required_field" translatable="false">Required field</string>
<string name="custom_token_creation_error_network_not_selected" translatable="false">Please select the network</string>
<string name="custom_token_creation_error_empty_fields" translatable="false">Please fill in all the fields</string>
<string name="custom_token_creation_error_wrong_decimals" translatable="false">Decimal number must be a valid integer, no higher than %d</string>