BIT-1927: Add updated translations and update Duo strings (#1046)

This commit is contained in:
David Perez
2024-02-22 09:11:10 -06:00
committed by Álison Fernandes
parent 64e6cb0bff
commit 3211e902d4
10 changed files with 115 additions and 106 deletions

View File

@@ -172,8 +172,7 @@ class TwoFactorLoginViewModel @Inject constructor(
)
}
?: TwoFactorLoginEvent.ShowToast(
// TODO BIT-1927 Update to use string resource
message = "Duo not yet supported".asText(),
message = R.string.generic_error_message.asText(),
),
)
} else {
@@ -434,7 +433,7 @@ data class TwoFactorLoginState(
*/
val buttonText: Text
get() = if (authMethod.isDuo) {
"Launch Duo".asText() // TODO BIT-1927 replace with string resource
R.string.launch_duo.asText()
} else {
R.string.continue_text.asText()
}

View File

@@ -13,10 +13,11 @@ import com.x8bit.bitwarden.ui.platform.base.util.concat
val TwoFactorAuthMethod.title: Text
get() = when (this) {
TwoFactorAuthMethod.AUTHENTICATOR_APP -> R.string.authenticator_app_title.asText()
TwoFactorAuthMethod.DUO -> "Duo".asText() // TODO BIT-1927 replace with string resource
TwoFactorAuthMethod.DUO_ORGANIZATION -> "Duo (".asText()
.concat(R.string.organization.asText())
.concat(")".asText()) // TODO BIT-1927 replace with string resource
TwoFactorAuthMethod.DUO -> R.string.duo_title.asText()
TwoFactorAuthMethod.DUO_ORGANIZATION -> R.string.duo_org_title.asText(
R.string.organization.asText(),
)
TwoFactorAuthMethod.EMAIL -> R.string.email.asText()
TwoFactorAuthMethod.RECOVERY_CODE -> R.string.recovery_code_title.asText()
TwoFactorAuthMethod.YUBI_KEY -> R.string.yubi_key_title.asText()
@@ -28,10 +29,14 @@ val TwoFactorAuthMethod.title: Text
*/
fun TwoFactorAuthMethod.description(email: String): Text = when (this) {
TwoFactorAuthMethod.AUTHENTICATOR_APP -> R.string.enter_verification_code_app.asText()
TwoFactorAuthMethod.DUO,
TwoFactorAuthMethod.DUO_ORGANIZATION,
-> "Follow the steps from Duo to finish logging in."
.asText() // TODO BIT-1927 replace with string resource
TwoFactorAuthMethod.DUO -> R.string.follow_the_steps_from_duo_to_finish_logging_in.asText()
TwoFactorAuthMethod.DUO_ORGANIZATION -> {
R.string.duo_two_step_login_is_required_for_your_account
.asText()
.concat(" ".asText())
.concat(R.string.follow_the_steps_from_duo_to_finish_logging_in.asText())
}
TwoFactorAuthMethod.EMAIL -> R.string.enter_verification_code_email.asText(email)
TwoFactorAuthMethod.YUBI_KEY -> R.string.yubi_key_instruction.asText()
else -> "".asText()