FIX: Translation improvements for unused tags (d89ffbe)

This commit is contained in:
David Taylor 2018-11-12 16:36:56 +00:00
parent d89ffbeffd
commit ba00fcc371
2 changed files with 17 additions and 15 deletions

View File

@ -47,20 +47,22 @@ export default Ember.Controller.extend({
.then(result => { .then(result => {
const displayN = 20; const displayN = 20;
const tags = result["tags"]; const tags = result["tags"];
const tagString = tags.slice(0, displayN).join(", "); const joinedTags = tags.slice(0, displayN).join(", ");
var more = Math.max(0, tags.length - displayN); var more = Math.max(0, tags.length - displayN);
const string =
const tagsString =
more === 0 more === 0
? I18n.t("tagging.delete_unused_confirmation", { ? joinedTags
count: tags.length, : I18n.t("tagging.delete_unused_confirmation_more_tags", {
tags: tagString count: more,
}) tags: joinedTags
: I18n.t("tagging.delete_unused_confirmation_more", {
total: tags.length,
tags: tagString,
count: more
}); });
const string = I18n.t("tagging.delete_unused_confirmation", {
count: tags.length,
tags: tagsString
});
bootbox.confirm( bootbox.confirm(
string, string,
I18n.t("tagging.cancel_delete_unused"), I18n.t("tagging.cancel_delete_unused"),

View File

@ -2711,11 +2711,11 @@ en:
upload_instructions: "One per line, optionally with a tag group in the format 'tag_name,tag_group'." upload_instructions: "One per line, optionally with a tag group in the format 'tag_name,tag_group'."
upload_successful: "Tags uploaded successfully" upload_successful: "Tags uploaded successfully"
delete_unused_confirmation: delete_unused_confirmation:
one: "1 tag will be deleted: %{tags}" one: "%{count} tag will be deleted: %{tags}"
other: "{{count}} tags will be deleted: %{tags}" other: "%{count} tags will be deleted: %{tags}"
delete_unused_confirmation_more: delete_unused_confirmation_more_tags:
one: "{{total}} tags will be deleted: %{tags} and one more" one: "%{tags} and %{count} more"
other: "{{total}} tags will be deleted: %{tags} and %{count} more" other: "%{tags} and %{count} more"
delete_unused: "Delete Unused Tags" delete_unused: "Delete Unused Tags"
delete_unused_description: "Delete all tags which are not attached to any topics or personal messages" delete_unused_description: "Delete all tags which are not attached to any topics or personal messages"
cancel_delete_unused: "Cancel" cancel_delete_unused: "Cancel"