Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#18714 closed enhancement (fixed)

terms_updated_messages filter

Reported by: johnbillion's profile johnbillion Owned by: nacin's profile 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 13 years ago.
18714.diff (2.6 KB) - added by wonderboymusic 11 years ago.
18714.2.diff (459 bytes) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (16)

@johnbillion
13 years ago

#1 @johnbillion
13 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 13 years ago by johnbillion (previous) (diff)

#2 @nacin
13 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

#3 @wonderboymusic
11 years ago

  • Milestone changed from Future Release to 3.7

Rehab'd the whitespace

#4 @nacin
11 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.

#5 @ocean90
11 years ago

In 25144:

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

#6 follow-up: @pavelevap
11 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).

#7 in reply to: ↑ 6 @nacin
11 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.

#8 @SergeyBiryukov
11 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.

#9 @pavelevap
11 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).

#10 @pavelevap
11 years ago

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

#11 @SergeyBiryukov
11 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 11 years ago by SergeyBiryukov (previous) (diff)

#12 @pavelevap
11 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.

#13 @nacin
11 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.