diff --git a/app/assets/javascripts/discourse-common/addon/lib/icon-library.js b/app/assets/javascripts/discourse-common/addon/lib/icon-library.js index 7a8588f91be..a77aa591f28 100644 --- a/app/assets/javascripts/discourse-common/addon/lib/icon-library.js +++ b/app/assets/javascripts/discourse-common/addon/lib/icon-library.js @@ -3,6 +3,7 @@ import attributeHook from "discourse-common/lib/attribute-hook"; import { h } from "virtual-dom"; import { isDevelopment } from "discourse-common/config/environment"; import escape from "discourse-common/lib/escape"; +import deprecated from "discourse-common/lib/deprecated"; const SVG_NAMESPACE = "http://www.w3.org/2000/svg"; let _renderers = []; @@ -159,9 +160,18 @@ registerIconRenderer({ I18n.t(params.title) )}'>${html}`; } + if (params.translatedtitle) { + deprecated(`use 'translatedTitle' option instead of 'translatedtitle'`, { + since: "2.9.0.beta6", + dropFrom: "2.10.0.beta1", + }); + params.translatedTitle = params.translatedtitle; + } + + if (params.translatedTitle) { html = `${html}`; } return html; diff --git a/app/assets/javascripts/discourse/app/templates/components/bookmark-icon.hbs b/app/assets/javascripts/discourse/app/templates/components/bookmark-icon.hbs index 2a1a2af91c1..6d82c0977d2 100644 --- a/app/assets/javascripts/discourse/app/templates/components/bookmark-icon.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/bookmark-icon.hbs @@ -1 +1 @@ -{{d-icon icon translatedtitle=title class=cssClasses}} +{{d-icon icon translatedTitle=title class=cssClasses}} diff --git a/app/assets/javascripts/discourse/tests/unit/lib/icon-library-test.js b/app/assets/javascripts/discourse/tests/unit/lib/icon-library-test.js index b2b0a99a999..be710f4207c 100644 --- a/app/assets/javascripts/discourse/tests/unit/lib/icon-library-test.js +++ b/app/assets/javascripts/discourse/tests/unit/lib/icon-library-test.js @@ -27,7 +27,7 @@ module("Unit | Utility | icon-library", function () { test("escape icon names, classes and titles", function (assert) { const html = iconHTML("'", { - translatedtitle: "'