Interpolate "Login.gov" everywhere (LG-4886)#5498
Conversation
| import useFocusFallbackRef from '../hooks/use-focus-fallback-ref'; | ||
| import './selfie-capture.scss'; | ||
|
|
||
| const APP_NAME = 'Login.gov'; |
There was a problem hiding this comment.
Open question: which file should this live in? Maybe we wait for #5496 to land and then just move it inside there
There was a problem hiding this comment.
Open question: which file should this live in? Maybe we wait for #5496 to land and then just move it inside there
For me, I think the ideal implementation would be one where we bootstrap this with data attributes and make it available through a context provider, very similar to what we do already with service provider.
| @@ -1,5 +1,5 @@ | |||
| <p class="lead"> | |||
| <%= t('user_mailer.account_reset_complete.intro', app: link_to(APP_NAME, IdentityConfig.store.mailer_domain_name, class: 'gray')) %> | |||
| <%= t('user_mailer.account_reset_complete.intro_html', app_name: link_to(APP_NAME, IdentityConfig.store.mailer_domain_name, class: 'gray')) %> | |||
There was a problem hiding this comment.
Was this previously escaping the link? 🤔 (noting difference of the _html suffix)
There was a problem hiding this comment.
Quick search reveals a couple other suspect ones, maybe out of scope to deal with here:
There was a problem hiding this comment.
this one got on my radar because the specs for it broke... will leave the others for the time being
There was a problem hiding this comment.
So for sps_over_quota_limit ... something is very wrong and I'm gonna declare it out of scope of this... none of the translation strings have interpolation values... it's a very blank email:
identity-idp/config/locales/user_mailer/en.yml
Lines 195 to 198 in 0544a36
aduth
left a comment
There was a problem hiding this comment.
Admittedly a bit tough to review in great detail, but overall looks good from what I could tell!
Of my comments, only blocker is adding app_name to the other 'idv.messages.sessions.review_message' string.
| local_assigns[:contact_support_option] && { | ||
| url: MarketingSite.contact_url, | ||
| text: t('idv.troubleshooting.options.contact_support', app: APP_NAME), | ||
| text: t('idv.troubleshooting.options.contact_support', app_name: APP_NAME), |
There was a problem hiding this comment.
Seems like it was busted before, but this spec should be passing in the argument too:
identity-idp/spec/views/idv/phone_errors/_warning.html.erb_spec.rb
Lines 30 to 33 in cbe59e4
| MarketingSite.help_url, | ||
| ), | ||
| app: link_to( | ||
| app_name: link_to( |
There was a problem hiding this comment.
Optional: Looks like the string doesn't use app_name ?
(Kinda wonder how hard it'd be to make a test that verifies that all strings use all the variables we pass to it)
There was a problem hiding this comment.
we could monkeypatch i18n.t and compare the given interp arguments with a string scan in tests?
There was a problem hiding this comment.
ok so that spec was too sensitive, but probably worth returning to later
- the checks for missing i18n caught a bunch but there were some false positives for
FormPasswordValidator#strong_passwordI couldn't sort out - the checks for extra i18n args were tricky because the i18n interface has a bunch of extra keys (scope, default, count) that get mixed in with the args for translating
There was a problem hiding this comment.
Thanks for trying it, I liked the idea!
Co-authored-by: Andrew Duthie <andrew.duthie@gsa.gov>
This reverts commit c601b7c.
3792c52 to
a825382
Compare
- ex missing arg "feedback" in form password specs :/
Before: Sometimes we hardcode "Login.gov" and sometimes we use our
APP_NAMEconstantNow: Use APP_NAME/%{app_name} everywhere
I have a few notes, will make them inline