From 27bade55ee8e5635b9ee357ae3d2f3496743f09e Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Mon, 27 Oct 2025 22:06:45 +0000 Subject: [PATCH] Localize commonmark alert extension (#43379). Patch by Florian Walchshofer (user:amiswalc). git-svn-id: https://svn.redmine.org/redmine/trunk@24077 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- config/locales/en.yml | 5 +++++ .../wiki_formatting/common_mark/alerts_icons_filter.rb | 3 +++ 2 files changed, 8 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index 97b662999..005487b4f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1178,6 +1178,11 @@ en: label_webhook_edit: Edit webhook label_webhook_events: Events label_integrations: Integrations + label_alert_note: Note + label_alert_tip: Tip + label_alert_warning: Warning + label_alert_caution: Caution + label_alert_important: Important webhook_events_issue: Issues webhook_events_issue_created: Issue created diff --git a/lib/redmine/wiki_formatting/common_mark/alerts_icons_filter.rb b/lib/redmine/wiki_formatting/common_mark/alerts_icons_filter.rb index 27429d778..73a09b15f 100644 --- a/lib/redmine/wiki_formatting/common_mark/alerts_icons_filter.rb +++ b/lib/redmine/wiki_formatting/common_mark/alerts_icons_filter.rb @@ -48,6 +48,9 @@ module Redmine icon_name = ALERT_TYPE_TO_ICON_NAME[alert_type] next unless icon_name # Skip if no specific icon is defined for this alert type + # label alert translation + node.content = ::I18n.t("label_alert_#{alert_type}", default: node.content) + icon_html = ApplicationController.helpers.sprite_icon(icon_name, node.text) if icon_html