framework/js/lib/helpers/username.js
dcsjapan 49d59089e4 Add third tier to key namespacing
- Changes all `app.trans` calls to `app.translator.trans` calls.
- Changes existing keys to [three-tier namespace structure](https://github.com/flarum/english/pull/12).
- Extracts additional strings for `lib:` namespace.
- Extracts two previously missed strings for EditGroupModal.js.
2015-10-20 13:04:43 +09:00

13 lines
405 B
JavaScript

/**
* The `username` helper displays a user's username in a <span class="username">
* tag. If the user doesn't exist, the username will be displayed as [deleted].
*
* @param {User} user
* @return {Object}
*/
export default function username(user) {
const name = (user && user.username()) || app.translator.trans('core.lib.deleted_user_text');
return <span className="username">{name}</span>;
}