extracting hardcoded error message to the resources

This commit is contained in:
Adam Brown 2022-03-31 18:07:27 +01:00
parent 801fb90f7b
commit 13fb4e52af
4 changed files with 4 additions and 3 deletions

View File

@ -125,7 +125,7 @@ class LoginFragment @Inject constructor() : AbstractSSOLoginFragment<FragmentLog
error++
}
if (isSignupMode && isNumericOnlyUserIdForbidden && login.isDigitsOnly()) {
views.loginFieldTil.error = "The homeserver does not accept username with only digits."
views.loginFieldTil.error = getString(R.string.error_forbidden_digits_only_username)
error++
}
if (password.isEmpty()) {

View File

@ -107,7 +107,7 @@ class FtueAuthCombinedRegisterFragment @Inject constructor() : AbstractSSOFtueAu
error++
}
if (state.isNumericOnlyUserIdForbidden() && login.isDigitsOnly()) {
views.createAccountInput.error = "The homeserver does not accept username with only digits."
views.createAccountInput.error = getString(R.string.error_forbidden_digits_only_username)
error++
}
if (password.isEmpty()) {

View File

@ -135,7 +135,7 @@ class FtueAuthLoginFragment @Inject constructor() : AbstractSSOFtueAuthFragment<
error++
}
if (isSignupMode && isNumericOnlyUserIdForbidden && login.isDigitsOnly()) {
views.loginFieldTil.error = "The homeserver does not accept username with only digits."
views.loginFieldTil.error = getString(R.string.error_forbidden_digits_only_username)
error++
}
if (password.isEmpty()) {

View File

@ -2470,6 +2470,7 @@
<string name="error_empty_field_choose_user_name">Please choose a username.</string>
<string name="error_empty_field_choose_password">Please choose a password.</string>
<string name="error_forbidden_digits_only_username">"The homeserver does not accept username with only digits."</string>
<string name="external_link_confirmation_title">Double-check this link</string>
<string name="external_link_confirmation_message">The link %1$s is taking you to another site: %2$s.\n\nAre you sure you want to continue?</string>