mirror of
https://github.com/we-promise/sure.git
synced 2026-05-25 21:44:56 +00:00
* Extract hardcoded strings to i18n
Replace numerous hardcoded English strings with I18n lookups (t / I18n.t) across controllers, views, helpers, and components, and convert model validation error messages to symbol keys. Added multiple locale files under config/locales for models and views. This centralizes user-facing notices/alerts, UI text, import/validation messages, and prepares the app for localization and easier translation maintenance.
* Update en.yml
* Update preview-cleanup.yml
* Revert "Update preview-cleanup.yml"
This reverts commit 1ba6d3c34c.
* test: align i18n assertions with translated messages
* Standardize balance error key and tweak locales
Replace SophtronAccount's :requires_balance error key with :no_balance and update related locale strings for sophtron, plaid, and simplefin accounts to use the new key and clearer copy. Also switch the QIF upload redirect notice to use a relative translation key (t('.qif_uploaded')), remove an unused SSO providers help line, and fix a trailing-newline/whitespace issue in the subscriptions locale. These changes standardize validation keys and improve translation consistency and messaging.
---------
Co-authored-by: KiloClaw <kiloclaw@openclaw.ai>
64 lines
2.9 KiB
Plaintext
64 lines
2.9 KiB
Plaintext
<%# locals: (budget:) %>
|
|
|
|
<div>
|
|
<div class="p-4 border-b border-secondary">
|
|
<h3 class="text-sm text-secondary mb-2"><%= t(".expected_income") %></h3>
|
|
|
|
<span class="inline-block mb-2 text-xl font-medium text-primary privacy-sensitive">
|
|
<%= format_money(budget.expected_income_money) %>
|
|
</span>
|
|
|
|
<div>
|
|
<div class="flex h-1.5 mb-3 gap-1">
|
|
<% if budget.remaining_expected_income.negative? %>
|
|
<div class="rounded-md h-1.5 bg-green-500" style="width: <%= 100 - budget.surplus_percent %>%"></div>
|
|
<div class="rounded-md h-1.5 bg-green-500" style="width: <%= budget.surplus_percent %>%"></div>
|
|
<% else %>
|
|
<div class="rounded-md h-1.5 bg-green-500" style="width: <%= budget.actual_income_percent %>%"></div>
|
|
<div class="rounded-md h-1.5 bg-surface-inset" style="width: <%= 100 - budget.actual_income_percent %>%"></div>
|
|
<% end %>
|
|
</div>
|
|
<div class="flex justify-between text-sm privacy-sensitive">
|
|
<p class="text-secondary"><%= t(".earned", amount: format_money(budget.actual_income_money)) %></p>
|
|
<p class="font-medium">
|
|
<% if budget.remaining_expected_income.negative? %>
|
|
<span class="text-green-500"><%= t(".over", amount: format_money(budget.remaining_expected_income_money.abs)) %></span>
|
|
<% else %>
|
|
<span class="text-primary"><%= t(".left", amount: format_money(budget.remaining_expected_income_money)) %></span>
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="p-4">
|
|
<h3 class="text-sm text-secondary mb-2"><%= t(".budgeted") %></h3>
|
|
|
|
<span class="inline-block mb-2 text-xl font-medium text-primary privacy-sensitive">
|
|
<%= format_money(budget.budgeted_spending_money) %>
|
|
</span>
|
|
|
|
<div>
|
|
<div class="flex h-1.5 mb-3 gap-1">
|
|
<% if budget.available_to_spend.negative? %>
|
|
<div class="rounded-md h-1.5 bg-inverse" style="width: <%= 100 - budget.overage_percent %>%"></div>
|
|
<div class="rounded-md h-1.5 bg-destructive" style="width: <%= budget.overage_percent %>%"></div>
|
|
<% else %>
|
|
<div class="rounded-md h-1.5 bg-inverse" style="width: <%= budget.percent_of_budget_spent %>%"></div>
|
|
<div class="rounded-md h-1.5 bg-surface-inset" style="width: <%= 100 - budget.percent_of_budget_spent %>%"></div>
|
|
<% end %>
|
|
</div>
|
|
<div class="flex justify-between text-sm privacy-sensitive">
|
|
<p class="text-secondary"><%= t(".spent", amount: format_money(budget.actual_spending_money)) %></p>
|
|
<p class="font-medium">
|
|
<% if budget.available_to_spend.negative? %>
|
|
<span class="text-destructive"><%= t(".over", amount: format_money(budget.available_to_spend_money.abs)) %></span>
|
|
<% else %>
|
|
<span class="text-primary"><%= t(".left", amount: format_money(budget.available_to_spend_money)) %></span>
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|