fix(auth): replace hardcoded loading state strings with translatable string resources#2339
Conversation
796a36f to
f517f53
Compare
f517f53 to
b6694cb
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces hardcoded English loading messages with localized string resources across various authentication providers and operations (such as signing in, signing out, and deleting accounts). It also introduces new loading state properties to AuthUIStringProvider and its default implementation, along with corresponding unit tests. The review feedback suggests utilizing the custom stringProvider from the available config object instead of directly calling context.getString(...) or app.applicationContext.getString(...) in several provider helper files, ensuring that any user-supplied custom string provider is properly respected.
mikehardy
left a comment
There was a problem hiding this comment.
implementation looks really sound
my comments are informational as I don't know how strongly google style guide applies here and how deep the testing contract is - certainly the tests prove the general paths as is
| <string name="fui_mfa_label_totp_authentication" translation_description="Label for the authenticator app MFA factor.">Authenticator app</string> | ||
| <string name="fui_mfa_label_unknown_method" translation_description="Label for an unknown MFA factor.">Unknown method</string> | ||
| <string name="fui_mfa_enrolled_on" translation_description="Label indicating the enrollment date of an MFA factor.">Enrolled on %1$s</string> | ||
| <string name="fui_enter_totp_code" translation_description="Prompt asking the user to enter a TOTP verification code">Enter TOTP code</string> |
There was a problem hiding this comment.
similarly, the style guide has opinions on abbreviations. This one is likely a grey area. Is TOTP familiar to the audience? To us yes, but to mass consumers...possibly not? This abbreviation my be better as something like "Enter one time code" or something?
https://developers.google.com/style/abbreviations#spelling-out
There was a problem hiding this comment.
hmmm that's a valid point
Closes #2338 .
All
AuthState.Loadingmessages emitted during auth operations (sign-in, sign-out, delete, phone, email, etc.) were hardcoded English strings. This replaces every instance with a string resource lookup viaContext.getString(R.string.fui_loading_*), making them overridable and translatable.Usage
You can either override using
strings.xmlor through a custom AuthUIStringProvider, see below examples:Using strings.xml:
Using AuthUIStringProvider:
Preview
override-loading-state-preview.webm