mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 00:43:39 +08:00
Merge branch 'dcsjapan-key-adjustment'
This commit is contained in:
commit
c5f9124e6c
|
@ -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: app.trans('core.admin.nav_dashboard_button'),
|
children: app.translator.trans('core.admin.nav.dashboard_button'),
|
||||||
description: app.trans('core.admin.nav_dashboard_text')
|
description: app.translator.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: app.trans('core.admin.nav_basics_button'),
|
children: app.translator.trans('core.admin.nav.basics_button'),
|
||||||
description: app.trans('core.admin.nav_basics_text')
|
description: app.translator.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: app.trans('core.admin.nav_permissions_button'),
|
children: app.translator.trans('core.admin.nav.permissions_button'),
|
||||||
description: app.trans('core.admin.nav_permissions_text')
|
description: app.translator.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: app.trans('core.admin.nav_appearance_button'),
|
children: app.translator.trans('core.admin.nav.appearance_button'),
|
||||||
description: app.trans('core.admin.nav_appearance_text')
|
description: app.translator.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: app.trans('core.admin.nav_extensions_button'),
|
children: app.translator.trans('core.admin.nav.extensions_button'),
|
||||||
description: app.trans('core.admin.nav_extensions_text')
|
description: app.translator.trans('core.admin.nav.extensions_text')
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|
|
@ -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>{app.trans('core.admin.appearance_colors_heading')}</legend>
|
<legend>{app.translator.trans('core.admin.appearance.colors_heading')}</legend>
|
||||||
<div className="helpText">
|
<div className="helpText">
|
||||||
{app.trans('core.admin.appearance_colors_text')}
|
{app.translator.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: app.trans('core.admin.appearance_dark_mode_label'),
|
children: app.translator.trans('core.admin.appearance.dark_mode_label'),
|
||||||
onchange: this.darkMode
|
onchange: this.darkMode
|
||||||
})}
|
})}
|
||||||
|
|
||||||
{Switch.component({
|
{Switch.component({
|
||||||
state: this.coloredHeader(),
|
state: this.coloredHeader(),
|
||||||
children: app.trans('core.admin.appearance_colored_header_label'),
|
children: app.translator.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: app.trans('core.admin.appearance_submit_button'),
|
children: app.translator.trans('core.admin.appearance.submit_button'),
|
||||||
loading: this.loading
|
loading: this.loading
|
||||||
})}
|
})}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{app.trans('core.admin.appearance_custom_styles_heading')}</legend>
|
<legend>{app.translator.trans('core.admin.appearance.custom_styles_heading')}</legend>
|
||||||
<div className="helpText">
|
<div className="helpText">
|
||||||
{app.trans('core.admin.appearance_custom_styles_text')}
|
{app.translator.trans('core.admin.appearance.custom_styles_text')}
|
||||||
</div>
|
</div>
|
||||||
{Button.component({
|
{Button.component({
|
||||||
className: 'Button',
|
className: 'Button',
|
||||||
children: app.trans('core.admin.appearance_edit_css_button'),
|
children: app.translator.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(app.trans('core.admin.appearance_enter_hex_message'));
|
alert(app.translator.trans('core.admin.appearance.enter_hex_message'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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: app.trans('core.admin.basics_forum_title_heading'),
|
label: app.translator.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: app.trans('core.admin.basics_forum_description_heading'),
|
label: app.translator.trans('core.admin.basics.forum_description_heading'),
|
||||||
children: [
|
children: [
|
||||||
<div className="helpText">
|
<div className="helpText">
|
||||||
{app.trans('core.admin.basics_forum_description_text')}
|
{app.translator.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: app.trans('core.admin.basics_default_language_heading'),
|
label: app.translator.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: app.trans('core.admin.basics_home_page_heading'),
|
label: app.translator.trans('core.admin.basics.home_page_heading'),
|
||||||
className: 'BasicsPage-homePage',
|
className: 'BasicsPage-homePage',
|
||||||
children: [
|
children: [
|
||||||
<div className="helpText">
|
<div className="helpText">
|
||||||
{app.trans('core.admin.basics_home_page_text')}
|
{app.translator.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: app.trans('core.admin.basics_welcome_banner_heading'),
|
label: app.translator.trans('core.admin.basics.welcome_banner_heading'),
|
||||||
className: 'BasicsPage-welcomeBanner',
|
className: 'BasicsPage-welcomeBanner',
|
||||||
children: [
|
children: [
|
||||||
<div className="helpText">
|
<div className="helpText">
|
||||||
{app.trans('core.admin.basics_welcome_banner_text')}
|
{app.translator.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: app.trans('core.admin.basics_submit_button'),
|
children: app.translator.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: app.trans('core.admin.basics_all_discussions_label')
|
label: app.translator.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: app.trans('core.admin.basics_saved_message')}));
|
app.alerts.show(this.successAlert = new Alert({type: 'success', children: app.translator.trans('core.admin.basics.saved_message')}));
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -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>{app.trans('core.admin.dashboard_version_text', {version: <strong>{app.forum.attribute('version')}</strong>})}</p>
|
<p>{app.translator.trans('core.admin.dashboard.version_text', {version: <strong>{app.forum.attribute('version')}</strong>})}</p>
|
||||||
<p>{app.trans('core.admin.dashboard_beta_warning_text', {strong: <strong/>})}</p>
|
<p>{app.translator.trans('core.admin.dashboard.beta_warning_text', {strong: <strong/>})}</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>{app.trans('core.admin.dashboard_contributing_text', {a: <a href="http://flarum.org/docs/contributing" target="_blank"/>})}</li>
|
<li>{app.translator.trans('core.admin.dashboard.contributing_text', {a: <a href="http://flarum.org/docs/contributing" target="_blank"/>})}</li>
|
||||||
<li>{app.trans('core.admin.dashboard_troubleshooting_text', {a: <a href="http://flarum.org/docs/troubleshooting" target="_blank"/>})}</li>
|
<li>{app.translator.trans('core.admin.dashboard.troubleshooting_text', {a: <a href="http://flarum.org/docs/troubleshooting" target="_blank"/>})}</li>
|
||||||
<li>{app.trans('core.admin.dashboard_support_text', {a: <a href="http://discuss.flarum.org/t/support" target="_blank"/>})}</li>
|
<li>{app.translator.trans('core.admin.dashboard.support_text', {a: <a href="http://discuss.flarum.org/t/support" target="_blank"/>})}</li>
|
||||||
<li>{app.trans('core.admin.dashboard_features_text', {a: <a href="http://discuss.flarum.org/t/features" target="_blank"/>})}</li>
|
<li>{app.translator.trans('core.admin.dashboard.features_text', {a: <a href="http://discuss.flarum.org/t/features" target="_blank"/>})}</li>
|
||||||
<li>{app.trans('core.admin.dashboard_extension_text', {a: <a href="http://flarum.org/docs/extend" target="_blank"/>})}</li>
|
<li>{app.translator.trans('core.admin.dashboard.extension_text', {a: <a href="http://flarum.org/docs/extend" target="_blank"/>})}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -28,7 +28,7 @@ export default class EditGroupModal extends Modal {
|
||||||
style: {backgroundColor: this.color()}
|
style: {backgroundColor: this.color()}
|
||||||
}) : '',
|
}) : '',
|
||||||
' ',
|
' ',
|
||||||
this.namePlural() || app.trans('core.admin.edit_group_title')
|
this.namePlural() || app.translator.trans('core.admin.edit_group.title')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,22 +37,22 @@ 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>{app.trans('core.admin.edit_group_name_label')}</label>
|
<label>{app.translator.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={app.translator.trans('core.admin.edit_group.singular_placeholder')} 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={app.translator.trans('core.admin.edit_group.plural_placeholder')} value={this.namePlural()} oninput={m.withAttr('value', this.namePlural)}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<label>{app.trans('core.admin.edit_group_color_label')}</label>
|
<label>{app.translator.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>{app.trans('core.admin.edit_group_icon_label')}</label>
|
<label>{app.translator.trans('core.admin.edit_group.icon_label')}</label>
|
||||||
<div className="helpText">
|
<div className="helpText">
|
||||||
{app.trans('core.admin.edit_group_icon_text', {a: <a href="http://fortawesome.github.io/Font-Awesome/icons/" tabindex="-1"/>}, {em: <em/>}, {code: <code/>})}
|
{app.translator.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: app.trans('core.admin.edit_group_submit_button')
|
children: app.translator.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.deleteGroup.bind(this)}>
|
<button type="button" className="Button EditGroupModal-delete" onclick={this.deleteGroup.bind(this)}>
|
||||||
{app.trans('core.admin.edit_group_delete_button')}
|
{app.translator.trans('core.admin.edit_group.delete_button')}
|
||||||
</button>
|
</button>
|
||||||
) : ''}
|
) : ''}
|
||||||
</div>
|
</div>
|
||||||
|
@ -94,7 +94,7 @@ export default class EditGroupModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteGroup() {
|
deleteGroup() {
|
||||||
if (confirm(app.trans('core.admin.edit_group_delete_confirmation'))) {
|
if (confirm(app.translator.trans('core.admin.edit_group.delete_confirmation'))) {
|
||||||
this.group.delete().then(() => m.redraw());
|
this.group.delete().then(() => m.redraw());
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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: app.trans('core.admin.extensions_add_button'),
|
children: app.translator.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: app.trans('core.admin.extensions_settings_button'),
|
children: app.translator.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: app.trans('core.admin.extensions_uninstall_button'),
|
children: app.translator.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,
|
||||||
|
|
|
@ -10,7 +10,7 @@ export default class LoadingModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return app.trans('core.admin.extensions_loading_title');
|
return app.translator.trans('core.admin.loading.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
|
|
@ -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 = app.trans('core.admin.permissions_dropdown_everyone_button');
|
this.props.label = app.translator.trans('core.admin.permissions_controls.everyone_button');
|
||||||
} else if (members) {
|
} else if (members) {
|
||||||
this.props.label = app.trans('core.admin.permissions_dropdown_members_button');
|
this.props.label = app.translator.trans('core.admin.permissions_controls.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: app.trans('core.admin.permissions_dropdown_everyone_button'),
|
children: app.translator.trans('core.admin.permissions_controls.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: app.trans('core.admin.permissions_dropdown_members_button'),
|
children: app.translator.trans('core.admin.permissions_controls.members_button'),
|
||||||
icon: members ? 'check' : true,
|
icon: members ? 'check' : true,
|
||||||
onclick: () => this.save([Group.MEMBER_ID])
|
onclick: () => this.save([Group.MEMBER_ID])
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -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: app.trans('core.admin.permissions_read_heading'),
|
label: app.translator.trans('core.admin.permissions.read_heading'),
|
||||||
children: this.viewItems().toArray()
|
children: this.viewItems().toArray()
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
items.add('start', {
|
items.add('start', {
|
||||||
label: app.trans('core.admin.permissions_create_heading'),
|
label: app.translator.trans('core.admin.permissions.create_heading'),
|
||||||
children: this.startItems().toArray()
|
children: this.startItems().toArray()
|
||||||
}, 90);
|
}, 90);
|
||||||
|
|
||||||
items.add('reply', {
|
items.add('reply', {
|
||||||
label: app.trans('core.admin.permissions_participate_heading'),
|
label: app.translator.trans('core.admin.permissions.participate_heading'),
|
||||||
children: this.replyItems().toArray()
|
children: this.replyItems().toArray()
|
||||||
}, 80);
|
}, 80);
|
||||||
|
|
||||||
items.add('moderate', {
|
items.add('moderate', {
|
||||||
label: app.trans('core.admin.permissions_moderate_heading'),
|
label: app.translator.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('viewDiscussions', {
|
items.add('viewDiscussions', {
|
||||||
icon: 'eye',
|
icon: 'eye',
|
||||||
label: app.trans('core.admin.permissions_view_discussions_label'),
|
label: app.translator.trans('core.admin.permissions.view_discussions_label'),
|
||||||
permission: 'viewDiscussions',
|
permission: 'viewDiscussions',
|
||||||
allowGuest: true
|
allowGuest: true
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
items.add('signUp', {
|
items.add('signUp', {
|
||||||
icon: 'user-plus',
|
icon: 'user-plus',
|
||||||
label: app.trans('core.admin.permissions_sign_up_label'),
|
label: app.translator.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: app.trans('core.admin.permissions_signup_open_button')},
|
{value: '1', label: app.translator.trans('core.admin.permissions_controls.signup_open_button')},
|
||||||
{value: '0', label: app.trans('core.admin.permissions_signup_closed_button')}
|
{value: '0', label: app.translator.trans('core.admin.permissions_controls.signup_closed_button')}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
}, 90);
|
}, 90);
|
||||||
|
@ -111,25 +111,25 @@ export default class PermissionGrid extends Component {
|
||||||
|
|
||||||
items.add('start', {
|
items.add('start', {
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
label: app.trans('core.admin.permissions_start_discussions_label'),
|
label: app.translator.trans('core.admin.permissions.start_discussions_label'),
|
||||||
permission: 'startDiscussion'
|
permission: 'startDiscussion'
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
items.add('allowRenaming', {
|
items.add('allowRenaming', {
|
||||||
icon: 'i-cursor',
|
icon: 'i-cursor',
|
||||||
label: app.trans('core.admin.permissions_allow_renaming_label'),
|
label: app.translator.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
|
defaultLabel: minutes
|
||||||
? app.translator.transChoice('core.admin.permissions_allow_some_minutes_button', minutes, {count: minutes})
|
? app.translator.transChoice('core.admin.permissions_controls.allow_some_minutes_button', minutes, {count: minutes})
|
||||||
: app.trans('core.admin.permissions_allow_indefinitely_button'),
|
: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),
|
||||||
key: 'allow_renaming',
|
key: 'allow_renaming',
|
||||||
options: [
|
options: [
|
||||||
{value: '-1', label: app.trans('core.admin.permissions_allow_indefinitely_button')},
|
{value: '-1', label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')},
|
||||||
{value: '10', label: app.trans('core.admin.permissions_allow_ten_minutes_button')},
|
{value: '10', label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')},
|
||||||
{value: 'reply', label: app.trans('core.admin.permissions_allow_until_reply_button')}
|
{value: 'reply', label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -143,25 +143,25 @@ export default class PermissionGrid extends Component {
|
||||||
|
|
||||||
items.add('reply', {
|
items.add('reply', {
|
||||||
icon: 'reply',
|
icon: 'reply',
|
||||||
label: app.trans('core.admin.permissions_reply_to_discussions_label'),
|
label: app.translator.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: app.trans('core.admin.permissions_allow_post_editing_label'),
|
label: app.translator.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
|
defaultLabel: minutes
|
||||||
? app.translator.transChoice('core.admin.permissions_allow_some_minutes_button', minutes, {count: minutes})
|
? app.translator.transChoice('core.admin.permissions_controls.allow_some_minutes_button', minutes, {count: minutes})
|
||||||
: app.trans('core.admin.permissions_allow_indefinitely_button'),
|
: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),
|
||||||
key: 'allow_post_editing',
|
key: 'allow_post_editing',
|
||||||
options: [
|
options: [
|
||||||
{value: '-1', label: app.trans('core.admin.permissions_allow_indefinitely_button')},
|
{value: '-1', label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')},
|
||||||
{value: '10', label: app.trans('core.admin.permissions_allow_ten_minutes_button')},
|
{value: '10', label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')},
|
||||||
{value: 'reply', label: app.trans('core.admin.permissions_allow_until_reply_button')}
|
{value: 'reply', label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -175,31 +175,31 @@ export default class PermissionGrid extends Component {
|
||||||
|
|
||||||
items.add('renameDiscussions', {
|
items.add('renameDiscussions', {
|
||||||
icon: 'i-cursor',
|
icon: 'i-cursor',
|
||||||
label: app.trans('core.admin.permissions_rename_discussions_label'),
|
label: app.translator.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: app.trans('core.admin.permissions_delete_discussions_label'),
|
label: app.translator.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: app.trans('core.admin.permissions_delete_discussions_forever_label'),
|
label: app.translator.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: app.trans('core.admin.permissions_edit_and_delete_posts_label'),
|
label: app.translator.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: app.trans('core.admin.permissions_delete_posts_forever_label'),
|
label: app.translator.trans('core.admin.permissions.delete_posts_forever_label'),
|
||||||
permission: 'discussion.deletePosts'
|
permission: 'discussion.deletePosts'
|
||||||
}, 60);
|
}, 60);
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ export default class PermissionGrid extends Component {
|
||||||
const items = new ItemList();
|
const items = new ItemList();
|
||||||
|
|
||||||
items.add('global', {
|
items.add('global', {
|
||||||
label: app.trans('core.admin.permissions_global_heading'),
|
label: app.translator.trans('core.admin.permissions.global_heading'),
|
||||||
render: item => {
|
render: item => {
|
||||||
if (item.setting) {
|
if (item.setting) {
|
||||||
return item.setting();
|
return item.setting();
|
||||||
|
|
|
@ -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">{app.trans('core.admin.permissions_new_group_button')}</span>
|
<span className="Group-name">{app.translator.trans('core.admin.permissions.new_group_button')}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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.admin.header_log_out_button'),
|
children: app.translator.trans('core.admin.header.log_out_button'),
|
||||||
onclick: app.session.logout.bind(app.session)
|
onclick: app.session.logout.bind(app.session)
|
||||||
}),
|
}),
|
||||||
-100
|
-100
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default class AvatarEditor extends Component {
|
||||||
items.add('upload',
|
items.add('upload',
|
||||||
Button.component({
|
Button.component({
|
||||||
icon: 'upload',
|
icon: 'upload',
|
||||||
children: app.trans('core.forum.user_avatar_upload_button'),
|
children: app.translator.trans('core.forum.user.avatar_upload_button'),
|
||||||
onclick: this.upload.bind(this)
|
onclick: this.upload.bind(this)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -68,7 +68,7 @@ export default class AvatarEditor extends Component {
|
||||||
items.add('remove',
|
items.add('remove',
|
||||||
Button.component({
|
Button.component({
|
||||||
icon: 'times',
|
icon: 'times',
|
||||||
children: app.trans('core.forum.user_avatar_remove_button'),
|
children: app.translator.trans('core.forum.user.avatar_remove_button'),
|
||||||
onclick: this.remove.bind(this)
|
onclick: this.remove.bind(this)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default class ChangeEmailModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return app.trans('core.forum.change_email_title');
|
return app.translator.trans('core.forum.change_email.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
@ -37,10 +37,10 @@ export default class ChangeEmailModal extends Modal {
|
||||||
return (
|
return (
|
||||||
<div className="Modal-body">
|
<div className="Modal-body">
|
||||||
<div className="Form Form--centered">
|
<div className="Form Form--centered">
|
||||||
<p className="helpText">{app.trans('core.forum.change_email_confirmation_message', {email: <strong>{this.email()}</strong>})}</p>
|
<p className="helpText">{app.translator.trans('core.forum.change_email.confirmation_message', {email: <strong>{this.email()}</strong>})}</p>
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<Button className="Button Button--primary Button--block" onclick={this.hide.bind(this)}>
|
<Button className="Button Button--primary Button--block" onclick={this.hide.bind(this)}>
|
||||||
{app.trans('core.forum.change_email_dismiss_button')}
|
{app.translator.trans('core.forum.change_email.dismiss_button')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -63,7 +63,7 @@ export default class ChangeEmailModal extends Modal {
|
||||||
className: 'Button Button--primary Button--block',
|
className: 'Button Button--primary Button--block',
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
loading: this.loading,
|
loading: this.loading,
|
||||||
children: app.trans('core.forum.change_email_submit_button')
|
children: app.translator.trans('core.forum.change_email.submit_button')
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,20 +11,20 @@ export default class ChangePasswordModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return app.trans('core.forum.change_password_title');
|
return app.translator.trans('core.forum.change_password.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
return (
|
return (
|
||||||
<div className="Modal-body">
|
<div className="Modal-body">
|
||||||
<div className="Form Form--centered">
|
<div className="Form Form--centered">
|
||||||
<p className="helpText">{app.trans('core.forum.change_password_text')}</p>
|
<p className="helpText">{app.translator.trans('core.forum.change_password.text')}</p>
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
{Button.component({
|
{Button.component({
|
||||||
className: 'Button Button--primary Button--block',
|
className: 'Button Button--primary Button--block',
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
loading: this.loading,
|
loading: this.loading,
|
||||||
children: app.trans('core.forum.change_password_send_button')
|
children: app.translator.trans('core.forum.change_password.send_button')
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -464,28 +464,28 @@ class Composer extends Component {
|
||||||
if (this.position === Composer.PositionEnum.FULLSCREEN) {
|
if (this.position === Composer.PositionEnum.FULLSCREEN) {
|
||||||
items.add('exitFullScreen', ComposerButton.component({
|
items.add('exitFullScreen', ComposerButton.component({
|
||||||
icon: 'compress',
|
icon: 'compress',
|
||||||
title: app.trans('core.forum.composer_exit_full_screen_tooltip'),
|
title: app.translator.trans('core.forum.composer.exit_full_screen_tooltip'),
|
||||||
onclick: this.exitFullScreen.bind(this)
|
onclick: this.exitFullScreen.bind(this)
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
if (this.position !== Composer.PositionEnum.MINIMIZED) {
|
if (this.position !== Composer.PositionEnum.MINIMIZED) {
|
||||||
items.add('minimize', ComposerButton.component({
|
items.add('minimize', ComposerButton.component({
|
||||||
icon: 'minus minimize',
|
icon: 'minus minimize',
|
||||||
title: app.trans('core.forum.composer_minimize_tooltip'),
|
title: app.translator.trans('core.forum.composer.minimize_tooltip'),
|
||||||
onclick: this.minimize.bind(this),
|
onclick: this.minimize.bind(this),
|
||||||
itemClassName: 'App-backControl'
|
itemClassName: 'App-backControl'
|
||||||
}));
|
}));
|
||||||
|
|
||||||
items.add('fullScreen', ComposerButton.component({
|
items.add('fullScreen', ComposerButton.component({
|
||||||
icon: 'expand',
|
icon: 'expand',
|
||||||
title: app.trans('core.forum.composer_full_screen_tooltip'),
|
title: app.translator.trans('core.forum.composer.full_screen_tooltip'),
|
||||||
onclick: this.fullScreen.bind(this)
|
onclick: this.fullScreen.bind(this)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add('close', ComposerButton.component({
|
items.add('close', ComposerButton.component({
|
||||||
icon: 'times',
|
icon: 'times',
|
||||||
title: app.trans('core.forum.composer_close_tooltip'),
|
title: app.translator.trans('core.forum.composer.close_tooltip'),
|
||||||
onclick: this.close.bind(this)
|
onclick: this.close.bind(this)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,10 +27,10 @@ export default class DiscussionComposer extends ComposerBody {
|
||||||
static initProps(props) {
|
static initProps(props) {
|
||||||
super.initProps(props);
|
super.initProps(props);
|
||||||
|
|
||||||
props.placeholder = props.placeholder || extractText(app.trans('core.forum.composer_discussion_body_placeholder'));
|
props.placeholder = props.placeholder || extractText(app.translator.trans('core.forum.composer_discussion.body_placeholder'));
|
||||||
props.submitLabel = props.submitLabel || app.trans('core.forum.composer_discussion_submit_button');
|
props.submitLabel = props.submitLabel || app.translator.trans('core.forum.composer_discussion.submit_button');
|
||||||
props.confirmExit = props.confirmExit || extractText(app.trans('core.forum.composer_discussion_discard_confirmation'));
|
props.confirmExit = props.confirmExit || extractText(app.translator.trans('core.forum.composer_discussion.discard_confirmation'));
|
||||||
props.titlePlaceholder = props.titlePlaceholder || extractText(app.trans('core.forum.composer_discussion_title_placeholder'));
|
props.titlePlaceholder = props.titlePlaceholder || extractText(app.translator.trans('core.forum.composer_discussion.title_placeholder'));
|
||||||
}
|
}
|
||||||
|
|
||||||
headerItems() {
|
headerItems() {
|
||||||
|
|
|
@ -46,14 +46,14 @@ export default class DiscussionList extends Component {
|
||||||
loading = LoadingIndicator.component();
|
loading = LoadingIndicator.component();
|
||||||
} else if (this.moreResults) {
|
} else if (this.moreResults) {
|
||||||
loading = Button.component({
|
loading = Button.component({
|
||||||
children: app.trans('core.forum.discussion_list_load_more_button'),
|
children: app.translator.trans('core.forum.discussion_list.load_more_button'),
|
||||||
className: 'Button',
|
className: 'Button',
|
||||||
onclick: this.loadMore.bind(this)
|
onclick: this.loadMore.bind(this)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.discussions.length === 0 && !this.loading) {
|
if (this.discussions.length === 0 && !this.loading) {
|
||||||
const text = app.trans('core.forum.discussion_list_empty_text');
|
const text = app.translator.trans('core.forum.discussion_list.empty_text');
|
||||||
return (
|
return (
|
||||||
<div className="DiscussionList">
|
<div className="DiscussionList">
|
||||||
{Placeholder.component({text})}
|
{Placeholder.component({text})}
|
||||||
|
|
|
@ -85,7 +85,7 @@ export default class DiscussionListItem extends Component {
|
||||||
<div className={'DiscussionListItem-content Slidable-content' + (isUnread ? ' unread' : '') + (isRead ? ' read' : '')}>
|
<div className={'DiscussionListItem-content Slidable-content' + (isUnread ? ' unread' : '') + (isRead ? ' read' : '')}>
|
||||||
<a href={startUser ? app.route.user(startUser) : '#'}
|
<a href={startUser ? app.route.user(startUser) : '#'}
|
||||||
className="DiscussionListItem-author"
|
className="DiscussionListItem-author"
|
||||||
title={extractText(app.trans('core.forum.discussion_list_started_text', {user: startUser, ago: humanTime(discussion.startTime())}))}
|
title={extractText(app.translator.trans('core.forum.discussion_list.started_text', {user: startUser, ago: humanTime(discussion.startTime())}))}
|
||||||
config={function(element) {
|
config={function(element) {
|
||||||
$(element).tooltip({placement: 'right'});
|
$(element).tooltip({placement: 'right'});
|
||||||
m.route.apply(this, arguments);
|
m.route.apply(this, arguments);
|
||||||
|
@ -106,7 +106,7 @@ export default class DiscussionListItem extends Component {
|
||||||
|
|
||||||
<span className="DiscussionListItem-count"
|
<span className="DiscussionListItem-count"
|
||||||
onclick={this.markAsRead.bind(this)}
|
onclick={this.markAsRead.bind(this)}
|
||||||
title={showUnread ? app.trans('core.forum.discussion_list_mark_as_read_tooltip') : ''}>
|
title={showUnread ? app.translator.trans('core.forum.discussion_list.mark_as_read_tooltip') : ''}>
|
||||||
{abbreviateNumber(discussion[showUnread ? 'unreadCount' : 'repliesCount']())}
|
{abbreviateNumber(discussion[showUnread ? 'unreadCount' : 'repliesCount']())}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,6 @@ export default class DiscussionRenamedNotification extends Notification {
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
return app.trans('core.forum.notifications_discussion_renamed_text', {user: this.props.notification.sender()});
|
return app.translator.trans('core.forum.notifications.discussion_renamed_text', {user: this.props.notification.sender()});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default class DiscussionRenamedPost extends EventPost {
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptionKey() {
|
descriptionKey() {
|
||||||
return 'core.forum.post_stream_discussion_renamed_text';
|
return 'core.forum.post_stream.discussion_renamed_text';
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptionData() {
|
descriptionData() {
|
||||||
|
|
|
@ -28,11 +28,11 @@ export default class DiscussionsSearchSource {
|
||||||
const results = this.results[query] || [];
|
const results = this.results[query] || [];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<li className="Dropdown-header">{app.trans('core.forum.search_discussions_heading')}</li>,
|
<li className="Dropdown-header">{app.translator.trans('core.forum.search.discussions_heading')}</li>,
|
||||||
<li>
|
<li>
|
||||||
{LinkButton.component({
|
{LinkButton.component({
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
children: app.trans('core.forum.search_all_discussions_button', {query}),
|
children: app.translator.trans('core.forum.search.all_discussions_button', {query}),
|
||||||
href: app.route('index', {q: query})
|
href: app.route('index', {q: query})
|
||||||
})}
|
})}
|
||||||
</li>,
|
</li>,
|
||||||
|
|
|
@ -23,8 +23,8 @@ export default class EditPostComposer extends ComposerBody {
|
||||||
static initProps(props) {
|
static initProps(props) {
|
||||||
super.initProps(props);
|
super.initProps(props);
|
||||||
|
|
||||||
props.submitLabel = props.submitLabel || app.trans('core.forum.composer_edit_submit_button');
|
props.submitLabel = props.submitLabel || app.translator.trans('core.forum.composer_edit.submit_button');
|
||||||
props.confirmExit = props.confirmExit || app.trans('core.forum.composer_edit_discard_confirmation');
|
props.confirmExit = props.confirmExit || app.translator.trans('core.forum.composer_edit.discard_confirmation');
|
||||||
props.originalContent = props.originalContent || props.post.content();
|
props.originalContent = props.originalContent || props.post.content();
|
||||||
props.user = props.user || props.post.user();
|
props.user = props.user || props.post.user();
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ export default class EditPostComposer extends ComposerBody {
|
||||||
<h3>
|
<h3>
|
||||||
{icon('pencil')} {' '}
|
{icon('pencil')} {' '}
|
||||||
<a href={app.route.discussion(post.discussion(), post.number())} config={m.route}>
|
<a href={app.route.discussion(post.discussion(), post.number())} config={m.route}>
|
||||||
{app.trans('core.forum.composer_edit_post_link', {number: post.number(), discussion: post.discussion().title()})}
|
{app.translator.trans('core.forum.composer_edit.post_link', {number: post.number(), discussion: post.discussion().title()})}
|
||||||
</a>
|
</a>
|
||||||
</h3>
|
</h3>
|
||||||
));
|
));
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default class EditUserModal extends Modal {
|
||||||
<div className="Form">
|
<div className="Form">
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<label>Username</label>
|
<label>Username</label>
|
||||||
<input className="FormControl" placeholder={extractText(app.trans('core.forum.edit_user_username_label'))}
|
<input className="FormControl" placeholder={extractText(app.translator.trans('core.forum.edit_user.username_label'))}
|
||||||
value={this.username()}
|
value={this.username()}
|
||||||
onchange={m.withAttr('value', this.username)} />
|
onchange={m.withAttr('value', this.username)} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,7 +46,7 @@ export default class EditUserModal extends Modal {
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<label>Email</label>
|
<label>Email</label>
|
||||||
<div>
|
<div>
|
||||||
<input className="FormControl" placeholder={extractText(app.trans('core.forum.edit_user_email_label'))}
|
<input className="FormControl" placeholder={extractText(app.translator.trans('core.forum.edit_user.email_label'))}
|
||||||
value={this.email()}
|
value={this.email()}
|
||||||
onchange={m.withAttr('value', this.email)} />
|
onchange={m.withAttr('value', this.email)} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -65,7 +65,7 @@ export default class EditUserModal extends Modal {
|
||||||
Set new password
|
Set new password
|
||||||
</label>
|
</label>
|
||||||
{this.setPassword() ? (
|
{this.setPassword() ? (
|
||||||
<input className="FormControl" type="password" name="password" placeholder={extractText(app.trans('core.forum.edit_user_password_label'))}
|
<input className="FormControl" type="password" name="password" placeholder={extractText(app.translator.trans('core.forum.edit_user.password_label'))}
|
||||||
value={this.password()}
|
value={this.password()}
|
||||||
onchange={m.withAttr('value', this.password)} />
|
onchange={m.withAttr('value', this.password)} />
|
||||||
) : ''}
|
) : ''}
|
||||||
|
@ -94,7 +94,7 @@ export default class EditUserModal extends Modal {
|
||||||
className: 'Button Button--primary',
|
className: 'Button Button--primary',
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
loading: this.loading,
|
loading: this.loading,
|
||||||
children: app.trans('core.forum.edit_user_submit_button')
|
children: app.translator.trans('core.forum.edit_user.submit_button')
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -35,7 +35,7 @@ export default class ForgotPasswordModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return app.trans('core.forum.forgot_password_title');
|
return app.translator.trans('core.forum.forgot_password.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
@ -43,10 +43,10 @@ export default class ForgotPasswordModal extends Modal {
|
||||||
return (
|
return (
|
||||||
<div className="Modal-body">
|
<div className="Modal-body">
|
||||||
<div className="Form Form--centered">
|
<div className="Form Form--centered">
|
||||||
<p className="helpText">{app.trans('core.forum.forgot_password_email_sent_message')}</p>
|
<p className="helpText">{app.translator.trans('core.forum.forgot_password.email_sent_message')}</p>
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<Button className="Button Button--primary Button--block" onclick={this.hide.bind(this)}>
|
<Button className="Button Button--primary Button--block" onclick={this.hide.bind(this)}>
|
||||||
{app.trans('core.forum.forgot_password_dismiss_button')}
|
{app.translator.trans('core.forum.forgot_password.dismiss_button')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -57,9 +57,9 @@ export default class ForgotPasswordModal extends Modal {
|
||||||
return (
|
return (
|
||||||
<div className="Modal-body">
|
<div className="Modal-body">
|
||||||
<div className="Form Form--centered">
|
<div className="Form Form--centered">
|
||||||
<p className="helpText">{app.trans('core.forum.forgot_password_text')}</p>
|
<p className="helpText">{app.translator.trans('core.forum.forgot_password.text')}</p>
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="email" type="email" placeholder={extractText(app.trans('core.forum.forgot_password_email_placeholder'))}
|
<input className="FormControl" name="email" type="email" placeholder={extractText(app.translator.trans('core.forum.forgot_password.email_placeholder'))}
|
||||||
value={this.email()}
|
value={this.email()}
|
||||||
onchange={m.withAttr('value', this.email)}
|
onchange={m.withAttr('value', this.email)}
|
||||||
disabled={this.loading} />
|
disabled={this.loading} />
|
||||||
|
@ -69,7 +69,7 @@ export default class ForgotPasswordModal extends Modal {
|
||||||
className: 'Button Button--primary Button--block',
|
className: 'Button Button--primary Button--block',
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
loading: this.loading,
|
loading: this.loading,
|
||||||
children: app.trans('core.forum.forgot_password_submit_button')
|
children: app.translator.trans('core.forum.forgot_password.submit_button')
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default class HeaderSecondary extends Component {
|
||||||
if (app.forum.attribute('allowSignUp')) {
|
if (app.forum.attribute('allowSignUp')) {
|
||||||
items.add('signUp',
|
items.add('signUp',
|
||||||
Button.component({
|
Button.component({
|
||||||
children: app.trans('core.forum.header_sign_up_link'),
|
children: app.translator.trans('core.forum.header.sign_up_link'),
|
||||||
className: 'Button Button--link',
|
className: 'Button Button--link',
|
||||||
onclick: () => app.modal.show(new SignUpModal())
|
onclick: () => app.modal.show(new SignUpModal())
|
||||||
}), 10
|
}), 10
|
||||||
|
@ -73,7 +73,7 @@ export default class HeaderSecondary extends Component {
|
||||||
|
|
||||||
items.add('logIn',
|
items.add('logIn',
|
||||||
Button.component({
|
Button.component({
|
||||||
children: app.trans('core.forum.header_log_in_link'),
|
children: app.translator.trans('core.forum.header.log_in_link'),
|
||||||
className: 'Button Button--link',
|
className: 'Button Button--link',
|
||||||
onclick: () => app.modal.show(new LogInModal())
|
onclick: () => app.modal.show(new LogInModal())
|
||||||
}), 0
|
}), 0
|
||||||
|
|
|
@ -147,7 +147,7 @@ export default class IndexPage extends Page {
|
||||||
|
|
||||||
items.add('newDiscussion',
|
items.add('newDiscussion',
|
||||||
Button.component({
|
Button.component({
|
||||||
children: app.trans(canStartDiscussion ? 'core.forum.index_start_discussion_button' : 'core.forum.index_cannot_start_discussion_button'),
|
children: app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button'),
|
||||||
icon: 'edit',
|
icon: 'edit',
|
||||||
className: 'Button Button--primary IndexPage-newDiscussion',
|
className: 'Button Button--primary IndexPage-newDiscussion',
|
||||||
itemClassName: 'App-primaryControl',
|
itemClassName: 'App-primaryControl',
|
||||||
|
@ -180,7 +180,7 @@ export default class IndexPage extends Page {
|
||||||
items.add('allDiscussions',
|
items.add('allDiscussions',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
href: app.route('index', params),
|
href: app.route('index', params),
|
||||||
children: app.trans('core.forum.index_all_discussions_link'),
|
children: app.translator.trans('core.forum.index.all_discussions_link'),
|
||||||
icon: 'comments-o'
|
icon: 'comments-o'
|
||||||
}),
|
}),
|
||||||
100
|
100
|
||||||
|
@ -201,7 +201,7 @@ export default class IndexPage extends Page {
|
||||||
|
|
||||||
const sortOptions = {};
|
const sortOptions = {};
|
||||||
for (const i in app.cache.discussionList.sortMap()) {
|
for (const i in app.cache.discussionList.sortMap()) {
|
||||||
sortOptions[i] = app.trans('core.forum.index_sort_' + i + '_button');
|
sortOptions[i] = app.translator.trans('core.forum.index.sort_' + i + '_button');
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add('sort',
|
items.add('sort',
|
||||||
|
@ -226,7 +226,7 @@ export default class IndexPage extends Page {
|
||||||
|
|
||||||
items.add('refresh',
|
items.add('refresh',
|
||||||
Button.component({
|
Button.component({
|
||||||
title: app.trans('core.forum.index_refresh_tooltip'),
|
title: app.translator.trans('core.forum.index.refresh_tooltip'),
|
||||||
icon: 'refresh',
|
icon: 'refresh',
|
||||||
className: 'Button Button--icon',
|
className: 'Button Button--icon',
|
||||||
onclick: () => app.cache.discussionList.refresh()
|
onclick: () => app.cache.discussionList.refresh()
|
||||||
|
@ -236,7 +236,7 @@ export default class IndexPage extends Page {
|
||||||
if (app.session.user) {
|
if (app.session.user) {
|
||||||
items.add('markAllAsRead',
|
items.add('markAllAsRead',
|
||||||
Button.component({
|
Button.component({
|
||||||
title: app.trans('core.forum.index_mark_all_as_read_tooltip'),
|
title: app.translator.trans('core.forum.index.mark_all_as_read_tooltip'),
|
||||||
icon: 'check',
|
icon: 'check',
|
||||||
className: 'Button Button--icon',
|
className: 'Button Button--icon',
|
||||||
onclick: this.markAllAsRead.bind(this)
|
onclick: this.markAllAsRead.bind(this)
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default class LogInModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return app.trans('core.forum.log_in_title');
|
return app.translator.trans('core.forum.log_in.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
@ -48,14 +48,14 @@ export default class LogInModal extends Modal {
|
||||||
|
|
||||||
<div className="Form Form--centered">
|
<div className="Form Form--centered">
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="email" placeholder={extractText(app.trans('core.forum.log_in_username_or_email_placeholder'))}
|
<input className="FormControl" name="email" placeholder={extractText(app.translator.trans('core.forum.log_in.username_or_email_placeholder'))}
|
||||||
value={this.email()}
|
value={this.email()}
|
||||||
onchange={m.withAttr('value', this.email)}
|
onchange={m.withAttr('value', this.email)}
|
||||||
disabled={this.loading} />
|
disabled={this.loading} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="password" type="password" placeholder={extractText(app.trans('core.forum.log_in_password_placeholder'))}
|
<input className="FormControl" name="password" type="password" placeholder={extractText(app.translator.trans('core.forum.log_in.password_placeholder'))}
|
||||||
value={this.password()}
|
value={this.password()}
|
||||||
onchange={m.withAttr('value', this.password)}
|
onchange={m.withAttr('value', this.password)}
|
||||||
disabled={this.loading} />
|
disabled={this.loading} />
|
||||||
|
@ -66,19 +66,19 @@ export default class LogInModal extends Modal {
|
||||||
className: 'Button Button--primary Button--block',
|
className: 'Button Button--primary Button--block',
|
||||||
type: 'submit',
|
type: 'submit',
|
||||||
loading: this.loading,
|
loading: this.loading,
|
||||||
children: app.trans('core.forum.log_in_submit_button')
|
children: app.translator.trans('core.forum.log_in.submit_button')
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
<div className="Modal-footer">
|
<div className="Modal-footer">
|
||||||
<p className="LogInModal-forgotPassword">
|
<p className="LogInModal-forgotPassword">
|
||||||
<a onclick={this.forgotPassword.bind(this)}>{app.trans('core.forum.log_in_forgot_password_link')}</a>
|
<a onclick={this.forgotPassword.bind(this)}>{app.translator.trans('core.forum.log_in.forgot_password_link')}</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{app.forum.attribute('allowSignUp') ? (
|
{app.forum.attribute('allowSignUp') ? (
|
||||||
<p className="LogInModal-signUp">
|
<p className="LogInModal-signUp">
|
||||||
{app.trans('core.forum.log_in_sign_up_text', {a: <a onclick={this.signUp.bind(this)}/>})}
|
{app.translator.trans('core.forum.log_in.sign_up_text', {a: <a onclick={this.signUp.bind(this)}/>})}
|
||||||
</p>
|
</p>
|
||||||
) : ''}
|
) : ''}
|
||||||
</div>
|
</div>
|
||||||
|
@ -131,10 +131,10 @@ export default class LogInModal extends Modal {
|
||||||
onerror(error) {
|
onerror(error) {
|
||||||
if (error.status === 401) {
|
if (error.status === 401) {
|
||||||
if (error.response.emailConfirmationRequired) {
|
if (error.response.emailConfirmationRequired) {
|
||||||
error.alert.props.children = app.trans('core.forum.log_in_confirmation_required_message', {email: error.response.emailConfirmationRequired});
|
error.alert.props.children = app.translator.trans('core.forum.log_in_confirmation_required_message', {email: error.response.emailConfirmationRequired});
|
||||||
delete error.alert.props.type;
|
delete error.alert.props.type;
|
||||||
} else {
|
} else {
|
||||||
error.alert.props.children = app.trans('core.forum.log_in_invalid_login_message');
|
error.alert.props.children = app.translator.trans('core.forum.log_in_invalid_login_message');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ export default class NotificationGrid extends Component {
|
||||||
* @type {Array}
|
* @type {Array}
|
||||||
*/
|
*/
|
||||||
this.methods = [
|
this.methods = [
|
||||||
{name: 'alert', icon: 'bell', label: app.trans('core.forum.settings_notify_by_web_heading')},
|
{name: 'alert', icon: 'bell', label: app.translator.trans('core.forum.settings.notify_by_web_heading')},
|
||||||
{name: 'email', icon: 'envelope-o', label: app.trans('core.forum.settings_notify_by_email_heading')}
|
{name: 'email', icon: 'envelope-o', label: app.translator.trans('core.forum.settings.notify_by_email_heading')}
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,7 +180,7 @@ export default class NotificationGrid extends Component {
|
||||||
items.add('discussionRenamed', {
|
items.add('discussionRenamed', {
|
||||||
name: 'discussionRenamed',
|
name: 'discussionRenamed',
|
||||||
icon: 'pencil',
|
icon: 'pencil',
|
||||||
label: app.trans('core.forum.settings_notify_discussion_renamed_label')
|
label: app.translator.trans('core.forum.settings.notify_discussion_renamed_label')
|
||||||
});
|
});
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|
|
@ -57,12 +57,12 @@ export default class NotificationList extends Component {
|
||||||
{Button.component({
|
{Button.component({
|
||||||
className: 'Button Button--icon Button--link',
|
className: 'Button Button--icon Button--link',
|
||||||
icon: 'check',
|
icon: 'check',
|
||||||
title: app.trans('core.forum.notifications_mark_all_as_read_tooltip'),
|
title: app.translator.trans('core.forum.notifications.mark_all_as_read_tooltip'),
|
||||||
onclick: this.markAllAsRead.bind(this)
|
onclick: this.markAllAsRead.bind(this)
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4 className="App-titleControl App-titleControl--text">{app.trans('core.forum.notifications_title')}</h4>
|
<h4 className="App-titleControl App-titleControl--text">{app.translator.trans('core.forum.notifications.title')}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="NotificationList-content">
|
<div className="NotificationList-content">
|
||||||
|
@ -96,7 +96,7 @@ export default class NotificationList extends Component {
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
: !this.loading
|
: !this.loading
|
||||||
? <div className="NotificationList-empty">{app.trans('core.forum.notifications_empty_text')}</div>
|
? <div className="NotificationList-empty">{app.translator.trans('core.forum.notifications.empty_text')}</div>
|
||||||
: LoadingIndicator.component({className: 'LoadingIndicator--block'})}
|
: LoadingIndicator.component({className: 'LoadingIndicator--block'})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@ export default class NotificationsDropdown extends Dropdown {
|
||||||
props.className = props.className || 'NotificationsDropdown';
|
props.className = props.className || 'NotificationsDropdown';
|
||||||
props.buttonClassName = props.buttonClassName || 'Button Button--flat';
|
props.buttonClassName = props.buttonClassName || 'Button Button--flat';
|
||||||
props.menuClassName = props.menuClassName || 'Dropdown-menu--right';
|
props.menuClassName = props.menuClassName || 'Dropdown-menu--right';
|
||||||
props.label = props.label || app.trans('core.forum.notifications_tooltip');
|
props.label = props.label || app.translator.trans('core.forum.notifications.tooltip');
|
||||||
props.icon = props.icon || 'bell';
|
props.icon = props.icon || 'bell';
|
||||||
|
|
||||||
super.initProps(props);
|
super.initProps(props);
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default class PostEdited extends Component {
|
||||||
view() {
|
view() {
|
||||||
const post = this.props.post;
|
const post = this.props.post;
|
||||||
const editUser = post.editUser();
|
const editUser = post.editUser();
|
||||||
const title = extractText(app.trans('core.forum.post_edited_tooltip', {user: editUser, ago: humanTime(post.editTime())}));
|
const title = extractText(app.translator.trans('core.forum.post.edited_tooltip', {user: editUser, ago: humanTime(post.editTime())}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="PostEdited" title={title}>{icon('pencil')}</span>
|
<span className="PostEdited" title={title}>{icon('pencil')}</span>
|
||||||
|
|
|
@ -33,7 +33,7 @@ export default class PostMeta extends Component {
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div className="Dropdown-menu dropdown-menu">
|
<div className="Dropdown-menu dropdown-menu">
|
||||||
<span className="PostMeta-number">{app.trans('core.forum.post_number_tooltip', {number: post.number()})}</span>{' '}
|
<span className="PostMeta-number">{app.translator.trans('core.forum.post.number_tooltip', {number: post.number()})}</span>{' '}
|
||||||
{fullTime(time)}
|
{fullTime(time)}
|
||||||
{touch
|
{touch
|
||||||
? <a className="Button PostMeta-permalink" href={permalink}>{permalink}</a>
|
? <a className="Button PostMeta-permalink" href={permalink}>{permalink}</a>
|
||||||
|
|
|
@ -221,7 +221,7 @@ class PostStream extends Component {
|
||||||
if (dt > 1000 * 60 * 60 * 24 * 4) {
|
if (dt > 1000 * 60 * 60 * 24 * 4) {
|
||||||
content = [
|
content = [
|
||||||
<div className="PostStream-timeGap">
|
<div className="PostStream-timeGap">
|
||||||
<span>{app.trans('core.forum.post_stream_time_lapsed_text', {period: moment.duration(dt).humanize()})}</span>
|
<span>{app.translator.trans('core.forum.post_stream.time_lapsed_text', {period: moment.duration(dt).humanize()})}</span>
|
||||||
</div>,
|
</div>,
|
||||||
content
|
content
|
||||||
];
|
];
|
||||||
|
|
|
@ -70,7 +70,7 @@ export default class PostStreamScrubber extends Component {
|
||||||
const unreadCount = this.props.stream.discussion.unreadCount();
|
const unreadCount = this.props.stream.discussion.unreadCount();
|
||||||
const unreadPercent = Math.min(count - this.index, unreadCount) / count;
|
const unreadPercent = Math.min(count - this.index, unreadCount) / count;
|
||||||
|
|
||||||
const viewing = app.translator.transChoice('core.forum.post_scrubber_viewing_text', count, {
|
const viewing = app.translator.transChoice('core.forum.post_scrubber.viewing_text', count, {
|
||||||
index: <span className="Scrubber-index">{retain || formatNumber(this.visibleIndex())}</span>,
|
index: <span className="Scrubber-index">{retain || formatNumber(this.visibleIndex())}</span>,
|
||||||
count: <span className="Scrubber-count">{formatNumber(count)}</span>
|
count: <span className="Scrubber-count">{formatNumber(count)}</span>
|
||||||
});
|
});
|
||||||
|
@ -100,7 +100,7 @@ export default class PostStreamScrubber extends Component {
|
||||||
<div className="Dropdown-menu dropdown-menu">
|
<div className="Dropdown-menu dropdown-menu">
|
||||||
<div className="Scrubber">
|
<div className="Scrubber">
|
||||||
<a className="Scrubber-first" onclick={this.goToFirst.bind(this)}>
|
<a className="Scrubber-first" onclick={this.goToFirst.bind(this)}>
|
||||||
{icon('angle-double-up')} {app.trans('core.forum.post_scrubber_original_post_link')}
|
{icon('angle-double-up')} {app.translator.trans('core.forum.post_scrubber.original_post_link')}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div className="Scrubber-scrollbar">
|
<div className="Scrubber-scrollbar">
|
||||||
|
@ -115,12 +115,12 @@ export default class PostStreamScrubber extends Component {
|
||||||
<div className="Scrubber-after"/>
|
<div className="Scrubber-after"/>
|
||||||
|
|
||||||
<div className="Scrubber-unread" config={styleUnread}>
|
<div className="Scrubber-unread" config={styleUnread}>
|
||||||
{app.trans('core.forum.post_scrubber_unread_text', {count: unreadCount})}
|
{app.translator.trans('core.forum.post_scrubber.unread_text', {count: unreadCount})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a className="Scrubber-last" onclick={this.goToLast.bind(this)}>
|
<a className="Scrubber-last" onclick={this.goToLast.bind(this)}>
|
||||||
{icon('angle-double-down')} {app.trans('core.forum.post_scrubber_now_link')}
|
{icon('angle-double-down')} {app.translator.trans('core.forum.post_scrubber.now_link')}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default class PostsUserPage extends UserPage {
|
||||||
footer = (
|
footer = (
|
||||||
<div className="PostsUserPage-loadMore">
|
<div className="PostsUserPage-loadMore">
|
||||||
{Button.component({
|
{Button.component({
|
||||||
children: app.trans('core.forum.user_posts_load_more_button'),
|
children: app.translator.trans('core.forum.user.posts_load_more_button'),
|
||||||
className: 'Button',
|
className: 'Button',
|
||||||
onclick: this.loadMore.bind(this)
|
onclick: this.loadMore.bind(this)
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -25,9 +25,9 @@ export default class ReplyComposer extends ComposerBody {
|
||||||
static initProps(props) {
|
static initProps(props) {
|
||||||
super.initProps(props);
|
super.initProps(props);
|
||||||
|
|
||||||
props.placeholder = props.placeholder || extractText(app.trans('core.forum.composer_reply_body_placeholder'));
|
props.placeholder = props.placeholder || extractText(app.translator.trans('core.forum.composer_reply.body_placeholder'));
|
||||||
props.submitLabel = props.submitLabel || app.trans('core.forum.composer_reply_submit_button');
|
props.submitLabel = props.submitLabel || app.translator.trans('core.forum.composer_reply.submit_button');
|
||||||
props.confirmExit = props.confirmExit || extractText(app.trans('core.forum.composer_reply_discard_confirmation'));
|
props.confirmExit = props.confirmExit || extractText(app.translator.trans('core.forum.composer_reply.discard_confirmation'));
|
||||||
}
|
}
|
||||||
|
|
||||||
headerItems() {
|
headerItems() {
|
||||||
|
@ -77,7 +77,7 @@ export default class ReplyComposer extends ComposerBody {
|
||||||
let alert;
|
let alert;
|
||||||
const viewButton = Button.component({
|
const viewButton = Button.component({
|
||||||
className: 'Button Button--link',
|
className: 'Button Button--link',
|
||||||
children: app.trans('core.forum.composer_reply_view_button'),
|
children: app.translator.trans('core.forum.composer_reply.view_button'),
|
||||||
onclick: () => {
|
onclick: () => {
|
||||||
m.route(app.route.post(post));
|
m.route(app.route.post(post));
|
||||||
app.alerts.dismiss(alert);
|
app.alerts.dismiss(alert);
|
||||||
|
@ -86,7 +86,7 @@ export default class ReplyComposer extends ComposerBody {
|
||||||
app.alerts.show(
|
app.alerts.show(
|
||||||
alert = new Alert({
|
alert = new Alert({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: app.trans('core.forum.composer_reply_posted_message'),
|
message: app.translator.trans('core.forum.composer_reply.posted_message'),
|
||||||
controls: [viewButton]
|
controls: [viewButton]
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -44,7 +44,7 @@ export default class ReplyPlaceholder extends Component {
|
||||||
<article className="Post ReplyPlaceholder" onclick={reply} onmousedown={triggerClick}>
|
<article className="Post ReplyPlaceholder" onclick={reply} onmousedown={triggerClick}>
|
||||||
<header className="Post-header">
|
<header className="Post-header">
|
||||||
{avatar(app.session.user, {className: 'PostUser-avatar'})}{' '}
|
{avatar(app.session.user, {className: 'PostUser-avatar'})}{' '}
|
||||||
{app.trans('core.forum.post_stream_reply_placeholder')}
|
{app.translator.trans('core.forum.post_stream.reply_placeholder')}
|
||||||
</header>
|
</header>
|
||||||
</article>
|
</article>
|
||||||
);
|
);
|
||||||
|
|
|
@ -82,7 +82,7 @@ export default class Search extends Component {
|
||||||
})}>
|
})}>
|
||||||
<div className="Search-input">
|
<div className="Search-input">
|
||||||
<input className="FormControl"
|
<input className="FormControl"
|
||||||
placeholder={extractText(app.trans('core.forum.header_search_placeholder'))}
|
placeholder={extractText(app.translator.trans('core.forum.header.search_placeholder'))}
|
||||||
value={this.value()}
|
value={this.value()}
|
||||||
oninput={m.withAttr('value', this.value)}
|
oninput={m.withAttr('value', this.value)}
|
||||||
onfocus={() => this.hasFocus = true}
|
onfocus={() => this.hasFocus = true}
|
||||||
|
|
|
@ -47,7 +47,7 @@ export default class SessionDropdown extends Dropdown {
|
||||||
items.add('profile',
|
items.add('profile',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
icon: 'user',
|
icon: 'user',
|
||||||
children: app.trans('core.forum.header_profile_button'),
|
children: app.translator.trans('core.forum.header.profile_button'),
|
||||||
href: app.route.user(user)
|
href: app.route.user(user)
|
||||||
}),
|
}),
|
||||||
100
|
100
|
||||||
|
@ -56,7 +56,7 @@ export default class SessionDropdown extends Dropdown {
|
||||||
items.add('settings',
|
items.add('settings',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
icon: 'cog',
|
icon: 'cog',
|
||||||
children: app.trans('core.forum.header_settings_button'),
|
children: app.translator.trans('core.forum.header.settings_button'),
|
||||||
href: app.route('settings')
|
href: app.route('settings')
|
||||||
}),
|
}),
|
||||||
50
|
50
|
||||||
|
@ -66,7 +66,7 @@ export default class SessionDropdown extends Dropdown {
|
||||||
items.add('administration',
|
items.add('administration',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
icon: 'wrench',
|
icon: 'wrench',
|
||||||
children: app.trans('core.forum.header_admin_button'),
|
children: app.translator.trans('core.forum.header.admin_button'),
|
||||||
href: app.forum.attribute('baseUrl') + '/admin',
|
href: app.forum.attribute('baseUrl') + '/admin',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
config: () => {}
|
config: () => {}
|
||||||
|
@ -80,7 +80,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.forum.header_log_out_button'),
|
children: app.translator.trans('core.forum.header.log_out_button'),
|
||||||
onclick: app.session.logout.bind(app.session)
|
onclick: app.session.logout.bind(app.session)
|
||||||
}),
|
}),
|
||||||
-100
|
-100
|
||||||
|
|
|
@ -17,7 +17,7 @@ export default class SettingsPage extends UserPage {
|
||||||
super.init();
|
super.init();
|
||||||
|
|
||||||
this.show(app.session.user);
|
this.show(app.session.user);
|
||||||
app.setTitle(app.trans('core.forum.settings_title'));
|
app.setTitle(app.translator.trans('core.forum.settings.title'));
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
@ -38,7 +38,7 @@ export default class SettingsPage extends UserPage {
|
||||||
|
|
||||||
items.add('account',
|
items.add('account',
|
||||||
FieldSet.component({
|
FieldSet.component({
|
||||||
label: app.trans('core.forum.settings_account_heading'),
|
label: app.translator.trans('core.forum.settings.account_heading'),
|
||||||
className: 'Settings-account',
|
className: 'Settings-account',
|
||||||
children: this.accountItems().toArray()
|
children: this.accountItems().toArray()
|
||||||
})
|
})
|
||||||
|
@ -46,7 +46,7 @@ export default class SettingsPage extends UserPage {
|
||||||
|
|
||||||
items.add('notifications',
|
items.add('notifications',
|
||||||
FieldSet.component({
|
FieldSet.component({
|
||||||
label: app.trans('core.forum.settings_notifications_heading'),
|
label: app.translator.trans('core.forum.settings.notifications_heading'),
|
||||||
className: 'Settings-notifications',
|
className: 'Settings-notifications',
|
||||||
children: [NotificationGrid.component({user: this.user})]
|
children: [NotificationGrid.component({user: this.user})]
|
||||||
})
|
})
|
||||||
|
@ -54,7 +54,7 @@ export default class SettingsPage extends UserPage {
|
||||||
|
|
||||||
items.add('privacy',
|
items.add('privacy',
|
||||||
FieldSet.component({
|
FieldSet.component({
|
||||||
label: app.trans('core.forum.settings_privacy_heading'),
|
label: app.translator.trans('core.forum.settings.privacy_heading'),
|
||||||
className: 'Settings-privacy',
|
className: 'Settings-privacy',
|
||||||
children: this.privacyItems().toArray()
|
children: this.privacyItems().toArray()
|
||||||
})
|
})
|
||||||
|
@ -73,7 +73,7 @@ export default class SettingsPage extends UserPage {
|
||||||
|
|
||||||
items.add('changePassword',
|
items.add('changePassword',
|
||||||
Button.component({
|
Button.component({
|
||||||
children: app.trans('core.forum.settings_change_password_button'),
|
children: app.translator.trans('core.forum.settings.change_password_button'),
|
||||||
className: 'Button',
|
className: 'Button',
|
||||||
onclick: () => app.modal.show(new ChangePasswordModal())
|
onclick: () => app.modal.show(new ChangePasswordModal())
|
||||||
})
|
})
|
||||||
|
@ -81,7 +81,7 @@ export default class SettingsPage extends UserPage {
|
||||||
|
|
||||||
items.add('changeEmail',
|
items.add('changeEmail',
|
||||||
Button.component({
|
Button.component({
|
||||||
children: app.trans('core.forum.settings_change_email_button'),
|
children: app.translator.trans('core.forum.settings.change_email_button'),
|
||||||
className: 'Button',
|
className: 'Button',
|
||||||
onclick: () => app.modal.show(new ChangeEmailModal())
|
onclick: () => app.modal.show(new ChangeEmailModal())
|
||||||
})
|
})
|
||||||
|
@ -118,7 +118,7 @@ export default class SettingsPage extends UserPage {
|
||||||
|
|
||||||
items.add('discloseOnline',
|
items.add('discloseOnline',
|
||||||
Switch.component({
|
Switch.component({
|
||||||
children: app.trans('core.forum.settings_privacy_disclose_online_label'),
|
children: app.translator.trans('core.forum.settings.privacy_disclose_online_label'),
|
||||||
state: this.user.preferences().discloseOnline,
|
state: this.user.preferences().discloseOnline,
|
||||||
onchange: (value, component) => {
|
onchange: (value, component) => {
|
||||||
this.user.pushAttributes({lastSeenTime: null});
|
this.user.pushAttributes({lastSeenTime: null});
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default class SignUpModal extends Modal {
|
||||||
}
|
}
|
||||||
|
|
||||||
title() {
|
title() {
|
||||||
return app.trans('core.forum.sign_up_title');
|
return app.translator.trans('core.forum.sign_up.title');
|
||||||
}
|
}
|
||||||
|
|
||||||
content() {
|
content() {
|
||||||
|
@ -73,14 +73,14 @@ export default class SignUpModal extends Modal {
|
||||||
|
|
||||||
<div className="Form Form--centered">
|
<div className="Form Form--centered">
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="username" placeholder={extractText(app.trans('core.forum.sign_up_username_placeholder'))}
|
<input className="FormControl" name="username" placeholder={extractText(app.translator.trans('core.forum.sign_up.username_placeholder'))}
|
||||||
value={this.username()}
|
value={this.username()}
|
||||||
onchange={m.withAttr('value', this.username)}
|
onchange={m.withAttr('value', this.username)}
|
||||||
disabled={this.loading} />
|
disabled={this.loading} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="email" type="email" placeholder={extractText(app.trans('core.forum.sign_up_email_placeholder'))}
|
<input className="FormControl" name="email" type="email" placeholder={extractText(app.translator.trans('core.forum.sign_up.email_placeholder'))}
|
||||||
value={this.email()}
|
value={this.email()}
|
||||||
onchange={m.withAttr('value', this.email)}
|
onchange={m.withAttr('value', this.email)}
|
||||||
disabled={this.loading || (this.props.token && this.props.email)} />
|
disabled={this.loading || (this.props.token && this.props.email)} />
|
||||||
|
@ -88,7 +88,7 @@ export default class SignUpModal extends Modal {
|
||||||
|
|
||||||
{this.props.token ? '' : (
|
{this.props.token ? '' : (
|
||||||
<div className="Form-group">
|
<div className="Form-group">
|
||||||
<input className="FormControl" name="password" type="password" placeholder={extractText(app.trans('core.forum.sign_up_password_placeholder'))}
|
<input className="FormControl" name="password" type="password" placeholder={extractText(app.translator.trans('core.forum.sign_up.password_placeholder'))}
|
||||||
value={this.password()}
|
value={this.password()}
|
||||||
onchange={m.withAttr('value', this.password)}
|
onchange={m.withAttr('value', this.password)}
|
||||||
disabled={this.loading} />
|
disabled={this.loading} />
|
||||||
|
@ -100,7 +100,7 @@ export default class SignUpModal extends Modal {
|
||||||
className="Button Button--primary Button--block"
|
className="Button Button--primary Button--block"
|
||||||
type="submit"
|
type="submit"
|
||||||
loading={this.loading}>
|
loading={this.loading}>
|
||||||
{app.trans('core.forum.sign_up_submit_button')}
|
{app.translator.trans('core.forum.sign_up.submit_button')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -119,13 +119,13 @@ export default class SignUpModal extends Modal {
|
||||||
<div className="darkenBackground">
|
<div className="darkenBackground">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
{avatar(user)}
|
{avatar(user)}
|
||||||
<h3>{app.trans('core.forum.sign_up_welcome_text', {user})}</h3>
|
<h3>{app.translator.trans('core.forum.sign_up.welcome_text', {user})}</h3>
|
||||||
|
|
||||||
<p>{app.trans('core.forum.sign_up_confirmation_message', {email: <strong>{user.email()}</strong>})}</p>
|
<p>{app.translator.trans('core.forum.sign_up.confirmation_message', {email: <strong>{user.email()}</strong>})}</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<Button className="Button Button--primary" onclick={this.hide.bind(this)}>
|
<Button className="Button Button--primary" onclick={this.hide.bind(this)}>
|
||||||
{app.trans('core.forum.sign_up_dismiss_button')}
|
{app.translator.trans('core.forum.sign_up.dismiss_button')}
|
||||||
</Button>
|
</Button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -140,7 +140,7 @@ export default class SignUpModal extends Modal {
|
||||||
footer() {
|
footer() {
|
||||||
return [
|
return [
|
||||||
<p className="SignUpModal-logIn">
|
<p className="SignUpModal-logIn">
|
||||||
{app.trans('core.forum.sign_up_log_in_text', {a: <a onclick={this.logIn.bind(this)}/>})}
|
{app.translator.trans('core.forum.sign_up.log_in_text', {a: <a onclick={this.logIn.bind(this)}/>})}
|
||||||
</p>
|
</p>
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default class TerminalPost extends Component {
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{lastPost ? icon('reply') : ''}{' '}
|
{lastPost ? icon('reply') : ''}{' '}
|
||||||
{app.trans('core.forum.discussion_list_' + (lastPost ? 'replied' : 'started') + '_text', {
|
{app.translator.trans('core.forum.discussion_list.' + (lastPost ? 'replied' : 'started') + '_text', {
|
||||||
user,
|
user,
|
||||||
ago: humanTime(time)
|
ago: humanTime(time)
|
||||||
})}
|
})}
|
||||||
|
|
|
@ -29,7 +29,7 @@ export default class UserBio extends Component {
|
||||||
let content;
|
let content;
|
||||||
|
|
||||||
if (this.editing) {
|
if (this.editing) {
|
||||||
content = <textarea className="FormControl" placeholder={extractText(app.trans('core.forum.user_bio_placeholder'))} rows="3" value={user.bio()}/>;
|
content = <textarea className="FormControl" placeholder={extractText(app.translator.trans('core.forum.user.bio_placeholder'))} rows="3" value={user.bio()}/>;
|
||||||
} else {
|
} else {
|
||||||
let subContent;
|
let subContent;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ export default class UserBio extends Component {
|
||||||
if (bioHtml) {
|
if (bioHtml) {
|
||||||
subContent = m.trust(bioHtml);
|
subContent = m.trust(bioHtml);
|
||||||
} else if (this.props.editable) {
|
} else if (this.props.editable) {
|
||||||
subContent = <p className="UserBio-placeholder">{app.trans('core.forum.user_bio_placeholder')}</p>;
|
subContent = <p className="UserBio-placeholder">{app.translator.trans('core.forum.user.bio_placeholder')}</p>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default class UserCard extends Component {
|
||||||
className: 'UserCard-controls App-primaryControl',
|
className: 'UserCard-controls App-primaryControl',
|
||||||
menuClassName: 'Dropdown-menu--right',
|
menuClassName: 'Dropdown-menu--right',
|
||||||
buttonClassName: this.props.controlsButtonClassName,
|
buttonClassName: this.props.controlsButtonClassName,
|
||||||
label: app.trans('core.forum.user_controls_button'),
|
label: app.translator.trans('core.forum.user_controls.button'),
|
||||||
icon: 'ellipsis-v'
|
icon: 'ellipsis-v'
|
||||||
}) : ''}
|
}) : ''}
|
||||||
|
|
||||||
|
@ -95,13 +95,13 @@ export default class UserCard extends Component {
|
||||||
items.add('lastSeen', (
|
items.add('lastSeen', (
|
||||||
<span className={'UserCard-lastSeen' + (online ? ' online' : '')}>
|
<span className={'UserCard-lastSeen' + (online ? ' online' : '')}>
|
||||||
{online
|
{online
|
||||||
? [icon('circle'), ' ', app.trans('core.forum.user_online_text')]
|
? [icon('circle'), ' ', app.translator.trans('core.forum.user.online_text')]
|
||||||
: [icon('clock-o'), ' ', humanTime(lastSeenTime)]}
|
: [icon('clock-o'), ' ', humanTime(lastSeenTime)]}
|
||||||
</span>
|
</span>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
items.add('joined', app.trans('core.forum.user_joined_date_text', {ago: humanTime(user.joinTime())}));
|
items.add('joined', app.translator.trans('core.forum.user.joined_date_text', {ago: humanTime(user.joinTime())}));
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ export default class UserPage extends Page {
|
||||||
items.add('posts',
|
items.add('posts',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
href: app.route('user.posts', {username: user.username()}),
|
href: app.route('user.posts', {username: user.username()}),
|
||||||
children: [app.trans('core.forum.user_posts_link'), <span className="Button-badge">{user.commentsCount()}</span>],
|
children: [app.translator.trans('core.forum.user.posts_link'), <span className="Button-badge">{user.commentsCount()}</span>],
|
||||||
icon: 'comment-o'
|
icon: 'comment-o'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -139,7 +139,7 @@ export default class UserPage extends Page {
|
||||||
items.add('discussions',
|
items.add('discussions',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
href: app.route('user.discussions', {username: user.username()}),
|
href: app.route('user.discussions', {username: user.username()}),
|
||||||
children: [app.trans('core.forum.user_discussions_link'), <span className="Button-badge">{user.discussionsCount()}</span>],
|
children: [app.translator.trans('core.forum.user.discussions_link'), <span className="Button-badge">{user.discussionsCount()}</span>],
|
||||||
icon: 'reorder'
|
icon: 'reorder'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -149,7 +149,7 @@ export default class UserPage extends Page {
|
||||||
items.add('settings',
|
items.add('settings',
|
||||||
LinkButton.component({
|
LinkButton.component({
|
||||||
href: app.route('settings'),
|
href: app.route('settings'),
|
||||||
children: app.trans('core.forum.user_settings_link'),
|
children: app.translator.trans('core.forum.user.settings_link'),
|
||||||
icon: 'cog'
|
icon: 'cog'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default class UsersSearchResults {
|
||||||
if (!results.length) return '';
|
if (!results.length) return '';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<li className="Dropdown-header">{app.trans('core.forum.search_users_heading')}</li>,
|
<li className="Dropdown-header">{app.translator.trans('core.forum.search.users_heading')}</li>,
|
||||||
results.map(user => (
|
results.map(user => (
|
||||||
<li className="UserSearchResult" data-index={'users' + user.id()}>
|
<li className="UserSearchResult" data-index={'users' + user.id()}>
|
||||||
<a href={app.route.user(user)} config={m.route}>
|
<a href={app.route.user(user)} config={m.route}>
|
||||||
|
|
|
@ -55,14 +55,14 @@ export default {
|
||||||
!app.session.user || discussion.canReply()
|
!app.session.user || discussion.canReply()
|
||||||
? Button.component({
|
? Button.component({
|
||||||
icon: 'reply',
|
icon: 'reply',
|
||||||
children: app.trans(app.session.user ? 'core.forum.discussion_controls_reply_button' : 'core.forum.discussion_controls_log_in_to_reply_button'),
|
children: app.translator.trans(app.session.user ? 'core.forum.discussion_controls.reply_button' : 'core.forum.discussion_controls.log_in_to_reply_button'),
|
||||||
onclick: this.replyAction.bind(discussion, true, false)
|
onclick: this.replyAction.bind(discussion, true, false)
|
||||||
})
|
})
|
||||||
: Button.component({
|
: Button.component({
|
||||||
icon: 'reply',
|
icon: 'reply',
|
||||||
children: app.trans('core.forum.discussion_controls_cannot_reply_button'),
|
children: app.translator.trans('core.forum.discussion_controls.cannot_reply_button'),
|
||||||
className: 'disabled',
|
className: 'disabled',
|
||||||
title: app.trans('core.forum.discussion_controls_cannot_reply_text')
|
title: app.translator.trans('core.forum.discussion_controls.cannot_reply_text')
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ export default {
|
||||||
if (discussion.canRename()) {
|
if (discussion.canRename()) {
|
||||||
items.add('rename', Button.component({
|
items.add('rename', Button.component({
|
||||||
icon: 'pencil',
|
icon: 'pencil',
|
||||||
children: app.trans('core.forum.discussion_controls_rename_button'),
|
children: app.translator.trans('core.forum.discussion_controls.rename_button'),
|
||||||
onclick: this.renameAction.bind(discussion)
|
onclick: this.renameAction.bind(discussion)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -109,21 +109,21 @@ export default {
|
||||||
if (discussion.canHide()) {
|
if (discussion.canHide()) {
|
||||||
items.add('hide', Button.component({
|
items.add('hide', Button.component({
|
||||||
icon: 'trash-o',
|
icon: 'trash-o',
|
||||||
children: app.trans('core.forum.discussion_controls_delete_button'),
|
children: app.translator.trans('core.forum.discussion_controls.delete_button'),
|
||||||
onclick: this.hideAction.bind(discussion)
|
onclick: this.hideAction.bind(discussion)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
} else if (discussion.canDelete()) {
|
} else if (discussion.canDelete()) {
|
||||||
items.add('restore', Button.component({
|
items.add('restore', Button.component({
|
||||||
icon: 'reply',
|
icon: 'reply',
|
||||||
children: app.trans('core.forum.discussion_controls_restore_button'),
|
children: app.translator.trans('core.forum.discussion_controls.restore_button'),
|
||||||
onclick: this.restoreAction.bind(discussion),
|
onclick: this.restoreAction.bind(discussion),
|
||||||
disabled: discussion.commentsCount() === 0
|
disabled: discussion.commentsCount() === 0
|
||||||
}));
|
}));
|
||||||
|
|
||||||
items.add('delete', Button.component({
|
items.add('delete', Button.component({
|
||||||
icon: 'times',
|
icon: 'times',
|
||||||
children: app.trans('core.forum.discussion_controls_delete_forever_button'),
|
children: app.translator.trans('core.forum.discussion_controls.delete_forever_button'),
|
||||||
onclick: this.deleteAction.bind(discussion)
|
onclick: this.deleteAction.bind(discussion)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ export default {
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
deleteAction() {
|
deleteAction() {
|
||||||
if (confirm(extractText(app.trans('core.forum.discussion_controls_delete_confirmation')))) {
|
if (confirm(extractText(app.translator.trans('core.forum.discussion_controls.delete_confirmation')))) {
|
||||||
// If there is a discussion list in the cache, remove this discussion.
|
// If there is a discussion list in the cache, remove this discussion.
|
||||||
if (app.cache.discussionList) {
|
if (app.cache.discussionList) {
|
||||||
app.cache.discussionList.removeDiscussion(this);
|
app.cache.discussionList.removeDiscussion(this);
|
||||||
|
@ -239,7 +239,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
renameAction() {
|
renameAction() {
|
||||||
const currentTitle = this.title();
|
const currentTitle = this.title();
|
||||||
const title = prompt(extractText(app.trans('core.forum.discussion_controls_rename_text')), currentTitle);
|
const title = prompt(extractText(app.translator.trans('core.forum.discussion_controls.rename_text')), currentTitle);
|
||||||
|
|
||||||
// If the title is different to what it was before, then save it. After the
|
// If the title is different to what it was before, then save it. After the
|
||||||
// save has completed, update the post stream as there will be a new post
|
// save has completed, update the post stream as there will be a new post
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default {
|
||||||
if (!post.isHidden()) {
|
if (!post.isHidden()) {
|
||||||
items.add('edit', Button.component({
|
items.add('edit', Button.component({
|
||||||
icon: 'pencil',
|
icon: 'pencil',
|
||||||
children: app.trans('core.forum.post_controls_edit_button'),
|
children: app.translator.trans('core.forum.post_controls.edit_button'),
|
||||||
onclick: this.editAction.bind(post)
|
onclick: this.editAction.bind(post)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ export default {
|
||||||
if (post.canEdit()) {
|
if (post.canEdit()) {
|
||||||
items.add('hide', Button.component({
|
items.add('hide', Button.component({
|
||||||
icon: 'trash-o',
|
icon: 'trash-o',
|
||||||
children: app.trans('core.forum.post_controls_delete_button'),
|
children: app.translator.trans('core.forum.post_controls.delete_button'),
|
||||||
onclick: this.hideAction.bind(post)
|
onclick: this.hideAction.bind(post)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -93,14 +93,14 @@ export default {
|
||||||
if (post.contentType() === 'comment' && post.canEdit()) {
|
if (post.contentType() === 'comment' && post.canEdit()) {
|
||||||
items.add('restore', Button.component({
|
items.add('restore', Button.component({
|
||||||
icon: 'reply',
|
icon: 'reply',
|
||||||
children: app.trans('core.forum.post_controls_restore_button'),
|
children: app.translator.trans('core.forum.post_controls.restore_button'),
|
||||||
onclick: this.restoreAction.bind(post)
|
onclick: this.restoreAction.bind(post)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
if (post.canDelete() && post.number() !== 1) {
|
if (post.canDelete() && post.number() !== 1) {
|
||||||
items.add('delete', Button.component({
|
items.add('delete', Button.component({
|
||||||
icon: 'times',
|
icon: 'times',
|
||||||
children: app.trans('core.forum.post_controls_delete_forever_button'),
|
children: app.translator.trans('core.forum.post_controls.delete_forever_button'),
|
||||||
onclick: this.deleteAction.bind(post)
|
onclick: this.deleteAction.bind(post)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ export default {
|
||||||
if (user.canEdit()) {
|
if (user.canEdit()) {
|
||||||
items.add('edit', Button.component({
|
items.add('edit', Button.component({
|
||||||
icon: 'pencil',
|
icon: 'pencil',
|
||||||
children: app.trans('core.forum.user_controls_edit_button'),
|
children: app.translator.trans('core.forum.user_controls.edit_button'),
|
||||||
onclick: this.editAction.bind(user)
|
onclick: this.editAction.bind(user)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ export default {
|
||||||
if (user.id() !== '1' && user.canDelete()) {
|
if (user.id() !== '1' && user.canDelete()) {
|
||||||
items.add('delete', Button.component({
|
items.add('delete', Button.component({
|
||||||
icon: 'times',
|
icon: 'times',
|
||||||
children: app.trans('core.forum.user_controls_delete_button'),
|
children: app.translator.trans('core.forum.user_controls.delete_button'),
|
||||||
onclick: this.deleteAction.bind(user)
|
onclick: this.deleteAction.bind(user)
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
||||||
* Delete the user.
|
* Delete the user.
|
||||||
*/
|
*/
|
||||||
deleteAction() {
|
deleteAction() {
|
||||||
if (confirm(app.trans('core.forum.user_controls_delete_confirmation'))) {
|
if (confirm(app.translator.trans('core.forum.user_controls.delete_confirmation'))) {
|
||||||
this.delete().then(() => {
|
this.delete().then(() => {
|
||||||
if (app.current instanceof UserPage && app.current.user === this) {
|
if (app.current instanceof UserPage && app.current.user === this) {
|
||||||
app.history.back();
|
app.history.back();
|
||||||
|
|
|
@ -255,16 +255,16 @@ export default class App {
|
||||||
|
|
||||||
case 401:
|
case 401:
|
||||||
case 403:
|
case 403:
|
||||||
children = 'You do not have permission to do that.';
|
children = app.translator.trans('core.lib.error.permission_denied_message');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 404:
|
case 404:
|
||||||
case 410:
|
case 410:
|
||||||
children = 'The requested resource was not found.';
|
children = app.translator.trans('core.lib.error.not_found_message');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
children = 'Oops! Something went wrong. Please reload the page and try again.';
|
children = app.translator.trans('core.lib.error.generic_message');
|
||||||
}
|
}
|
||||||
|
|
||||||
error.alert = new Alert({
|
error.alert = new Alert({
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
*/
|
*/
|
||||||
export default function punctuateSeries(items) {
|
export default function punctuateSeries(items) {
|
||||||
if (items.length === 2) {
|
if (items.length === 2) {
|
||||||
return app.trans('core.lib.series_two_text', {
|
return app.translator.trans('core.lib.series.two_text', {
|
||||||
first: items[0],
|
first: items[0],
|
||||||
second: items[1]
|
second: items[1]
|
||||||
});
|
});
|
||||||
|
@ -21,10 +21,10 @@ export default function punctuateSeries(items) {
|
||||||
// into the translator along with the first and last item.
|
// into the translator along with the first and last item.
|
||||||
const second = items
|
const second = items
|
||||||
.slice(1, items.length - 1)
|
.slice(1, items.length - 1)
|
||||||
.reduce((list, item) => list.concat([item, app.trans('core.lib.series_glue_text')]), [])
|
.reduce((list, item) => list.concat([item, app.translator.trans('core.lib.series.glue_text')]), [])
|
||||||
.slice(0, -1);
|
.slice(0, -1);
|
||||||
|
|
||||||
return app.trans('core.lib.series_three_text', {
|
return app.translator.trans('core.lib.series.three_text', {
|
||||||
first: items[0],
|
first: items[0],
|
||||||
second,
|
second,
|
||||||
third: items[items.length - 1]
|
third: items[items.length - 1]
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* @return {Object}
|
* @return {Object}
|
||||||
*/
|
*/
|
||||||
export default function username(user) {
|
export default function username(user) {
|
||||||
const name = (user && user.username()) || app.trans('core.forum.user_deleted_text');
|
const name = (user && user.username()) || app.translator.trans('core.lib.deleted_user_text');
|
||||||
|
|
||||||
return <span className="username">{name}</span>;
|
return <span className="username">{name}</span>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ Object.assign(Discussion.prototype, {
|
||||||
const items = new ItemList();
|
const items = new ItemList();
|
||||||
|
|
||||||
if (this.isHidden()) {
|
if (this.isHidden()) {
|
||||||
items.add('hidden', <Badge type="hidden" icon="trash" label="Hidden"/>);
|
items.add('hidden', <Badge type="hidden" icon="trash" label={app.translator.trans('core.lib.hidden_discussion_tooltip')}/>);
|
||||||
}
|
}
|
||||||
|
|
||||||
return items;
|
return items;
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
export default function abbreviateNumber(number) {
|
export default function abbreviateNumber(number) {
|
||||||
// TODO: translation
|
// TODO: translation
|
||||||
if (number >= 1000000) {
|
if (number >= 1000000) {
|
||||||
return Math.floor(number / 1000000) + 'M';
|
return Math.floor(number / 1000000) + app.translator.trans('core.lib.number_suffix.mega_text');
|
||||||
} else if (number >= 1000) {
|
} else if (number >= 1000) {
|
||||||
return Math.floor(number / 1000) + 'K';
|
return Math.floor(number / 1000) + app.translator.trans('core.lib.number_suffix.kilo_text');
|
||||||
} else {
|
} else {
|
||||||
return number.toString();
|
return number.toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user