mirror of
https://github.com/flarum/core.git
synced 2025-07-19 15:51:16 +02:00
Primary key renaming
Improved consistency for existing core translation key names. See flarum/core#265 - Completely overhauled core en.yml - Replaced existing key names in all core JS files to match - Extracted a hardcoded string in IndexPage.js - Combined two app.trans calls in DiscussionControls.js - Removed hardcoded spaces from LogInModal.js and SignUpModal.js - Added two new keys from DiscussionControls.js (soft delete) - Created two new “reused keys” to YML to accommodate same
This commit is contained in:
@@ -147,7 +147,8 @@ export default class IndexPage extends Page {
|
||||
|
||||
items.add('newDiscussion',
|
||||
Button.component({
|
||||
children: canStartDiscussion ? app.trans('core.start_a_discussion') : 'Can\'t Start Discussion',
|
||||
// Core Key Reorganization: Extracted the "Can't Start Discussion" string
|
||||
children: app.trans(canStartDiscussion ? 'core.index_start_discussion_button' : 'core.index_cannot_start_discussion_button'),
|
||||
icon: 'edit',
|
||||
className: 'Button Button--primary IndexPage-newDiscussion',
|
||||
itemClassName: 'App-primaryControl',
|
||||
@@ -180,7 +181,7 @@ export default class IndexPage extends Page {
|
||||
items.add('allDiscussions',
|
||||
LinkButton.component({
|
||||
href: app.route('index', params),
|
||||
children: app.trans('core.all_discussions'),
|
||||
children: app.trans('core.index_all_discussions_link'),
|
||||
icon: 'comments-o'
|
||||
}),
|
||||
100
|
||||
@@ -201,7 +202,8 @@ export default class IndexPage extends Page {
|
||||
|
||||
const sortOptions = {};
|
||||
for (const i in app.cache.discussionList.sortMap()) {
|
||||
sortOptions[i] = app.trans('core.sort_' + i);
|
||||
// Core Key Reorganization: Adjusted syntax for new key names
|
||||
sortOptions[i] = app.trans('core.index_sort_' + i + '_button');
|
||||
}
|
||||
|
||||
items.add('sort',
|
||||
@@ -226,7 +228,7 @@ export default class IndexPage extends Page {
|
||||
|
||||
items.add('refresh',
|
||||
Button.component({
|
||||
title: app.trans('core.refresh'),
|
||||
title: app.trans('core.index_refresh_tooltip'),
|
||||
icon: 'refresh',
|
||||
className: 'Button Button--icon',
|
||||
onclick: () => app.cache.discussionList.refresh()
|
||||
@@ -236,7 +238,7 @@ export default class IndexPage extends Page {
|
||||
if (app.session.user) {
|
||||
items.add('markAllAsRead',
|
||||
Button.component({
|
||||
title: app.trans('core.mark_all_as_read'),
|
||||
title: app.trans('core.index_mark_all_as_read_tooltip'),
|
||||
icon: 'check',
|
||||
className: 'Button Button--icon',
|
||||
onclick: this.markAllAsRead.bind(this)
|
||||
|
Reference in New Issue
Block a user