-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(recipients_app): Change 12 months title to generic (#582)
* Change 12 months title to generic * Add 2 more error messages * Move error localization to helper file to be accessible from different places * Add more errors * Fix some text styles
- Loading branch information
Showing
7 changed files
with
243 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import "package:firebase_auth/firebase_auth.dart"; | ||
import "package:flutter_gen/gen_l10n/app_localizations.dart"; | ||
|
||
String localizeExceptionMessage(Exception? ex, AppLocalizations localizations) { | ||
if (ex is FirebaseAuthException) { | ||
return switch (ex.code) { | ||
"invalid-verification-code" => localizations.invalidVerificationCodeError, | ||
"invalid-phone-number" => localizations.invalidPhoneNumberError, | ||
"invalid-credential" => localizations.invalidCredentialError, | ||
"user-disabled" => localizations.userDisabledError, | ||
"admin-only-operation" => localizations.adminOnlyOperation, | ||
"argument-error" => localizations.argumentError, | ||
"app-not-authorized" => localizations.appNotAuthorized, | ||
"app-not-installed" => localizations.appNotInstalled, | ||
"captcha-check-failed" => localizations.captchaCheckFailed, | ||
"code-expired" => localizations.codeExpired, | ||
"cordova-not-ready" => localizations.cordovaNotReady, | ||
"cors-unsupported" => localizations.corsUnsupported, | ||
"credential-already-in-use" => localizations.credentialAlreadyInUse, | ||
"credential-mismatch" => localizations.credentialMismatch, | ||
"credential-too-old-login-again" => | ||
localizations.credentialTooOldLoginAgain, | ||
"dependent-sdk-init-before-auth" => | ||
localizations.dependentSdkInitBeforeAuth, | ||
"dynamic-link-not-activated" => localizations.dynamicLinkNotActivated, | ||
"email-change-needs-verification" => | ||
localizations.emailChangeNeedsVerification, | ||
"email-exists" => localizations.emailExists, | ||
"emulator-config-failed" => localizations.emulatorConfigFailed, | ||
"expired-oob-code" => localizations.expiredOobCode, | ||
"expired-popup-request" => localizations.expiredPopupRequest, | ||
"internal-error" => localizations.internalError, | ||
"invalid-api-key" => localizations.invalidApiKey, | ||
"invalid-app-credential" => localizations.invalidAppCredential, | ||
"invalid-app-id" => localizations.invalidAppId, | ||
"invalid-auth" => localizations.invalidAuth, | ||
"invalid-auth-event" => localizations.invalidAuthEvent, | ||
"invalid-cert-hash" => localizations.invalidCertHash, | ||
"invalid-code" => localizations.invalidCode, | ||
"invalid-continue-uri" => localizations.invalidContinueUri, | ||
"invalid-cordova-configuration" => | ||
localizations.invalidCordovaConfiguration, | ||
"invalid-custom-token" => localizations.invalidCustomToken, | ||
"invalid-dynamic-link-domain" => localizations.invalidDynamicLinkDomain, | ||
"invalid-email" => localizations.invalidEmail, | ||
"invalid-emulator-scheme" => localizations.invalidEmulatorScheme, | ||
"invalid-idp-response" => localizations.invalidIdpResponse, | ||
"invalid-message-payload" => localizations.invalidMessagePayload, | ||
"invalid-mfa-session" => localizations.invalidMfaSession, | ||
"invalid-oauth-client-id" => localizations.invalidOauthClientId, | ||
"invalid-oauth-provider" => localizations.invalidOauthProvider, | ||
"invalid-oob-code" => localizations.invalidOobCode, | ||
"invalid-origin" => localizations.invalidOrigin, | ||
"invalid-password" => localizations.invalidPassword, | ||
"invalid-persistence" => localizations.invalidPersistence, | ||
"invalid-provider-id" => localizations.invalidProviderId, | ||
"invalid-recipient-email" => localizations.invalidRecipientEmail, | ||
"invalid-sender" => localizations.invalidSender, | ||
"invalid-session-info" => localizations.invalidSessionInfo, | ||
"invalid-tenant-id" => localizations.invalidTenantId, | ||
"mfa-info-not-found" => localizations.mfaInfoNotFound, | ||
"mfa-required" => localizations.mfaRequired, | ||
"missing-android-package-name" => localizations.missingAndroidPackageName, | ||
"missing-app-credential" => localizations.missingAppCredential, | ||
"missing-auth-domain" => localizations.missingAuthDomain, | ||
"missing-code" => localizations.missingCode, | ||
"missing-continue-uri" => localizations.missingContinueUri, | ||
"missing-iframe-start" => localizations.missingIframeStart, | ||
"missing-ios-bundle-id" => localizations.missingIosBundleId, | ||
"missing-or-invalid-nonce" => localizations.missingOrInvalidNonce, | ||
"missing-mfa-info" => localizations.missingMfaInfo, | ||
"missing-mfa-session" => localizations.missingMfaSession, | ||
"missing-phone-number" => localizations.missingPhoneNumber, | ||
"missing-session-info" => localizations.missingSessionInfo, | ||
"module-destroyed" => localizations.moduleDestroyed, | ||
"need-confirmation" => localizations.needConfirmation, | ||
"network-request-failed" => localizations.networkRequestFailed, | ||
"null-user" => localizations.nullUser, | ||
"no-auth-event" => localizations.noAuthEvent, | ||
"no-such-provider" => localizations.noSuchProvider, | ||
"operation-not-allowed" => localizations.operationNotAllowed, | ||
"operation-not-supported" => localizations.operationNotSupported, | ||
"popup-blocked" => localizations.popupBlocked, | ||
"popup-closed-by-user" => localizations.popupClosedByUser, | ||
"provider-already-linked" => localizations.providerAlreadyLinked, | ||
"quota-exceeded" => localizations.quotaExceeded, | ||
"redirect-cancelled-by-user" => localizations.redirectCancelledByUser, | ||
"redirect-operation-pending" => localizations.redirectOperationPending, | ||
"rejected-credential" => localizations.rejectedCredential, | ||
"second-factor-already-enrolled" => | ||
localizations.secondFactorAlreadyEnrolled, | ||
"second-factor-limit-exceeded" => localizations.secondFactorLimitExceeded, | ||
"tenant-id-mismatch" => localizations.tenantIdMismatch, | ||
"timeout" => localizations.timeoutError, | ||
"token-expired" => localizations.tokenExpired, | ||
"too-many-attempts-try-later" => localizations.tooManyAttemptsTryLater, | ||
"unauthorized-domain" => localizations.unauthorizedDomain, | ||
"unsupported-first-factor" => localizations.unsupportedFirstFactor, | ||
"unsupported-persistence" => localizations.unsupportedPersistence, | ||
"unsupported-tenant-operation" => | ||
localizations.unsupportedTenantOperation, | ||
"unverified-email" => localizations.unverifiedEmail, | ||
"user-cancelled" => localizations.userCancelled, | ||
"user-deleted" => localizations.userDeleted, | ||
"user-mismatch" => localizations.userMismatch, | ||
"user-signed-out" => localizations.userSignedOut, | ||
"weak-password" => localizations.weakPassword, | ||
"web-storage-unsupported" => localizations.webStorageUnsupported, | ||
"already-initialized" => localizations.alreadyInitialized, | ||
"recaptcha-not-enabled" => localizations.recaptchaNotEnabled, | ||
"missing-recaptcha-token" => localizations.missingRecaptchaToken, | ||
"invalid-recaptcha-token" => localizations.invalidRecaptchaToken, | ||
"invalid-recaptcha-action" => localizations.invalidRecaptchaAction, | ||
"missing-client-type" => localizations.missingClientType, | ||
"missing-recaptcha-version" => localizations.missingRecaptchaVersion, | ||
"invalid-recaptcha-version" => localizations.invalidRecaptchaVersion, | ||
"invalid-req-type" => localizations.invalidReqType, | ||
_ => ex.toString(), | ||
}; | ||
} | ||
|
||
return ex.toString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters