fix(i18n): move Questrade dialog strings into en.yml instead of inline defaults#2790
fix(i18n): move Questrade dialog strings into en.yml instead of inline defaults#2790tryeverything24 wants to merge 1 commit into
Conversation
The Questrade views shipped with ~40 `t(".key", default: "English
string")` calls. Hardcoded `default:` fallbacks silently mask a
missing or renamed key instead of surfacing it, defeating the
missing-translation safety net, and they hide English copy from
translators — this exact pattern was flagged by DS Drift Patrol
(we-promise#2635, previously we-promise#2157).
17 of those keys were never added to
config/locales/views/questrade_items/en.yml (the setup_accounts and
select_existing_account dialogs plus the provider panel's eyebrow,
steps, help link, and disconnect strings), so those views only worked
because of the inline fallbacks.
- Add the missing keys to en.yml with the exact strings the views
render today, so no user-visible copy changes.
- Drop every `default:` argument from the four Questrade views
(43 call sites). Keys that already existed keep resolving to their
current locale values, so rendered output is unchanged there too.
Other locales fall back to the English strings exactly as before via
`config.i18n.fallbacks`, and the new keys are now visible to
i18n-tasks and translators.
Addresses the finding in we-promise#2635.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughQuestrade views now rely on dedicated I18n keys without inline fallback text. English translations were expanded for provider setup, account linking, account setup, sync guidance, statuses, buttons, and account types. The existing-account flow also renders Link submit buttons. ChangesQuestrade localization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reviewed against the i18n conventions in Looks correct overall:
Minor nit — key naming inconsistency: the new Other locales: Generated by Claude Code |
PR body — we-promise/sure — account: tryeverything24
Branch:
fix/questrade-locale-defaults(in WSL clone/root/sure, commit0e489bf9, based onmain@40b18e84)Title:
fix(i18n): stop hardcoding Questrade view strings via t() defaultsSummary
Addresses the Rule 5 finding from DS Drift Patrol #2635 (i18n bypass via hardcoded
default:strings; same pattern previously flagged in #2157).The Questrade views shipped with 43
t(".key", default: "English string")calls across four templates:app/views/questrade_items/_questrade_item.html.erb(14)app/views/questrade_items/setup_accounts.html.erb(11)app/views/questrade_items/select_existing_account.html.erb(8)app/views/settings/providers/_questrade_panel.html.erb(10)Hardcoded
default:fallbacks silently mask a missing or renamed key instead of surfacing it, and they hide English copy from translators / i18n-tasks. Worse, 17 of these keys were never added toen.ymlat all (thesetup_accountsandselect_existing_accountdialog copy, plus the provider panel's eyebrow, setup steps, help link, and disconnect strings) — those views only rendered correctly because of the inline fallbacks.What changed
config/locales/views/questrade_items/en.yml, using the exact strings the views render today, following the file's existing structure and quoting style.default:argument from the four Questrade templates. Keys that already existed keep resolving to their current locale values.No user-visible copy changes in any locale: English strings are byte-identical, and other locales fall back to English exactly as before via
config.i18n.fallbacks(config/application.rb:28). The new keys are now visible to i18n-tasks and translators (fr/pl/trquestrade files can pick them up).Test plan
bin/rails test test/controllers/questrade_items_controller_test.rb— 17 runs, 0 failures (these tests render the touched setup/link dialogs).t()key referenced by the four templates resolves against the loadedentree (55 keys checked, 0 missing).bundle exec erb_linton the four templates — no offenses.bin/rails test— full unit/integration suite green.Checklist for opening: base =
main, allow edits from maintainers ON.Summary by CodeRabbit