DEV: Rename `translatedtitle` to `translatedTitle` (#17160)
This commit is contained in:
parent
36c2284dea
commit
011a16cb8a
|
@ -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}</span>`;
|
||||
}
|
||||
|
||||
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 = `<span class="svg-icon-title" title='${escape(
|
||||
params.translatedtitle
|
||||
params.translatedTitle
|
||||
)}'>${html}</span>`;
|
||||
}
|
||||
return html;
|
||||
|
|
|
@ -1 +1 @@
|
|||
{{d-icon icon translatedtitle=title class=cssClasses}}
|
||||
{{d-icon icon translatedTitle=title class=cssClasses}}
|
||||
|
|
|
@ -27,7 +27,7 @@ module("Unit | Utility | icon-library", function () {
|
|||
|
||||
test("escape icon names, classes and titles", function (assert) {
|
||||
const html = iconHTML("'<img src='x'>", {
|
||||
translatedtitle: "'<script src='y'>",
|
||||
translatedTitle: "'<script src='y'>",
|
||||
label: "<iframe src='z'>",
|
||||
class: "'<link href='w'>",
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="icons">
|
||||
<span class="selection-indicator"></span>
|
||||
{{#each icons as |icon|}}
|
||||
{{d-icon icon translatedtitle=(dasherize title)}}
|
||||
{{d-icon icon translatedTitle=(dasherize title)}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#each icons as |icon|}}
|
||||
{{d-icon icon translatedtitle=dasherizedTitle}}
|
||||
{{d-icon icon translatedTitle=dasherizedTitle}}
|
||||
{{/each}}
|
||||
|
||||
<span class="name">
|
||||
|
|
Loading…
Reference in New Issue