diff --git a/core/res/src/main/java/com/tangem/core/res/Resources.kt b/core/res/src/main/java/com/tangem/core/res/Resources.kt index 46ceaa8b3a..aea235e3ae 100644 --- a/core/res/src/main/java/com/tangem/core/res/Resources.kt +++ b/core/res/src/main/java/com/tangem/core/res/Resources.kt @@ -29,7 +29,7 @@ fun Resources.getStringSafe(@StringRes id: Int, vararg formatArgs: Any): String // If something goes wrong, returns the resource without arguments val string = getString(id) - reportIssue(resources = this, id, *formatArgs) + reportIssue(it, resources = this, id, *formatArgs) string } @@ -61,19 +61,20 @@ fun Resources.getPluralStringSafe(@PluralsRes id: Int, count: Int, vararg format private fun Result.getOrResourceName(resources: Resources, id: Int, vararg formatArgs: Any): String { return getOrElse { - reportIssue(resources, id, formatArgs) + reportIssue(it, resources, id, formatArgs) // If something still goes wrong, returns the resource name resources.getResourceEntryName(id) } } -private fun reportIssue(resources: Resources, id: Int, vararg formatArgs: Any) { +private fun reportIssue(throwable: Throwable, resources: Resources, id: Int, vararg formatArgs: Any) { val exception = IllegalStateException( "An error occurred while parsing the string:\n" + "\tname: R.string.${resources.getResourceEntryName(id)}\n" + "\targs: ${formatArgs.joinToString(prefix = "[", postfix = "]") { it.toString() }}\n" + - "\tlocale: ${SupportedLanguages.getCurrentSupportedLanguageCode()}\n", + "\tlocale: ${SupportedLanguages.getCurrentSupportedLanguageCode()}\n" + + "\terror message: ${throwable.message.orEmpty()}\n", ) Timber.tag("Resources").e(exception) diff --git a/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt b/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt index a251b0c9ed..ebce7baf36 100644 --- a/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt +++ b/core/ui/src/main/java/com/tangem/core/ui/utils/DecimalFormatterExt.kt @@ -17,7 +17,8 @@ const val DECIMAL_SEPARATOR_LIMIT = 1 @Composable fun rememberDecimalFormat(): DecimalFormat { - val locale = LocalConfiguration.current.locale + val locales = LocalConfiguration.current.locales + val locale = if (locales.isEmpty) Locale.getDefault() else locales[0] val decimalSymbols = remember { DecimalFormatSymbols.getInstance(locale) } return remember { diff --git a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt index b5a6372037..c7e67f5415 100644 --- a/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt +++ b/features/staking/impl/src/main/java/com/tangem/features/staking/impl/presentation/ui/StakingTosText.kt @@ -12,8 +12,8 @@ import com.tangem.features.staking.impl.R private const val TERMS_OF_USE_KEY = "termsOfUse" private const val PRIVACY_POLICY_KEY = "privacyPolicy" -private const val TERMS_OF_USE_URL = "https://docs.stakek.it/docs/terms-of-use" -private const val PRIVACY_POLICY_URL = "https://docs.stakek.it/docs/privacy-policy" +private const val TERMS_OF_USE_URL = "https://docs.yield.xyz/docs/terms-of-use#/" +private const val PRIVACY_POLICY_URL = "https://docs.yield.xyz/docs/privacy-policy#/" @Composable internal fun StakingTosText(onTextClick: (String) -> Unit) {