Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 18598a1

Browse files
committed
FIX: Locale issue
1 parent 33946df commit 18598a1

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

app/services/problem_check/ai_llm_status.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def call
88
llm_errors
99
end
1010

11+
def base_path
12+
Discourse.base_path
13+
end
14+
1115
private
1216

1317
def llm_errors
@@ -24,7 +28,7 @@ def try_validate(model, &blk)
2428
rescue => e
2529
error_message = parse_error_message(e.message)
2630
message =
27-
"#{I18n.t("dashboard.problem.ai_llm_status", { model_name: model.display_name, model_id: model.id })}"
31+
"#{I18n.t("dashboard.problem.ai_llm_status", { base_path: base_path, model_name: model.display_name, model_id: model.id })}"
2832

2933
Problem.new(
3034
message,

config/locales/server.en.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,4 +455,4 @@ en:
455455
prompt_message_length: The message %{idx} is over the 1000 character limit.
456456
dashboard:
457457
problem:
458-
ai_llm_status: "The LLM model: %{model_name} is encountering issues. Please check the <a href='/admin/plugins/discourse-ai/ai-llms/%{model_id}'>model's configuration page</a>."
458+
ai_llm_status: "The LLM model: %{model_name} is encountering issues. Please check the <a href='%{base_path}/admin/plugins/discourse-ai/ai-llms/%{model_id}'>model's configuration page</a>."

spec/services/problem_check/ai_llm_status_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
it "returns a problem with an LLM model" do
4343
stub_request(:post, post_url).to_return(status: 403, body: error_response, headers: {})
4444
message =
45-
"#{I18n.t("dashboard.problem.ai_llm_status", { model_name: llm_model.display_name, model_id: llm_model.id })}"
45+
"#{I18n.t("dashboard.problem.ai_llm_status", { base_path: Discourse.base_path, model_name: llm_model.display_name, model_id: llm_model.id })}"
4646

4747
expect(described_class.new.call).to contain_exactly(
4848
have_attributes(

0 commit comments

Comments
 (0)