mirror of
https://github.com/flarum/framework.git
synced 2025-05-03 01:54:03 +08:00

Improved consistency for existing core translation key names. See flarum/core#265 - Completely overhauled core en.yml - Replaced existing key names in all core JS files to match - Extracted a hardcoded string in IndexPage.js - Combined two app.trans calls in DiscussionControls.js - Removed hardcoded spaces from LogInModal.js and SignUpModal.js - Added two new keys from DiscussionControls.js (soft delete) - Created two new “reused keys” to YML to accommodate same
14 lines
454 B
JavaScript
14 lines
454 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) {
|
|
// Core Key Reorganization: Added core namespacing to the key.
|
|
const name = (user && user.username()) || app.trans('core.deleted_username');
|
|
|
|
return <span className="username">{name}</span>;
|
|
}
|