From 5082defddf96d719ac4677852c5f7d863faae376 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 17 Jul 2020 17:23:48 +0200 Subject: [PATCH] i18n deactivated account error --- CHANGES.md | 2 +- .../main/java/im/vector/riotx/core/error/ErrorFormatter.kt | 5 ++++- vector/src/main/res/values/strings.xml | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0099412196..b2ef53ff57 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,7 +21,7 @@ Build šŸ§±: - Other changes: - - + - i18n deactivated account error Changes in Element 1.0.0 (2020-07-15) =================================================== diff --git a/vector/src/main/java/im/vector/riotx/core/error/ErrorFormatter.kt b/vector/src/main/java/im/vector/riotx/core/error/ErrorFormatter.kt index 907107c90b..e33f19a59c 100644 --- a/vector/src/main/java/im/vector/riotx/core/error/ErrorFormatter.kt +++ b/vector/src/main/java/im/vector/riotx/core/error/ErrorFormatter.kt @@ -51,7 +51,7 @@ class DefaultErrorFormatter @Inject constructor( stringProvider.getString(R.string.login_error_unknown_host) is SSLPeerUnverifiedException -> stringProvider.getString(R.string.login_error_ssl_peer_unverified) - is SSLException -> + is SSLException -> stringProvider.getString(R.string.login_error_ssl_other) else -> stringProvider.getString(R.string.error_no_network) @@ -84,6 +84,9 @@ class DefaultErrorFormatter @Inject constructor( throwable.error.code == MatrixError.M_THREEPID_NOT_FOUND -> { stringProvider.getString(R.string.login_reset_password_error_not_found) } + throwable.error.code == MatrixError.M_USER_DEACTIVATED -> { + stringProvider.getString(R.string.auth_invalid_login_deactivated_account) + } else -> { throwable.error.message.takeIf { it.isNotEmpty() } ?: throwable.error.code.takeIf { it.isNotEmpty() } diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index a3c69a772c..0f9941e64c 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2392,6 +2392,7 @@ Not all features in Riot are implemented in Element yet. Main missing (and comin Sends a message as plain text, without interpreting it as markdown Incorrect username and/or password. The entered password starts or ends with spaces, please check it. + This account has been deactivated. Messageā€¦