mirror of
https://github.com/we-promise/sure.git
synced 2026-05-25 05:24: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>
54 lines
2.1 KiB
Plaintext
54 lines
2.1 KiB
Plaintext
<%= render DS::Dialog.new(reload_on_close: params[:reload_on_close].present?) do |dialog| %>
|
|
<%
|
|
title = if @rule.name.present?
|
|
t(".title_with_name", name: @rule.name)
|
|
else
|
|
t(".title")
|
|
end
|
|
%>
|
|
<% dialog.with_header(title: title) %>
|
|
|
|
<% dialog.with_body do %>
|
|
<p class="text-secondary text-sm mb-4">
|
|
<%= t(".apply_notice_html", count: @rule.affected_resource_count, resource: @rule.resource_type.pluralize) %>
|
|
</p>
|
|
|
|
<% if @rule.actions.any? { |a| a.action_type == "auto_categorize" } %>
|
|
<% affected_count = @rule.affected_resource_count %>
|
|
<div class="mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg">
|
|
<div class="flex items-start gap-2">
|
|
<%= icon "info", class: "w-4 h-4 text-blue-600 mt-0.5 flex-shrink-0" %>
|
|
<div class="text-xs">
|
|
<p class="font-medium text-blue-900 mb-1"><%= t(".ai_cost_title") %></p>
|
|
<% if @estimated_cost.present? %>
|
|
<p class="text-blue-700">
|
|
<%= t(".ai_cost_with_estimate_html", count: affected_count, cost: sprintf("%.4f", @estimated_cost)) %>
|
|
</p>
|
|
<% else %>
|
|
<p class="text-blue-700">
|
|
<%= t(".ai_cost_no_estimate_html", count: affected_count) %>
|
|
<% if @selected_model.present? %>
|
|
<span class="font-semibold"><%= t(".cost_unavailable_model", model: @selected_model) %></span>
|
|
<% else %>
|
|
<span class="font-semibold"><%= t(".cost_unavailable_no_provider") %></span>
|
|
<% end %>
|
|
<%= t(".cost_warning") %>
|
|
</p>
|
|
<% end %>
|
|
<p class="text-blue-600 mt-1">
|
|
<%= link_to t(".view_usage_history"), settings_llm_usage_path, class: "underline hover:text-blue-800" %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
<%= render DS::Button.new(
|
|
text: t(".confirm_changes"),
|
|
href: apply_rule_path(@rule),
|
|
method: :post,
|
|
full_width: true,
|
|
data: { turbo_frame: "_top" }) %>
|
|
<% end %>
|
|
<% end %>
|