1
0
mirror of https://github.com/flarum/core.git synced 2025-07-18 07:11:17 +02:00

Make front-end localizable

This commit is contained in:
Toby Zerner
2015-07-17 17:43:28 +09:30
parent 7e75eb16ff
commit f93ff7cb3f
49 changed files with 438 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
import Component from 'flarum/Component';
import icon from 'flarum/helpers/icon';
import humanTime from 'flarum/utils/humanTime';
import extractText from 'flarum/utils/extractText';
/**
* The `PostEdited` component displays information about when and by whom a post
@@ -14,7 +15,7 @@ export default class PostEdited extends Component {
view() {
const post = this.props.post;
const editUser = post.editUser();
const title = 'Edited ' + (editUser ? 'by ' + editUser.username() + ' ' : '') + humanTime(post.editTime());
const title = extractText(app.trans('core.post_edited', {user: editUser, ago: humanTime(post.editTime())}));
return (
<span className="PostEdited" title={title}>{icon('pencil')}</span>