Use i18n for AI cache reset strings

Extract hardcoded strings to locale file for proper internationalization.
This commit is contained in:
eureka928
2026-01-26 09:49:05 +01:00
parent 329fe9832a
commit b82757f58e
3 changed files with 11 additions and 5 deletions

View File

@@ -130,7 +130,7 @@ class RulesController < ApplicationController
def clear_ai_cache
ClearAiCacheJob.perform_later(Current.family)
redirect_to rules_path, notice: "AI cache is being cleared. This may take a few moments."
redirect_to rules_path, notice: t("rules.clear_ai_cache.success")
end
private

View File

@@ -5,14 +5,14 @@
<%= render DS::Menu.new do |menu| %>
<% menu.with_item(
variant: "button",
text: "Reset AI cache",
text: t("rules.clear_ai_cache.button"),
href: clear_ai_cache_rules_path,
icon: "refresh-cw",
method: :post,
confirm: CustomConfirm.new(
title: "Reset AI cache?",
body: "Are you sure you want to reset the AI cache? This will allow AI rules to re-process all transactions. This may incur additional API costs.",
btn_text: "Reset Cache"
title: t("rules.clear_ai_cache.confirm_title"),
body: t("rules.clear_ai_cache.confirm_body"),
btn_text: t("rules.clear_ai_cache.confirm_button")
)) %>
<% menu.with_item(
variant: "button",

View File

@@ -37,3 +37,9 @@ en:
pending: Pending
success: Success
failed: Failed
clear_ai_cache:
button: Reset AI cache
confirm_title: Reset AI cache?
confirm_body: Are you sure you want to reset the AI cache? This will allow AI rules to re-process all transactions. This may incur additional API costs.
confirm_button: Reset Cache
success: AI cache is being cleared. This may take a few moments.