FIX: Show an example username in Review Settings (#11097)

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
Gerhard Schlager 2020-11-02 11:13:30 +01:00 committed by GitHub
parent 5c662128d3
commit b73234b75c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,8 @@
import Controller from "@ember/controller";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
export default Controller.extend({
saving: false,
@ -25,4 +27,15 @@ export default Controller.extend({
.finally(() => this.set("saving", false));
},
},
@discourseComputed("settings.reviewable_score_types")
scoreTypes(types) {
const username = I18n.t("review.example_username");
return types.map((type) =>
Object.assign({}, type, {
title: type.title.replace("%{username}", username),
})
);
},
});

View File

@ -1,7 +1,7 @@
<div class="reviewable-settings">
<h4>{{i18n "review.settings.priorities.title"}}</h4>
{{#each settings.reviewable_score_types as |rst|}}
{{#each scoreTypes as |rst|}}
<div class="reviewable-score-type">
<div class="title">{{rst.title}}</div>
<div class="field">

View File

@ -563,6 +563,7 @@ en:
one: "You have <strong>%{count}</strong> post pending."
other: "You have <strong>%{count}</strong> posts pending."
ok: "OK"
example_username: "username"
user_action:
user_posted_topic: "<a href='%{userUrl}'>%{user}</a> posted <a href='%{topicUrl}'>the topic</a>"