mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
Merge pull request #2 from dcsjapan/extract-translations
Extract translations
This commit is contained in:
commit
86574d1039
|
@ -6,7 +6,7 @@ app.initializers.add('suspend', () => {
|
||||||
extend(PermissionGrid.prototype, 'moderateItems', items => {
|
extend(PermissionGrid.prototype, 'moderateItems', items => {
|
||||||
items.add('suspendUsers', {
|
items.add('suspendUsers', {
|
||||||
icon: 'ban',
|
icon: 'ban',
|
||||||
label: 'Suspend users',
|
label: app.translator.trans('flarum-suspend.admin.permissions.suspend_users_label'),
|
||||||
permission: 'user.suspend'
|
permission: 'user.suspend'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,7 +24,7 @@ export default class SuspendUserModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return 'Suspend ' + this.props.user.username();
|
return app.translator.trans('flarum-suspend.forum.suspend_user.title', {user: this.props.user.username()});
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
@ -32,16 +32,16 @@ export default class SuspendUserModal extends Modal {
|
||||||
<div className="Modal-body">
|
<div className="Modal-body">
|
||||||
<div className="Form">
|
<div className="Form">
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<label>Suspension Status</label>
|
<label>{app.translator.trans('flarum-suspend.forum.suspend_user.status_heading')}</label>
|
||||||
<div>
|
<div>
|
||||||
<label className="checkbox">
|
<label className="checkbox">
|
||||||
<input type="radio" name="status" checked={!this.status()} onclick={m.withAttr('value', this.status)}/>
|
<input type="radio" name="status" checked={!this.status()} onclick={m.withAttr('value', this.status)}/>
|
||||||
Not suspended
|
{app.translator.trans('flarum-suspend.forum.suspend_user.not_suspended_label')}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="checkbox">
|
<label className="checkbox">
|
||||||
<input type="radio" name="status" checked={this.status() === 'indefinitely'} value='indefinitely' onclick={m.withAttr('value', this.status)}/>
|
<input type="radio" name="status" checked={this.status() === 'indefinitely'} value='indefinitely' onclick={m.withAttr('value', this.status)}/>
|
||||||
Suspended indefinitely
|
{app.translator.trans('flarum-suspend.forum.suspend_user.indefinitely_label')}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label className="checkbox SuspendUserModal-days">
|
<label className="checkbox SuspendUserModal-days">
|
||||||
|
@ -51,7 +51,7 @@ export default class SuspendUserModal extends Modal {
|
||||||
this.$('.SuspendUserModal-days-input input').select();
|
this.$('.SuspendUserModal-days-input input').select();
|
||||||
m.redraw.strategy('none');
|
m.redraw.strategy('none');
|
||||||
}}/>
|
}}/>
|
||||||
Suspended for a limited time...
|
{app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_label')}
|
||||||
{this.status() === 'limited' ? (
|
{this.status() === 'limited' ? (
|
||||||
<div className="SuspendUserModal-days-input">
|
<div className="SuspendUserModal-days-input">
|
||||||
<input type="number"
|
<input type="number"
|
||||||
|
@ -59,7 +59,7 @@ export default class SuspendUserModal extends Modal {
|
||||||
value={this.daysRemaining()}
|
value={this.daysRemaining()}
|
||||||
oninput={m.withAttr('value', this.daysRemaining)}
|
oninput={m.withAttr('value', this.daysRemaining)}
|
||||||
className="FormControl"/>
|
className="FormControl"/>
|
||||||
{' days'}
|
{app.translator.trans('flarum-suspend.forum.suspend_user.limited_time_days_text')}
|
||||||
</div>
|
</div>
|
||||||
) : ''}
|
) : ''}
|
||||||
</label>
|
</label>
|
||||||
|
@ -68,7 +68,7 @@ export default class SuspendUserModal extends Modal {
|
||||||
|
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<Button className="Button Button--primary" loading={this.loading} type="submit">
|
<Button className="Button Button--primary" loading={this.loading} type="submit">
|
||||||
Save Changes
|
{app.translator.trans('flarum-suspend.forum.suspend_user.submit_button')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@ app.initializers.add('flarum-suspend', () => {
|
||||||
extend(UserControls, 'moderationControls', (items, user) => {
|
extend(UserControls, 'moderationControls', (items, user) => {
|
||||||
if (user.canSuspend()) {
|
if (user.canSuspend()) {
|
||||||
items.add('suspend', Button.component({
|
items.add('suspend', Button.component({
|
||||||
children: 'Suspend',
|
children: app.translator.trans('flarum-suspend.forum.user_controls.suspend_button'),
|
||||||
icon: 'ban',
|
icon: 'ban',
|
||||||
onclick: () => app.modal.show(new SuspendUserModal({user}))
|
onclick: () => app.modal.show(new SuspendUserModal({user}))
|
||||||
}));
|
}));
|
||||||
|
@ -29,7 +29,7 @@ app.initializers.add('flarum-suspend', () => {
|
||||||
items.add('suspended', Badge.component({
|
items.add('suspended', Badge.component({
|
||||||
icon: 'ban',
|
icon: 'ban',
|
||||||
type: 'suspended',
|
type: 'suspended',
|
||||||
label: 'Suspended'
|
label: app.translator.trans('flarum-suspend.forum.user_badge.suspended_tooltip')
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user