import { extend } from 'flarum/extend';
import Discussion from 'flarum/models/Discussion';
import Badge from 'flarum/components/Badge';

export default function addLockBadge() {
  extend(Discussion.prototype, 'badges', function(badges) {
    if (this.isLocked()) {
      badges.add('locked', Badge.component({
        type: 'locked',
        label: app.translator.trans('flarum-lock.forum.badge.locked_discussion_tooltip'),
        icon: 'lock'
      }));
    }
  });
}

import { extend } from 'flarum/extend';
import Discussion from 'flarum/models/Discussion';
import Badge from 'flarum/components/Badge';

export default function addLockBadge() {
  extend(Discussion.prototype, 'badges', function(badges) {
    if (this.isLocked()) {
      badges.add('locked', Badge.component({
        type: 'locked',
        label: app.translator.trans('flarum-lock.forum.badge.locked_tooltip'),
        icon: 'lock'
      }));
    }
  });
}

Rename the key for the "Locked" badge tooltip
Rename the key for the "Locked" badge tooltip

- Shortens the key name for consistency with `badge:` namespace.
- Revised YAML to follow.
