mirror of
https://github.com/discourse/discourse.git
synced 2025-03-20 06:36:40 +08:00
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 { h } from "virtual-dom";
|
||||||
import { isDevelopment } from "discourse-common/config/environment";
|
import { isDevelopment } from "discourse-common/config/environment";
|
||||||
import escape from "discourse-common/lib/escape";
|
import escape from "discourse-common/lib/escape";
|
||||||
|
import deprecated from "discourse-common/lib/deprecated";
|
||||||
|
|
||||||
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
||||||
let _renderers = [];
|
let _renderers = [];
|
||||||
@ -159,9 +160,18 @@ registerIconRenderer({
|
|||||||
I18n.t(params.title)
|
I18n.t(params.title)
|
||||||
)}'>${html}</span>`;
|
)}'>${html}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.translatedtitle) {
|
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(
|
html = `<span class="svg-icon-title" title='${escape(
|
||||||
params.translatedtitle
|
params.translatedTitle
|
||||||
)}'>${html}</span>`;
|
)}'>${html}</span>`;
|
||||||
}
|
}
|
||||||
return html;
|
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) {
|
test("escape icon names, classes and titles", function (assert) {
|
||||||
const html = iconHTML("'<img src='x'>", {
|
const html = iconHTML("'<img src='x'>", {
|
||||||
translatedtitle: "'<script src='y'>",
|
translatedTitle: "'<script src='y'>",
|
||||||
label: "<iframe src='z'>",
|
label: "<iframe src='z'>",
|
||||||
class: "'<link href='w'>",
|
class: "'<link href='w'>",
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="icons">
|
<div class="icons">
|
||||||
<span class="selection-indicator"></span>
|
<span class="selection-indicator"></span>
|
||||||
{{#each icons as |icon|}}
|
{{#each icons as |icon|}}
|
||||||
{{d-icon icon translatedtitle=(dasherize title)}}
|
{{d-icon icon translatedTitle=(dasherize title)}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{{#each icons as |icon|}}
|
{{#each icons as |icon|}}
|
||||||
{{d-icon icon translatedtitle=dasherizedTitle}}
|
{{d-icon icon translatedTitle=dasherizedTitle}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
<span class="name">
|
<span class="name">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user