mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 17:18:56 +08:00
Update translation IDs
This commit is contained in:
parent
76eaf8cb2d
commit
37fac5a0d4
@ -35,7 +35,7 @@ export default function() {
|
|||||||
<a className="DiscussionComposer-changeTags" onclick={this.chooseTags.bind(this)}>
|
<a className="DiscussionComposer-changeTags" onclick={this.chooseTags.bind(this)}>
|
||||||
{this.tags.length
|
{this.tags.length
|
||||||
? tagsLabel(this.tags)
|
? tagsLabel(this.tags)
|
||||||
: <span className="TagLabel untagged">{app.trans('tags.tag_new_discussion_link')}</span>}
|
: <span className="TagLabel untagged">{app.trans('flarum-tags.forum.tag_new_discussion_link')}</span>}
|
||||||
</a>
|
</a>
|
||||||
), 10);
|
), 10);
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@ export default function() {
|
|||||||
extend(DiscussionControls, 'moderationControls', function(items, discussion) {
|
extend(DiscussionControls, 'moderationControls', function(items, discussion) {
|
||||||
if (discussion.canTag()) {
|
if (discussion.canTag()) {
|
||||||
items.add('tags', Button.component({
|
items.add('tags', Button.component({
|
||||||
children: app.trans('tags.edit_discussion_tags_link'),
|
children: app.trans('flarum-tags.forum.edit_discussion_tags_link'),
|
||||||
icon: 'tag',
|
icon: 'tag',
|
||||||
onclick: () => app.modal.show(new TagDiscussionModal({discussion}))
|
onclick: () => app.modal.show(new TagDiscussionModal({discussion}))
|
||||||
}));
|
}));
|
||||||
|
@ -13,7 +13,7 @@ export default function() {
|
|||||||
extend(IndexPage.prototype, 'navItems', function(items) {
|
extend(IndexPage.prototype, 'navItems', function(items) {
|
||||||
items.add('tags', LinkButton.component({
|
items.add('tags', LinkButton.component({
|
||||||
icon: 'th-large',
|
icon: 'th-large',
|
||||||
children: app.trans('tags.tags'),
|
children: app.trans('flarum-tags.forum.tags'),
|
||||||
href: app.route('tags')
|
href: app.route('tags')
|
||||||
}), -10);
|
}), -10);
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ export default function() {
|
|||||||
|
|
||||||
if (more.length) {
|
if (more.length) {
|
||||||
items.add('moreTags', LinkButton.component({
|
items.add('moreTags', LinkButton.component({
|
||||||
children: app.trans('tags.more'),
|
children: app.trans('flarum-tags.forum.more'),
|
||||||
href: app.route('tags')
|
href: app.route('tags')
|
||||||
}), -10);
|
}), -10);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ export default class DiscussionTaggedPost extends EventPost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
descriptionKey() {
|
descriptionKey() {
|
||||||
return 'tags.discussion_tagged_post';
|
return 'flarum-tags.forum.discussion_tagged_post';
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptionData() {
|
descriptionData() {
|
||||||
@ -27,14 +27,14 @@ export default class DiscussionTaggedPost extends EventPost {
|
|||||||
const actions = [];
|
const actions = [];
|
||||||
|
|
||||||
if (added.length) {
|
if (added.length) {
|
||||||
actions.push(app.trans('tags.added_tags', {
|
actions.push(app.translator.transChoice('flarum-tags.forum.added_tags', added, {
|
||||||
tags: tagsLabel(added, {link: true}),
|
tags: tagsLabel(added, {link: true}),
|
||||||
count: added
|
count: added
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removed.length) {
|
if (removed.length) {
|
||||||
actions.push(app.trans('tags.removed_tags', {
|
actions.push(app.translator.transChoice('flarum-tags.forum.removed_tags', removed, {
|
||||||
tags: tagsLabel(removed, {link: true}),
|
tags: tagsLabel(removed, {link: true}),
|
||||||
count: removed
|
count: removed
|
||||||
}));
|
}));
|
||||||
|
@ -85,15 +85,17 @@ export default class TagDiscussionModal extends Modal {
|
|||||||
|
|
||||||
title() {
|
title() {
|
||||||
return this.props.discussion
|
return this.props.discussion
|
||||||
? app.trans('tags.edit_discussion_tags_title', {title: <em>{this.props.discussion.title()}</em>})
|
? app.trans('flarum-tags.forum.edit_discussion_tags_title', {title: <em>{this.props.discussion.title()}</em>})
|
||||||
: app.trans('tags.tag_new_discussion_title');
|
: app.trans('flarum-tags.forum.tag_new_discussion_title');
|
||||||
}
|
}
|
||||||
|
|
||||||
getInstruction(primaryCount, secondaryCount) {
|
getInstruction(primaryCount, secondaryCount) {
|
||||||
if (primaryCount < this.minPrimary) {
|
if (primaryCount < this.minPrimary) {
|
||||||
return app.trans('tags.choose_primary_tags', {count: this.minPrimary - primaryCount});
|
const remaining = this.minPrimary - primaryCount;
|
||||||
|
return app.translator.transChoice('flarum-tags.forum.choose_primary_tags', remaining, {count: remaining});
|
||||||
} else if (secondaryCount < this.minSecondary) {
|
} else if (secondaryCount < this.minSecondary) {
|
||||||
return app.trans('tags.choose_secondary_tags', {count: this.minSecondary - secondaryCount});
|
const remaining = this.minSecondary - secondaryCount;
|
||||||
|
return app.translator.transChoice('flarum-tags.forum.choose_secondary_tags', remaining, {count: remaining});
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
@ -160,7 +162,7 @@ export default class TagDiscussionModal extends Modal {
|
|||||||
className: 'Button Button--primary',
|
className: 'Button Button--primary',
|
||||||
disabled: primaryCount < this.minPrimary || secondaryCount < this.minSecondary,
|
disabled: primaryCount < this.minPrimary || secondaryCount < this.minSecondary,
|
||||||
icon: 'check',
|
icon: 'check',
|
||||||
children: app.trans('tags.confirm')
|
children: app.trans('flarum-tags.forum.confirm')
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,6 +22,6 @@ export default class TagLinkButton extends LinkButton {
|
|||||||
|
|
||||||
props.params.tags = tag ? tag.slug() : 'untagged';
|
props.params.tags = tag ? tag.slug() : 'untagged';
|
||||||
props.href = app.route('tag', props.params);
|
props.href = app.route('tag', props.params);
|
||||||
props.children = tag ? tag.name() : app.trans('tags.untagged');
|
props.children = tag ? tag.name() : app.trans('flarum-tags.forum.untagged');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ export default function tagLabel(tag, attrs = {}) {
|
|||||||
return (
|
return (
|
||||||
m((link ? 'a' : 'span'), attrs,
|
m((link ? 'a' : 'span'), attrs,
|
||||||
<span className="TagLabel-text">
|
<span className="TagLabel-text">
|
||||||
{tag ? tag.name() : app.trans('tags.deleted')}
|
{tag ? tag.name() : app.trans('flarum-tags.forum.deleted')}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user