Make WordPress Core

Opened 12 years ago

Closed 9 years ago

#23230 closed enhancement (fixed)

Change hyphen in front of "Draft" to em dash

Reported by: kkalvaa's profile kkalvaa Owned by: ocean90's profile ocean90
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.5
Component: Posts, Post Types Keywords: ui-feedback has-patch
Focuses: ui, administration Cc:

Description

When a post/page/etc. is saved as a draft there is a "- Draft" appended after the title in the overview list in the dashboard.

Rather than using an hyphen (-) it should be an em dash (—) and ideally it should be translatable as the typographic rules for dashes varies with languages.

Rather than "- Draft" it should say "— Draft"

Attachments (5)

23230.diff (784 bytes) - added by McGuive7 12 years ago.
Replaces endash with translatable emdash for _post_states() and _media_states()
display_post_states.png (34.5 KB) - added by netweb 11 years ago.
minus.png (104.1 KB) - added by ocean90 9 years ago.
endash.png (104.2 KB) - added by ocean90 9 years ago.
emdash.png (104.1 KB) - added by ocean90 9 years ago.

Download all attachments as: .zip

Change History (22)

#1 @alexvorn2
12 years ago

I like this small " - " minus :)

#2 @SergeyBiryukov
12 years ago

  • Component changed from UI to Administration
  • Keywords ui-focus added

#3 @aaronholbrook
12 years ago

Why should it be an em dash instead of a hyphen? What reasoning do you have for this change?

#4 @kkalvaa
12 years ago

It should be an em dash because it is typographically correct in English (but an en dash would be correct in other languages). It should not be a hyphen because it not joining words or letters inside a word. A hyphen is not a dash, it is punctuation, for everything else a dash should be used. That's my reasoning.

Ref: http://en.wikipedia.org/wiki/Dash and http://www.smashingmagazine.com/2011/08/15/mind-your-en-and-em-dashes-typographic-etiquette/ (plus a ton of typographical tradition and research)

Personally I prefer the en dash, I find the em dash a tad too long, but that's how English typography is.

#5 @alexvorn2
12 years ago

How do you know this is a hyphen or a minus sign?

1: -
2: -

the are the same

#6 @kkalvaa
12 years ago

Regardless of whether it is a hyphen or minus it should still be a dash there. Again, ref wikipedia.

@McGuive7
12 years ago

Replaces endash with translatable emdash for _post_states() and _media_states()

#7 @McGuive7
12 years ago

23230.diff​:
Changes the ' - ' to a translatable (with context specified) &mdash in _post_states() and _media_states() in /wp-admin/includes/template.php.

Two other things worth noting:

  1. ' - ' appears in numerous other files including:
  • /wp-admin/includes/class-wp-ms-sites-list-table.php
  • /wp-includes/class-pop3.php
  • /wp-includes/formatting.php
  • /wp-includes/functions.php
  • /wp-includes/ID3/module.tag.id3v2.php
  • /xmlrpc.php
  1. A quick search for ' - ' also revealed that many plugins utilize ' - ' instead of —. So it might be best to stick with that ndash convention, instead of switching to &mdash. Not as correct typographically, but perhaps more consistent.

Final thought: being as the ' - ' lives independently in a bunch of different files, might it be a good idea to abstract it to a more global variable?

#8 @McGuive7
12 years ago

  • Cc McGuive7 added
  • Keywords has-patch added

#9 @DrewAPicture
12 years ago

  • Cc xoodrew@… added
  • Component changed from Administration to Text Changes

#10 @melchoyce
11 years ago

  • Cc melissachoyce@… added

#11 @netweb
11 years ago

I have been looking for a way to do something similar and I would suggest that this should be filterable so text/icons can be used before/after the title for the _post_state/_media_state, similar to the way the post format icons are used in the posts section.

As you can see in display_post_states.png the existing post-format icons in the posts section. Then below using bbPress 'Topics' section (post_type=topic) it is easy enough for suffix the title with custom text based on the post_state with or without CSS styling per 1 & 2. For 3 though getting an icon before the title is not currently possible.

Also as seen in 1 & 2 you cannot actually remove the ' - ' so the added benefit here as per the original ticket if you want to use an 'em dash' instead of a 'hyphen' this would also allow for that and still be translatable also.

#12 @chriscct7
9 years ago

  • Focuses administration added

#13 @wonderboymusic
9 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to ocean90
  • Status changed from new to assigned

#14 @ocean90
9 years ago

  • Component changed from Text Changes to Posts, Post Types

@ocean90
9 years ago

@ocean90
9 years ago

@ocean90
9 years ago

#15 @ocean90
9 years ago

Attached screenshots for minus, endash and emdash.

@helen, @DrewAPicture: Any thoughts on this?

#16 @helen
9 years ago

The em-dash is fine for what it is, I suppose. I do think it needs to have a span or some kind of wrapper around it, and this makes me wonder if maybe we need to think a bit more about how those post states are displayed. Styling them as "labels" is something I see on publisher's sites from time to time, as well as things like row colors (not universal for core, see #26928). That doesn't block this from happening now, though. Just a very related thought.

#17 @ocean90
9 years ago

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

In 35326:

List Tables: Replace the hyphen separator for titles and post/media states with a —.

Props McGuive7.
Fixes #23230.

Note: See TracTickets for help on using tickets.