WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 2 years 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 4 years ago.
18714.diff (2.6 KB) - added by wonderboymusic 2 years ago.
18714.2.diff (459 bytes) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (16)

@johnbillion4 years ago

comment:1 @johnbillion4 years ago

  • Keywords has-patch added

Patch which introduces a term_updates_messages filter.

Plugin usage:

function term_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' );
Version 0, edited 4 years ago by johnbillion (next)

comment:2 @nacin4 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

@wonderboymusic2 years ago

comment:3 @wonderboymusic2 years ago

  • Milestone changed from Future Release to 3.7

Rehab'd the whitespace

comment:4 @nacin2 years 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 @ocean902 years ago

In 25144:

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

comment:6 follow-up: @pavelevap2 years 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 @nacin2 years 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 @SergeyBiryukov2 years 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 @pavelevap2 years 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 @pavelevap2 years ago

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

comment:11 @SergeyBiryukov2 years 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 2 years ago by SergeyBiryukov (previous) (diff)

@SergeyBiryukov2 years ago

comment:12 @pavelevap2 years 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 @nacin2 years 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.