From 43d617661fdda7dbf3b9a7f7f98c372bb80e482e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Mata?= Date: Tue, 31 Mar 2026 17:22:49 +0200 Subject: [PATCH] Missing translation fallback for account subtypes (#1325) * Fix missing translation fallback for account subtypes in LunchFlow and Mercury The translate_subtypes lambda called t() without a default: fallback, causing "Translation missing" for the ~39 investment subtypes not in the locale files. Now falls back to the :long label from the model's SUBTYPES hash (e.g. "457(b)", "SEP IRA", "UGMA Custodial Account"), matching the pattern used by Accountable#subtype_label_for. https://claude.ai/code/session_01HBJzNkvpky8mKrLkzv83Mm * Default to single-column dashboard --------- Co-authored-by: Claude --- app/controllers/lunchflow_items_controller.rb | 2 +- app/controllers/mercury_items_controller.rb | 2 +- app/models/user.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/lunchflow_items_controller.rb b/app/controllers/lunchflow_items_controller.rb index fce4c5750..0fe018a55 100644 --- a/app/controllers/lunchflow_items_controller.rb +++ b/app/controllers/lunchflow_items_controller.rb @@ -535,7 +535,7 @@ class LunchflowItemsController < ApplicationController # Helper to translate subtype options translate_subtypes = ->(type_key, subtypes_hash) { - subtypes_hash.keys.map { |k| [ t(".subtypes.#{type_key}.#{k}"), k ] } + subtypes_hash.map { |k, v| [ t(".subtypes.#{type_key}.#{k}", default: v[:long] || k.humanize), k ] } } # Subtype options for each account type (only include supported types) diff --git a/app/controllers/mercury_items_controller.rb b/app/controllers/mercury_items_controller.rb index d02948c74..14e34ca0f 100644 --- a/app/controllers/mercury_items_controller.rb +++ b/app/controllers/mercury_items_controller.rb @@ -539,7 +539,7 @@ class MercuryItemsController < ApplicationController # Helper to translate subtype options translate_subtypes = ->(type_key, subtypes_hash) { - subtypes_hash.keys.map { |k| [ t(".subtypes.#{type_key}.#{k}"), k ] } + subtypes_hash.map { |k, v| [ t(".subtypes.#{type_key}.#{k}", default: v[:long] || k.humanize), k ] } } # Subtype options for each account type (only include supported types) diff --git a/app/models/user.rb b/app/models/user.rb index 8d7ed8414..02320aa8d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -333,7 +333,7 @@ class User < ApplicationRecord end def dashboard_two_column? - preferences&.dig("dashboard_two_column") != false + preferences&.dig("dashboard_two_column") == true end def update_transactions_preferences(prefs)