From c9ff8d8cb6e7efabe83f07d5f6b0d9b646c37640 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Wed, 7 Nov 2018 23:26:36 +0100 Subject: [PATCH] FIX: Relative links in translations should work with subfolder --- config/locales/server.en.yml | 2 +- plugin.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 088e48d..dfe25dd 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -92,7 +92,7 @@ en: group_mention_template: "mentions of: @%{name}" group_message_template: "messages to: @%{name}" - admin_error: "Some chat integration channels have errors. Visit the chat integration section to find out more." + admin_error: "Some chat integration channels have errors. Visit the chat integration section to find out more." provider: diff --git a/plugin.rb b/plugin.rb index 53ba4a3..2cdb7f7 100644 --- a/plugin.rb +++ b/plugin.rb @@ -29,7 +29,11 @@ after_initialize do DiscourseChat::Channel.find_each do |channel| error = true unless channel.error_key.blank? end - I18n.t("chat_integration.admin_error") if error + + if error + base_path = Discourse.respond_to?(:base_path) ? Discourse.base_path : Discourse.base_uri + I18n.t("chat_integration.admin_error", base_path: base_path) + end end DiscourseChat::Provider.mount_engines