diff --git a/framework/core/js/forum/src/components/DiscussionRenamedPost.js b/framework/core/js/forum/src/components/DiscussionRenamedPost.js index 0827e43fe..5acc343a8 100644 --- a/framework/core/js/forum/src/components/DiscussionRenamedPost.js +++ b/framework/core/js/forum/src/components/DiscussionRenamedPost.js @@ -13,15 +13,18 @@ export default class DiscussionRenamedPost extends EventPost { return 'pencil'; } - description() { + descriptionKey() { + return 'core.discussion_renamed_post'; + } + + descriptionData() { const post = this.props.post; const oldTitle = post.content()[0]; const newTitle = post.content()[1]; - return app.trans('core.discussion_renamed', { - user: this.props.post.user(), + return { old: {oldTitle}, new: {newTitle} - }); + }; } } diff --git a/framework/core/js/forum/src/components/EventPost.js b/framework/core/js/forum/src/components/EventPost.js index 8aefd32ee..ca4023375 100644 --- a/framework/core/js/forum/src/components/EventPost.js +++ b/framework/core/js/forum/src/components/EventPost.js @@ -1,4 +1,5 @@ import Post from 'flarum/components/Post'; +import { ucfirst } from 'flarum/utils/string'; import usernameHelper from 'flarum/helpers/username'; import icon from 'flarum/helpers/icon'; @@ -16,19 +17,24 @@ import icon from 'flarum/helpers/icon'; export default class EventPost extends Post { attrs() { return { - className: 'EventPost EventPost--' + this.props.post.contentType() + className: 'EventPost ' + ucfirst(this.props.post.contentType()) + 'Post' }; } content() { const user = this.props.post.user(); const username = usernameHelper(user); + const data = Object.assign(this.descriptionData(), { + user, + username: user + ? {username} + : username + }); return [ icon(this.icon(), {className: 'EventPost-icon'}),