WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months ago

#18714 closed enhancement (fixed)

terms_updated_messages filter

Reported by: johnbillion Owned by: nacin
Milestone: 3.7 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch 3.4-early
Focuses: Cc:

Description

In the same vein as #18710 we should add a terms_updated_messages filter for the term management screen. Messages are currently hardcoded as 'Item added', 'Items deleted', etc.

Attachments (3)

18714.patch (2.6 KB) - added by johnbillion 3 years ago.
18714.diff (2.6 KB) - added by wonderboymusic 8 months ago.
18714.2.diff (459 bytes) - added by SergeyBiryukov 8 months ago.

Download all attachments as: .zip

Change History (16)

johnbillion3 years ago

comment:1 johnbillion3 years ago

  • Keywords has-patch added

Patch which introduces a term_updated_messages filter.

Plugin usage:

function foo_updated_messages( $messages ) {
	$messages['foo'] = array(
		0 => '',
		1 => __('Foo added.','foo'),
		2 => __('Foo deleted.','foo'),
		3 => __('Foo updated.','foo'),
		4 => __('Foo not added.','foo'),
		5 => __('Foo not updated.','foo'),
		6 => __('Foos deleted.','foo')
	);
	return $messages;
}
add_filter( 'term_updated_messages', 'foo_updated_messages' );
Last edited 3 years ago by johnbillion (previous) (diff)

comment:2 nacin3 years ago

  • Keywords 3.4-early added
  • Milestone changed from Awaiting Review to Future Release
  • Owner set to nacin
  • Status changed from new to accepted

wonderboymusic8 months ago

comment:3 wonderboymusic8 months ago

  • Milestone changed from Future Release to 3.7

Rehab'd the whitespace

comment:4 nacin8 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 25143:

Add a terms_updated_messages filter to edit-tags.php, along with taxonomy-specific strings.

props johnbillion.
fixes #18714.

comment:5 ocean908 months ago

In 25144:

Replace duplicated lines in [25143] with an assignment. see #18714.

comment:6 follow-up: pavelevap8 months ago

  • Cc pavelevap@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened

We should make difference between "Category" and "Link category". Everytime we use "Link category", for example "Add New Link Category", "New Link Category Name", etc. So, there is different context for "Category" and "Link category" and we should preserve this context also for these messages (even if there will be more strings).

comment:7 in reply to: ↑ 6 nacin8 months ago

Replying to pavelevap:

We should make difference between "Category" and "Link category". Everytime we use "Link category", for example "Add New Link Category", "New Link Category Name", etc. So, there is different context for "Category" and "Link category" and we should preserve this context also for these messages (even if there will be more strings).

Is it truly necessary? This used to be "Item", with no context at all. And, Links are deprecated in core. Not sure it is worth the effort of translators to translate the new strings, despite there only being a half dozen and pretty short.

comment:8 SergeyBiryukov8 months ago

I guess I'd prefer to leave [25144] as is. A link category is still a category, and the "Link Categories" screen header provides the context, so it doesn't look like there'll be much confusion.

comment:9 pavelevap8 months ago

Unfortunately "Item" was better in this case for example for our translation. We are using different meanings for "Category" (Rubrika) and "Link category" (Kategorie odkazů). General word "Item" was better than wrong string. Only other solution for us is combine all these different strings into one, but it is not relevant, because original strings also differ...

Links are deprecated, but still used. When they are removed from core, we can remove also translation.

I suggest reverting back to "Item" or making it right (with Link category context).

comment:10 pavelevap8 months ago

What about some general strings: "%s added" (and using singular name for taxonomy)? It would be usefull also for custom taxonomies?

comment:11 SergeyBiryukov8 months ago

We tend to avoid post type and taxonomy names in generic strings, as noted in ticket:17609:3 and ticket:19099:1.

Let's go back to "Item" for link categories then: 18714.2.diff.

Last edited 8 months ago by SergeyBiryukov (previous) (diff)

SergeyBiryukov8 months ago

comment:12 pavelevap8 months ago

+ 1

SergeyBiryukov: Yes, I forgot about broader consequences. Patch is fine for me and there is also no special code for deprecated Links.

comment:13 nacin8 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 25158:

Return to 'Item' for term updated messages for the link_category taxonomy.

props SergeyBiryukov, pavelevap.
fixes #18714.

Note: See TracTickets for help on using tickets.