From b9f0235237024acc7159632bfa1b9bf8af233bda 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 2208090e7..7b024668e 100644 --- a/app/controllers/lunchflow_items_controller.rb +++ b/app/controllers/lunchflow_items_controller.rb @@ -534,7 +534,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 0c72e3cd6..cbcac67cd 100644 --- a/app/controllers/mercury_items_controller.rb +++ b/app/controllers/mercury_items_controller.rb @@ -538,7 +538,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 752338bc2..80ecc7a55 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -321,7 +321,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)