Merge pull request #2712 from dlvoy/fix/sms_otp_i18n

Add missing translation keys and values for SMS communicator OTP setup
This commit is contained in:
Milos Kozak 2023-08-28 16:00:24 +02:00 committed by GitHub
commit 0105d24869
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View file

@ -54,10 +54,10 @@ class SmsCommunicatorOtpActivity : TranslatedDaggerAppCompatActivity() {
val checkResult = otp.checkOTP(s.toString())
binding.otpVerifyLabel.text = when (checkResult) {
OneTimePasswordValidationResult.OK -> "OK"
OneTimePasswordValidationResult.ERROR_WRONG_LENGTH -> "INVALID SIZE!"
OneTimePasswordValidationResult.ERROR_WRONG_PIN -> "WRONG PIN"
OneTimePasswordValidationResult.ERROR_WRONG_OTP -> "WRONG OTP"
OneTimePasswordValidationResult.OK -> rh.gs(R.string.smscommunicator_otp_verification_ok)
OneTimePasswordValidationResult.ERROR_WRONG_LENGTH -> rh.gs(R.string.smscommunicator_otp_verification_ivalid_size)
OneTimePasswordValidationResult.ERROR_WRONG_PIN -> rh.gs(R.string.smscommunicator_otp_verification_wrong_pin)
OneTimePasswordValidationResult.ERROR_WRONG_OTP -> rh.gs(R.string.smscommunicator_otp_verification_wrong_otp)
}
binding.otpVerifyLabel.setTextColor(
@ -70,9 +70,13 @@ class SmsCommunicatorOtpActivity : TranslatedDaggerAppCompatActivity() {
)
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
/* left blank because we only need afterTextChanged */
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
/* left blank because we only need afterTextChanged */
}
})
binding.otpReset.setOnClickListener {

View file

@ -31,6 +31,10 @@
<string name="smscommunicator_otp_reset_header">Reset Authenticators</string>
<string name="smscommunicator_otp_install_info">On each follower phone install Authenticator app that support RFC 6238 TOTP tokens. Popular free apps are:\n • Authy\n • Google Authenticator\n • LastPass Authenticator\n • FreeOTP Authenticator</string>
<string name="smscommunicator_otp_reset_warning">By resetting authenticator you make all already provisioned authenticators invalid. You will need to set up them again!</string>
<string name="smscommunicator_otp_verification_ok">OK</string>
<string name="smscommunicator_otp_verification_ivalid_size">INVALID SIZE!</string>
<string name="smscommunicator_otp_verification_wrong_pin">WRONG PIN</string>
<string name="smscommunicator_otp_verification_wrong_otp">WRONG OTP</string>
<string name="sms_wrong_code">Wrong code. Command cancelled.</string>
<string name="sms_timeout_while_waiting">Timeout while waiting for finish of previous pump communication</string>
<string name="smscommunicator_allowednumbers">Allowed phone numbers</string>