Localize investment activity labels and improve transaction processing

- Replaced hardcoded activity labels with `I18n` translations for better localization.
- Updated `transactions` views to display localized labels dynamically.
- Fixed `InvestmentActivityDetector` to enhance dividend detection.
- Refined `Account::ProviderImportAdapter` to prevent unnecessary updates and ensure transactional consistency.
- Improved error handling and feedback in rake tasks for invalid arguments.
This commit is contained in:
Josh Waldrep
2026-01-12 09:19:09 -05:00
parent e5fbdfb593
commit 307a8bb760
6 changed files with 30 additions and 8 deletions

View File

@@ -87,7 +87,7 @@
<%# Investment activity label badge %>
<% if transaction.investment_activity_label.present? %>
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-alpha-black-50 text-secondary" title="<%= t("transactions.transaction.activity_type_tooltip") %>">
<%= transaction.investment_activity_label %>
<%= t("transactions.activity_labels.#{transaction.investment_activity_label.parameterize(separator: '_')}") %>
</span>
<% end %>

View File

@@ -240,7 +240,7 @@
<%= ef.select :investment_activity_label,
options_for_select(
[["—", nil]] + Transaction::ACTIVITY_LABELS.map { |l| [l, l] },
[["—", nil]] + Transaction::ACTIVITY_LABELS.map { |l| [t("transactions.activity_labels.#{l.parameterize(separator: '_')}"), l] },
@entry.entryable.investment_activity_label
),
{ label: false },
@@ -260,8 +260,8 @@
<%= f.fields_for :entryable do |ef| %>
<div class="flex cursor-pointer items-center gap-4 justify-between">
<div class="text-sm space-y-1">
<h4 class="text-primary">One-time <%= @entry.amount.negative? ? "Income" : "Expense" %></h4>
<p class="text-secondary">One-time transactions will be excluded from certain budgeting calculations and reports to help you see what's really important.</p>
<h4 class="text-primary"><%= t(".one_time_title", type: @entry.amount.negative? ? t("transactions.form.income") : t("transactions.form.expense")) %></h4>
<p class="text-secondary"><%= t(".one_time_description") %></p>
</div>
<%= ef.toggle :kind, {