-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Add button to delete unused tags #6587
Conversation
You've signed the CLA, davidtaylorhq. Thank you! This pull request is ready for review. |
config/locales/client.en.yml
Outdated
@@ -2707,6 +2707,10 @@ en: | |||
upload_description: "Upload a text file to create tags in bulk" | |||
upload_instructions: "One per line, optionally with a tag group in the format 'tag_name,tag_group'." | |||
upload_successful: "Tags uploaded successfully" | |||
delete_unused_confirmation: "Are you sure you want to delete %{count} unused tags?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs pluralization with one
and other
keys.
I'm wondering if it would be better to list the names of the unused tags instead of just displaying the count. |
b4c2692
to
0885c44
Compare
Thanks for the feedback. I have made the changes.
|
😍 |
This is particularly useful if you have uploaded a CSV file, and wish to bulk-delete all of the tags that you uploaded.
0885c44
to
461542b
Compare
other: "{{count}} tags will be deleted: %{tags}" | ||
delete_unused_confirmation_more: | ||
one: "{{total}} tags will be deleted: %{tags} and one more" | ||
other: "{{total}} tags will be deleted: %{tags} and %{count} more" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately 2 numbers won't work for languages like Russian where you have other categories than one
and other
. For example, if total
is 31 it would require the one
category for {{total}}
and the many
category for %{count}
.
Possible solutions:
- Use Message Format which is totally awesome, but super hard to translate.
- Split up the translation. I think you could get away with that option in this case by using the following strings:
delete_unused_confirmation:
one: "%{count} tag will be deleted: %{tags}"
other: "%{count} tags will be deleted: %{tags}"
delete_unused_confirmation_more_tags:
one: "%{tags} and one more"
other: "%{tags} and %{count} more"
And use it like this:
const string = I18n.t("tagging.delete_unused_confirmation", {
count: tags.length,
tags:
more === 0
? tagString
: I18n.t("tagging.delete_unused_confirmation_more_tags", {
count: tags.length,
tags: tagString
})
});
💡 Two more tips:
{{key}}
is deprecated. Use%{key}
whenever possible.- Instead of using the number
1
inside theone
category, it's good practice to always use%{count}
. It makes it easier for translators who always need to use%{count}
for their language. See Always use %{count} variable when translating pluralized strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thanks for the info @gschlager - I've made those changes in ba00fcc (sorry I got a bit trigger-happy with the merge button!)
This is particularly useful if you have uploaded a CSV file, and wish to bulk-delete all of the tags that you uploaded.
Adds an option to the tag administration hamburger:
Clicking the button presents a confirmation modal, including the number of tags which will be deleted: