mirror of
https://github.com/flarum/core.git
synced 2025-08-07 00:47:00 +02:00
Automatically support basic HTML tags in translations
This allows front-end translations to use basic (attributeless) HTML tags freely, without the need for the translator call to supply a matching vdom element. Translations can thus make use of styling (<em>, <code>, etc.) as they see fit. The translator call can still optionally supply a vdom element to substitute in more complex tags where necessary (e.g. hyperlinks). /cc @dcsjapan
This commit is contained in:
4
js/admin/dist/app.js
vendored
4
js/admin/dist/app.js
vendored
@@ -18368,7 +18368,7 @@ System.register('flarum/components/EditGroupModal', ['flarum/components/Modal',
|
||||
m(
|
||||
'div',
|
||||
{ className: 'helpText' },
|
||||
app.translator.trans('core.admin.edit_group.icon_text', { a: m('a', { href: 'http://fortawesome.github.io/Font-Awesome/icons/', tabindex: '-1' }) }, { em: m('em', null) }, { code: m('code', null) })
|
||||
app.translator.trans('core.admin.edit_group.icon_text', { a: m('a', { href: 'http://fortawesome.github.io/Font-Awesome/icons/', tabindex: '-1' }) })
|
||||
),
|
||||
m('input', { className: 'FormControl', placeholder: 'bolt', value: this.icon(), oninput: m.withAttr('value', this.icon) })
|
||||
),
|
||||
@@ -22146,7 +22146,7 @@ System.register('flarum/Translator', ['flarum/models/User', 'flarum/helpers/user
|
||||
if (match[2]) {
|
||||
open.shift();
|
||||
} else {
|
||||
var tag = input[match[3]] || [];
|
||||
var tag = input[match[3]] || { tag: match[3], children: [] };
|
||||
open[0].push(tag);
|
||||
open.unshift(tag.children || tag);
|
||||
}
|
||||
|
Reference in New Issue
Block a user