diff --git a/app/controllers/rules_controller.rb b/app/controllers/rules_controller.rb index b516e44f1..07c355a56 100644 --- a/app/controllers/rules_controller.rb +++ b/app/controllers/rules_controller.rb @@ -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 diff --git a/app/views/rules/index.html.erb b/app/views/rules/index.html.erb index 0b10c4557..2b5867bd5 100644 --- a/app/views/rules/index.html.erb +++ b/app/views/rules/index.html.erb @@ -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", diff --git a/config/locales/views/rules/en.yml b/config/locales/views/rules/en.yml index 5cbd252d5..e91fd4246 100644 --- a/config/locales/views/rules/en.yml +++ b/config/locales/views/rules/en.yml @@ -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.