Merge branch 'dcsjapan-admin-string-extraction'

This commit is contained in:
Toby Zerner 2015-10-14 14:46:05 +10:30
commit 8fc43cac9e
11 changed files with 85 additions and 81 deletions

View File

@ -35,36 +35,36 @@ export default class AdminNav extends Component {
items.add('dashboard', AdminLinkButton.component({ items.add('dashboard', AdminLinkButton.component({
href: app.route('dashboard'), href: app.route('dashboard'),
icon: 'bar-chart', icon: 'bar-chart',
children: 'Dashboard', children: app.trans('core.admin.nav_dashboard_button'),
description: 'Your forum at a glance.' description: app.trans('core.admin.nav_dashboard_text')
})); }));
items.add('basics', AdminLinkButton.component({ items.add('basics', AdminLinkButton.component({
href: app.route('basics'), href: app.route('basics'),
icon: 'pencil', icon: 'pencil',
children: 'Basics', children: app.trans('core.admin.nav_basics_button'),
description: 'Set your forum title, language, and other basic settings.' description: app.trans('core.admin.nav_basics_text')
})); }));
items.add('permissions', AdminLinkButton.component({ items.add('permissions', AdminLinkButton.component({
href: app.route('permissions'), href: app.route('permissions'),
icon: 'key', icon: 'key',
children: 'Permissions', children: app.trans('core.admin.nav_permissions_button'),
description: 'Configure who can see and do what.' description: app.trans('core.admin.nav_permissions_text')
})); }));
items.add('appearance', AdminLinkButton.component({ items.add('appearance', AdminLinkButton.component({
href: app.route('appearance'), href: app.route('appearance'),
icon: 'paint-brush', icon: 'paint-brush',
children: 'Appearance', children: app.trans('core.admin.nav_appearance_button'),
description: 'Customize your forum\'s colors, logos, and other variables.' description: app.trans('core.admin.nav_appearance_text')
})); }));
items.add('extensions', AdminLinkButton.component({ items.add('extensions', AdminLinkButton.component({
href: app.route('extensions'), href: app.route('extensions'),
icon: 'puzzle-piece', icon: 'puzzle-piece',
children: 'Extensions', children: app.trans('core.admin.nav_extensions_button'),
description: 'Add extra functionality to your forum and make it your own.' description: app.trans('core.admin.nav_extensions_text')
})); }));
return items; return items;

View File

@ -18,9 +18,9 @@ export default class AppearancePage extends Component {
<div className="container"> <div className="container">
<form onsubmit={this.onsubmit.bind(this)}> <form onsubmit={this.onsubmit.bind(this)}>
<fieldset className="AppearancePage-colors"> <fieldset className="AppearancePage-colors">
<legend>Colors</legend> <legend>{app.trans('core.admin.appearance_colors_heading')}</legend>
<div className="helpText"> <div className="helpText">
Choose two colors to theme your forum with. The first will be used as a highlight color, while the second will be used to style background elements. {app.trans('core.admin.appearance_colors_text')}
</div> </div>
<div className="AppearancePage-colors-input"> <div className="AppearancePage-colors-input">
@ -30,33 +30,33 @@ export default class AppearancePage extends Component {
{Switch.component({ {Switch.component({
state: this.darkMode(), state: this.darkMode(),
children: 'Dark Mode', children: app.trans('core.admin.appearance_dark_mode_label'),
onchange: this.darkMode onchange: this.darkMode
})} })}
{Switch.component({ {Switch.component({
state: this.coloredHeader(), state: this.coloredHeader(),
children: 'Colored Header', children: app.trans('core.admin.appearance_colored_header_label'),
onchange: this.coloredHeader onchange: this.coloredHeader
})} })}
{Button.component({ {Button.component({
className: 'Button Button--primary', className: 'Button Button--primary',
type: 'submit', type: 'submit',
children: 'Save Changes', children: app.trans('core.admin.appearance_submit_button'),
loading: this.loading loading: this.loading
})} })}
</fieldset> </fieldset>
</form> </form>
<fieldset> <fieldset>
<legend>Custom Styles</legend> <legend>{app.trans('core.admin.appearance_custom_styles_heading')}</legend>
<div className="helpText"> <div className="helpText">
Customize your forum's appearance by adding your own LESS/CSS code to be applied on top of Flarum's default styles. {app.trans('core.admin.appearance_custom_styles_text')}
</div> </div>
{Button.component({ {Button.component({
className: 'Button', className: 'Button',
children: 'Edit Custom CSS', children: app.trans('core.admin.appearance_edit_css_button'),
onclick: () => app.modal.show(new EditCustomCssModal()) onclick: () => app.modal.show(new EditCustomCssModal())
})} })}
</fieldset> </fieldset>
@ -71,7 +71,7 @@ export default class AppearancePage extends Component {
const hex = /^#[0-9a-f]{3}([0-9a-f]{3})?$/i; const hex = /^#[0-9a-f]{3}([0-9a-f]{3})?$/i;
if (!hex.test(this.primaryColor()) || !hex.test(this.secondaryColor())) { if (!hex.test(this.primaryColor()) || !hex.test(this.secondaryColor())) {
alert('Please enter a hexadecimal color code.'); alert(app.trans('core.admin.appearance_enter_hex_message'));
return; return;
} }

View File

@ -36,17 +36,17 @@ export default class BasicsPage extends Component {
<div className="container"> <div className="container">
<form onsubmit={this.onsubmit.bind(this)}> <form onsubmit={this.onsubmit.bind(this)}>
{FieldSet.component({ {FieldSet.component({
label: 'Forum Title', label: app.trans('core.admin.basics_forum_title_heading'),
children: [ children: [
<input className="FormControl" value={this.values.forum_title()} oninput={m.withAttr('value', this.values.forum_title)}/> <input className="FormControl" value={this.values.forum_title()} oninput={m.withAttr('value', this.values.forum_title)}/>
] ]
})} })}
{FieldSet.component({ {FieldSet.component({
label: 'Forum Description', label: app.trans('core.admin.basics_forum_description_heading'),
children: [ children: [
<div className="helpText"> <div className="helpText">
Enter a short sentence or two that describes your community. This will appear in the meta tag and show up in search engines. {app.trans('core.admin.basics_forum_description_text')}
</div>, </div>,
<textarea className="FormControl" value={this.values.forum_description()} oninput={m.withAttr('value', this.values.forum_description)}/> <textarea className="FormControl" value={this.values.forum_description()} oninput={m.withAttr('value', this.values.forum_description)}/>
] ]
@ -54,7 +54,7 @@ export default class BasicsPage extends Component {
{Object.keys(this.localeOptions).length > 1 {Object.keys(this.localeOptions).length > 1
? FieldSet.component({ ? FieldSet.component({
label: 'Default Language', label: app.trans('core.admin.basics_default_language_heading'),
children: [ children: [
Select.component({ Select.component({
options: this.localeOptions, options: this.localeOptions,
@ -65,11 +65,11 @@ export default class BasicsPage extends Component {
: ''} : ''}
{FieldSet.component({ {FieldSet.component({
label: 'Home Page', label: app.trans('core.admin.basics_home_page_heading'),
className: 'BasicsPage-homePage', className: 'BasicsPage-homePage',
children: [ children: [
<div className="helpText"> <div className="helpText">
Choose the page which users will first see when they visit your forum. If entering a custom value, use the path relative to the forum root. {app.trans('core.admin.basics_home_page_text')}
</div>, </div>,
this.homePageItems().toArray().map(({path, label}) => this.homePageItems().toArray().map(({path, label}) =>
<label className="checkbox"> <label className="checkbox">
@ -81,11 +81,11 @@ export default class BasicsPage extends Component {
})} })}
{FieldSet.component({ {FieldSet.component({
label: 'Welcome Banner', label: app.trans('core.admin.basics_welcome_banner_heading'),
className: 'BasicsPage-welcomeBanner', className: 'BasicsPage-welcomeBanner',
children: [ children: [
<div className="helpText"> <div className="helpText">
Configure the text that displays in the banner on the All Discussions page. Use this to welcome guests to your forum. {app.trans('core.admin.basics_welcome_banner_text')}
</div>, </div>,
<div className="BasicsPage-welcomeBanner-input"> <div className="BasicsPage-welcomeBanner-input">
<input className="FormControl" value={this.values.welcome_title()} oninput={m.withAttr('value', this.values.welcome_title)}/> <input className="FormControl" value={this.values.welcome_title()} oninput={m.withAttr('value', this.values.welcome_title)}/>
@ -97,7 +97,7 @@ export default class BasicsPage extends Component {
{Button.component({ {Button.component({
type: 'submit', type: 'submit',
className: 'Button Button--primary', className: 'Button Button--primary',
children: 'Save Changes', children: app.trans('core.admin.basics_submit_button'),
loading: this.loading, loading: this.loading,
disabled: !this.changed() disabled: !this.changed()
})} })}
@ -123,7 +123,7 @@ export default class BasicsPage extends Component {
items.add('allDiscussions', { items.add('allDiscussions', {
path: '/all', path: '/all',
label: 'All Discussions' label: app.trans('core.admin.basics_all_discussions_label')
}); });
return items; return items;
@ -143,7 +143,7 @@ export default class BasicsPage extends Component {
saveSettings(settings) saveSettings(settings)
.then(() => { .then(() => {
app.alerts.show(this.successAlert = new Alert({type: 'success', children: 'Your changes were saved.'})); app.alerts.show(this.successAlert = new Alert({type: 'success', children: app.trans('core.admin.basics_saved_message')}));
}) })
.finally(() => { .finally(() => {
this.loading = false; this.loading = false;

View File

@ -6,14 +6,14 @@ export default class DashboardPage extends Component {
<div className="DashboardPage"> <div className="DashboardPage">
<div className="container"> <div className="container">
<h2>Welcome to Flarum Beta</h2> <h2>Welcome to Flarum Beta</h2>
<p>Thanks for trying out Flarum! You are running version <strong>{app.forum.attribute('version')}</strong>.</p> <p>{app.trans('core.admin.dashboard_version_text', {version: <strong>{app.forum.attribute('version')}</strong>})}</p>
<p>This <strong>beta software</strong> is provided primarily so that you can help us test it and make it better; it should not be used in production.</p> <p>{app.trans('core.admin.dashboard_beta_warning_text', {strong: <strong/>})}</p>
<ul> <ul>
<li>Want to look for bugs and contribute? Read the <a href="http://flarum.org/docs/contributing" target="_blank">Contributing docs</a>.</li> <li>{app.trans('core.admin.dashboard_contributing_text', {a: <a href="http://flarum.org/docs/contributing" target="_blank"/>})}</li>
<li>Having problems? Follow the instructions in the <a href="http://flarum.org/docs/troubleshooting" target="_blank">Troubleshooting docs</a>.</li> <li>{app.trans('core.admin.dashboard_troubleshooting_text', {a: <a href="http://flarum.org/docs/troubleshooting" target="_blank"/>})}</li>
<li>Found a bug? Please report it in our forum, under the <a href="http://discuss.flarum.org/t/support" target="_blank">Support tag</a>.</li> <li>{app.trans('core.admin.dashboard_support_text', {a: <a href="http://discuss.flarum.org/t/support" target="_blank"/>})}</li>
<li>Got an idea to improve a feature? Tell us about it under the <a href="http://discuss.flarum.org/t/features" target="_blank">Features tag</a>.</li> <li>{app.trans('core.admin.dashboard_features_text', {a: <a href="http://discuss.flarum.org/t/features" target="_blank"/>})}</li>
<li>Interested in developing extensions? Read the <a href="http://flarum.org/docs/extend" target="_blank">Extension docs</a>.</li> <li>{app.trans('core.admin.dashboard_extension_text', {a: <a href="http://flarum.org/docs/extend" target="_blank"/>})}</li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -28,7 +28,7 @@ export default class EditGroupModal extends Modal {
style: {backgroundColor: this.color()} style: {backgroundColor: this.color()}
}) : '', }) : '',
' ', ' ',
this.namePlural() || 'Create Group' this.namePlural() || app.trans('core.admin.edit_group_title')
]; ];
} }
@ -37,7 +37,7 @@ export default class EditGroupModal 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>Name</label> <label>{app.trans('core.admin.edit_group_name_label')}</label>
<div className="EditGroupModal-name-input"> <div className="EditGroupModal-name-input">
<input className="FormControl" placeholder="Singular (e.g. Mod)" value={this.nameSingular()} oninput={m.withAttr('value', this.nameSingular)}/> <input className="FormControl" placeholder="Singular (e.g. Mod)" value={this.nameSingular()} oninput={m.withAttr('value', this.nameSingular)}/>
<input className="FormControl" placeholder="Plural (e.g. Mods)" value={this.namePlural()} oninput={m.withAttr('value', this.namePlural)}/> <input className="FormControl" placeholder="Plural (e.g. Mods)" value={this.namePlural()} oninput={m.withAttr('value', this.namePlural)}/>
@ -45,14 +45,14 @@ export default class EditGroupModal extends Modal {
</div> </div>
<div className="Form-group"> <div className="Form-group">
<label>Color</label> <label>{app.trans('core.admin.edit_group_color_label')}</label>
<input className="FormControl" placeholder="#aaaaaa" value={this.color()} oninput={m.withAttr('value', this.color)}/> <input className="FormControl" placeholder="#aaaaaa" value={this.color()} oninput={m.withAttr('value', this.color)}/>
</div> </div>
<div className="Form-group"> <div className="Form-group">
<label>Icon</label> <label>{app.trans('core.admin.edit_group_icon_label')}</label>
<div className="helpText"> <div className="helpText">
Enter the name of any <a href="http://fortawesome.github.io/Font-Awesome/icons/" tabindex="-1">FontAwesome</a> icon class, <em>without</em> the <code>fa-</code> prefix. {app.trans('core.admin.edit_group_icon_text', {a: <a href="http://fortawesome.github.io/Font-Awesome/icons/" tabindex="-1"/>}, {em: <em/>}, {code: <code/>})}
</div> </div>
<input className="FormControl" placeholder="bolt" value={this.icon()} oninput={m.withAttr('value', this.icon)}/> <input className="FormControl" placeholder="bolt" value={this.icon()} oninput={m.withAttr('value', this.icon)}/>
</div> </div>
@ -62,11 +62,11 @@ export default class EditGroupModal extends Modal {
type: 'submit', type: 'submit',
className: 'Button Button--primary EditGroupModal-save', className: 'Button Button--primary EditGroupModal-save',
loading: this.loading, loading: this.loading,
children: 'Save Changes' children: app.trans('core.admin.edit_group_submit_button')
})} })}
{this.group.exists && this.group.id() !== Group.ADMINISTRATOR_ID ? ( {this.group.exists && this.group.id() !== Group.ADMINISTRATOR_ID ? (
<button type="button" className="Button EditGroupModal-delete" onclick={this.delete.bind(this)}> <button type="button" className="Button EditGroupModal-delete" onclick={this.delete.bind(this)}>
Delete Group {app.trans('core.admin.edit_group_delete_button')}
</button> </button>
) : ''} ) : ''}
</div> </div>
@ -95,7 +95,7 @@ export default class EditGroupModal extends Modal {
} }
delete() { delete() {
if (confirm('Are you sure you want to delete this group? The group members will NOT be deleted.')) { if (confirm(app.trans('core.admin.edit_group_delete_confirmation'))) {
this.group.delete().then(() => m.redraw()); this.group.delete().then(() => m.redraw());
this.hide(); this.hide();
} }

View File

@ -18,7 +18,7 @@ export default class ExtensionsPage extends Component {
<div className="ExtensionsPage-header"> <div className="ExtensionsPage-header">
<div className="container"> <div className="container">
{Button.component({ {Button.component({
children: 'Add Extension', children: app.trans('core.admin.extensions_add_button'),
icon: 'plus', icon: 'plus',
className: 'Button Button--primary', className: 'Button Button--primary',
onclick: () => app.modal.show(new AddExtensionModal()) onclick: () => app.modal.show(new AddExtensionModal())
@ -70,7 +70,7 @@ export default class ExtensionsPage extends Component {
if (app.extensionSettings[name]) { if (app.extensionSettings[name]) {
items.add('settings', Button.component({ items.add('settings', Button.component({
icon: 'cog', icon: 'cog',
children: 'Settings', children: app.trans('core.admin.extensions_settings_button'),
onclick: app.extensionSettings[name] onclick: app.extensionSettings[name]
})); }));
} }
@ -78,7 +78,7 @@ export default class ExtensionsPage extends Component {
if (!enabled) { if (!enabled) {
items.add('uninstall', Button.component({ items.add('uninstall', Button.component({
icon: 'trash-o', icon: 'trash-o',
children: 'Uninstall', children: app.trans('core.admin.extensions_uninstall_button'),
onclick: () => { onclick: () => {
app.request({ app.request({
url: app.forum.attribute('apiUrl') + '/extensions/' + name, url: app.forum.attribute('apiUrl') + '/extensions/' + name,

View File

@ -10,7 +10,7 @@ export default class LoadingModal extends Modal {
} }
title() { title() {
return 'Please Wait...'; return app.trans('core.admin.extensions_loading_title');
} }
content() { content() {

View File

@ -27,9 +27,9 @@ export default class PermissionDropdown extends Dropdown {
const adminGroup = app.store.getById('groups', Group.ADMINISTRATOR_ID); const adminGroup = app.store.getById('groups', Group.ADMINISTRATOR_ID);
if (everyone) { if (everyone) {
this.props.label = 'Everyone'; this.props.label = app.trans('core.admin.permissions_dropdown_everyone_button');
} else if (members) { } else if (members) {
this.props.label = 'Members'; this.props.label = app.trans('core.admin.permissions_dropdown_members_button');
} else { } else {
this.props.label = [ this.props.label = [
badgeForId(Group.ADMINISTRATOR_ID), badgeForId(Group.ADMINISTRATOR_ID),
@ -40,7 +40,7 @@ export default class PermissionDropdown extends Dropdown {
if (this.props.allowGuest) { if (this.props.allowGuest) {
this.props.children.push( this.props.children.push(
Button.component({ Button.component({
children: 'Everyone', children: app.trans('core.admin.permissions_dropdown_everyone_button'),
icon: everyone ? 'check' : true, icon: everyone ? 'check' : true,
onclick: () => this.save([Group.GUEST_ID]) onclick: () => this.save([Group.GUEST_ID])
}) })
@ -49,7 +49,7 @@ export default class PermissionDropdown extends Dropdown {
this.props.children.push( this.props.children.push(
Button.component({ Button.component({
children: 'Members', children: app.trans('core.admin.permissions_dropdown_members_button'),
icon: members ? 'check' : true, icon: members ? 'check' : true,
onclick: () => this.save([Group.MEMBER_ID]) onclick: () => this.save([Group.MEMBER_ID])
}), }),

View File

@ -59,22 +59,22 @@ export default class PermissionGrid extends Component {
const items = new ItemList(); const items = new ItemList();
items.add('view', { items.add('view', {
label: 'Read', label: app.trans('core.admin.permissions_read_heading'),
children: this.viewItems().toArray() children: this.viewItems().toArray()
}, 100); }, 100);
items.add('start', { items.add('start', {
label: 'Create', label: app.trans('core.admin.permissions_create_heading'),
children: this.startItems().toArray() children: this.startItems().toArray()
}, 90); }, 90);
items.add('reply', { items.add('reply', {
label: 'Participate', label: app.trans('core.admin.permissions_participate_heading'),
children: this.replyItems().toArray() children: this.replyItems().toArray()
}, 80); }, 80);
items.add('moderate', { items.add('moderate', {
label: 'Moderate', label: app.trans('core.admin.permissions_moderate_heading'),
children: this.moderateItems().toArray() children: this.moderateItems().toArray()
}, 70); }, 70);
@ -86,19 +86,19 @@ export default class PermissionGrid extends Component {
items.add('view', { items.add('view', {
icon: 'eye', icon: 'eye',
label: 'View discussions', label: app.trans('core.admin.permissions_view_discussions_label'),
permission: 'forum.view', permission: 'forum.view',
allowGuest: true allowGuest: true
}, 100); }, 100);
items.add('signUp', { items.add('signUp', {
icon: 'user-plus', icon: 'user-plus',
label: 'Sign up', label: app.trans('core.admin.permissions_sign_up_label'),
setting: () => SettingDropdown.component({ setting: () => SettingDropdown.component({
key: 'allow_sign_up', key: 'allow_sign_up',
options: [ options: [
{value: '1', label: 'Open'}, {value: '1', label: app.trans('core.admin.permissions_signup_open_button')},
{value: '0', label: 'Closed'} {value: '0', label: app.trans('core.admin.permissions_signup_closed_button')}
] ]
}) })
}, 90); }, 90);
@ -111,23 +111,25 @@ export default class PermissionGrid extends Component {
items.add('start', { items.add('start', {
icon: 'edit', icon: 'edit',
label: 'Start discussions', label: app.trans('core.admin.permissions_start_discussions_label'),
permission: 'forum.startDiscussion' permission: 'forum.startDiscussion'
}, 100); }, 100);
items.add('allowRenaming', { items.add('allowRenaming', {
icon: 'i-cursor', icon: 'i-cursor',
label: 'Allow renaming', label: app.trans('core.admin.permissions_allow_renaming_label'),
setting: () => { setting: () => {
const minutes = parseInt(app.settings.allow_renaming, 10); const minutes = parseInt(app.settings.allow_renaming, 10);
return SettingDropdown.component({ return SettingDropdown.component({
defaultLabel: minutes ? `For ${minutes} minutes` : 'Indefinitely', defaultLabel: minutes
? app.trans('core.admin.permissions_allow_some_minutes_button', {count: minutes})
: app.trans('core.admin.permissions_allow_indefinitely_button'),
key: 'allow_renaming', key: 'allow_renaming',
options: [ options: [
{value: '-1', label: 'Indefinitely'}, {value: '-1', label: app.trans('core.admin.permissions_allow_indefinitely_button')},
{value: '10', label: 'For 10 minutes'}, {value: '10', label: app.trans('core.admin.permissions_allow_ten_minutes_button')},
{value: 'reply', label: 'Until next reply'} {value: 'reply', label: app.trans('core.admin.permissions_allow_until_reply_button')}
] ]
}); });
} }
@ -141,23 +143,25 @@ export default class PermissionGrid extends Component {
items.add('reply', { items.add('reply', {
icon: 'reply', icon: 'reply',
label: 'Reply to discussions', label: app.trans('core.admin.permissions_reply_to_discussions_label'),
permission: 'discussion.reply' permission: 'discussion.reply'
}, 100); }, 100);
items.add('allowPostEditing', { items.add('allowPostEditing', {
icon: 'pencil', icon: 'pencil',
label: 'Allow post editing', label: app.trans('core.admin.permissions_allow_post_editing_label'),
setting: () => { setting: () => {
const minutes = parseInt(app.settings.allow_post_editing, 10); const minutes = parseInt(app.settings.allow_post_editing, 10);
return SettingDropdown.component({ return SettingDropdown.component({
defaultLabel: minutes ? `For ${minutes} minutes` : 'Indefinitely', defaultLabel: minutes
? app.trans('core.admin.permissions_allow_some_minutes_button', {count: minutes})
: app.trans('core.admin.permissions_allow_indefinitely_button'),
key: 'allow_post_editing', key: 'allow_post_editing',
options: [ options: [
{value: '-1', label: 'Indefinitely'}, {value: '-1', label: app.trans('core.admin.permissions_allow_indefinitely_button')},
{value: '10', label: 'For 10 minutes'}, {value: '10', label: app.trans('core.admin.permissions_allow_ten_minutes_button')},
{value: 'reply', label: 'Until next reply'} {value: 'reply', label: app.trans('core.admin.permissions_allow_until_reply_button')}
] ]
}); });
} }
@ -171,31 +175,31 @@ export default class PermissionGrid extends Component {
items.add('renameDiscussions', { items.add('renameDiscussions', {
icon: 'i-cursor', icon: 'i-cursor',
label: 'Rename discussions', label: app.trans('core.admin.permissions_rename_discussions_label'),
permission: 'discussion.rename' permission: 'discussion.rename'
}, 100); }, 100);
items.add('hideDiscussions', { items.add('hideDiscussions', {
icon: 'trash-o', icon: 'trash-o',
label: 'Delete discussions', label: app.trans('core.admin.permissions_delete_discussions_label'),
permission: 'discussion.hide' permission: 'discussion.hide'
}, 90); }, 90);
items.add('deleteDiscussions', { items.add('deleteDiscussions', {
icon: 'times', icon: 'times',
label: 'Delete discussions forever', label: app.trans('core.admin.permissions_delete_discussions_forever_label'),
permission: 'discussion.delete' permission: 'discussion.delete'
}, 80); }, 80);
items.add('editPosts', { items.add('editPosts', {
icon: 'pencil', icon: 'pencil',
label: 'Edit and delete posts', label: app.trans('core.admin.permissions_edit_and_delete_posts_label'),
permission: 'discussion.editPosts' permission: 'discussion.editPosts'
}, 70); }, 70);
items.add('deletePosts', { items.add('deletePosts', {
icon: 'times', icon: 'times',
label: 'Delete posts forever', label: app.trans('core.admin.permissions_delete_posts_forever_label'),
permission: 'discussion.deletePosts' permission: 'discussion.deletePosts'
}, 60); }, 60);
@ -206,7 +210,7 @@ export default class PermissionGrid extends Component {
const items = new ItemList(); const items = new ItemList();
items.add('global', { items.add('global', {
label: 'Global', label: app.trans('core.admin.permissions_global_heading'),
render: item => { render: item => {
if (item.setting) { if (item.setting) {
return item.setting(); return item.setting();

View File

@ -25,7 +25,7 @@ export default class PermissionsPage extends Component {
))} ))}
<button className="Button Group Group--add" onclick={() => app.modal.show(new EditGroupModal())}> <button className="Button Group Group--add" onclick={() => app.modal.show(new EditGroupModal())}>
{icon('plus', {className: 'Group-icon'})} {icon('plus', {className: 'Group-icon'})}
<span className="Group-name">New Group</span> <span className="Group-name">{app.trans('core.admin.permissions_new_group_button')}</span>
</button> </button>
</div> </div>
</div> </div>

View File

@ -43,7 +43,7 @@ export default class SessionDropdown extends Dropdown {
items.add('logOut', items.add('logOut',
Button.component({ Button.component({
icon: 'sign-out', icon: 'sign-out',
children: app.trans('core.log_out'), children: app.trans('core.admin.header_log_out_button'),
onclick: app.session.logout.bind(app.session) onclick: app.session.logout.bind(app.session)
}), }),
-100 -100