Go to /admin/content/node, check one node, and choose delete from the update menu. The header of the subsequent page says "these items" and the submit button says "delete all." See below:

Here's a patch that checks whether the number of nodes being deleted is greater than one. If it's greater than one, the header says what it already does. If it's one, the header refers to the item in singular form.

This patch changes the "Delete all" text on the submit button to just "Delete," which I think expresses the same thing given the warning in the header, and it also avoids having an awkward use of format_plural(). If people absolutely love "Delete all" I can revise it to use format_plural() like the the header does in this patch.

The indentation here is awkward. Let me know if/how it can be improved.

A similar change would be needed for the submit handler, but I'm not sure if it would be better to use format_plural() or just two separate drupal_set_message() calls within an if block. I'll wait for feedback on that.

(Is there a tag for textual/language work?)

Comments

dries’s picture

Status: Needs review » Needs work

It's better to format_plural() the entire sentence so the translator has enough context.

akahn’s picture

Thanks, I wasn't sure about that. I'll likely get to this on Monday.

akahn’s picture

Status: Needs work » Needs review
StatusFileSize
new1.78 KB

Okay, this patch has all of the text in format_plural() so that translators have an easier time. I also moved the call to format_plural() out of the return statement since that was getting cluttered. I also gave node_multiple_delete_submit() the same treatment, so that the message that the user sees after the nodes get deleted is not plural if only one node was deleted.

The indentation is still a bit awkward, so let me know if there is a better way.

Status: Needs review » Needs work

The last submitted patch failed testing.

akahn’s picture

Status: Needs work » Needs review

What's up with these exceptions? The patch doesn't do anything about path aliases...

kalis1’s picture

Hi,
I've requested a new test for node_delete_multiple_3.patch, which went well this time...
And locally on my test site, everything is working as intended...

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.