mirror of
https://github.com/we-promise/sure.git
synced 2026-05-28 15:04:57 +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>
73 lines
2.9 KiB
Plaintext
73 lines
2.9 KiB
Plaintext
<%# locals: (import:, mapping_class:, step_idx:) %>
|
|
|
|
<% mappings = mapping_class.for_import(import) %>
|
|
<% is_last_step = step_idx == import.mapping_steps.count - 1 %>
|
|
|
|
<div class="w-full max-w-full">
|
|
<% if mapping_class == Import::AccountMapping && import.account.nil? %>
|
|
<% if import.requires_account? %>
|
|
<div class="w-full max-w-full overflow-hidden mb-4">
|
|
<div class="overflow-x-auto">
|
|
<div class="flex items-center justify-between p-4 gap-4 text-secondary bg-red-100 border border-red-200 rounded-lg w-[650px] min-w-0 mx-auto">
|
|
<%= tag.p t(".no_accounts"), class: "text-sm" %>
|
|
|
|
<%= render DS::Link.new(
|
|
text: t(".create_account"),
|
|
variant: "primary",
|
|
href: new_account_path(return_to: import_confirm_path(import)),
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% elsif import.has_unassigned_account? %>
|
|
<div class="w-full max-w-full overflow-hidden mb-4">
|
|
<div class="overflow-x-auto">
|
|
<div class="flex items-center justify-between p-4 gap-4 text-secondary bg-yellow-100 border border-yellow-200 rounded-lg w-[650px] min-w-0 mx-auto">
|
|
<%= tag.p t(".unassigned_account"), class: "text-sm" %>
|
|
<%= render DS::Link.new(
|
|
text: t(".create_account"),
|
|
variant: "primary",
|
|
href: new_account_path(return_to: import_confirm_path(import)),
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<div class="space-y-4 w-full max-w-full">
|
|
<div class="w-full max-w-full overflow-hidden">
|
|
<div class="overflow-x-auto">
|
|
<div class="bg-container-inset rounded-xl p-1 space-y-1 w-[650px] min-w-0 mx-auto">
|
|
<div class="grid grid-cols-3 gap-2 text-xs font-medium text-secondary uppercase px-5 py-3">
|
|
<p><%= t(".csv_mapping_label", mapping: mapping_label(mapping_class)) %></p>
|
|
<p><%= t(".sure_mapping_label", mapping: mapping_label(mapping_class), product_name: product_name) %></p>
|
|
<p class="justify-self-end"><%= t(".rows_label") %></p>
|
|
</div>
|
|
|
|
<div class="shadow-border-xs rounded-md divide-y divide-alpha-black-100 text-sm">
|
|
<% mappings.sort_by(&:key).each do |mapping| %>
|
|
<div class="px-5 py-3 bg-container first:rounded-tl-xl first:rounded-tr-xl last:rounded-bl-xl last:rounded-br-xl">
|
|
<%= render partial: "import/mappings/form", locals: { mapping: mapping } %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-center w-full">
|
|
<%= render DS::Link.new(
|
|
text: t(".next"),
|
|
variant: "primary",
|
|
href: is_last_step ? import_path(import) : url_for(step: step_idx + 2),
|
|
icon: "arrow-right",
|
|
icon_position: "right",
|
|
class: "w-full md:w-auto"
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|