Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Missing translation fallback for account subtypes (#1325)

Juan José Mata43d617661fdd
diff --git a/app/controllers/lunchflow_items_controller.rb b/app/controllers/lunchflow_items_controller.rb
index fce4c57506..0fe018a554 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 d02948c74c..14e34ca0f3 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 8d7ed84144..02320aa8da 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)