In Drupal, we use " signs (inch signs) for quoting text. But as Drupal is completely Unicode, we can use the right “curly” quotes as well. Typography matters.
I made this patch half-automated (with several regular expressions) but checked every replacement manually. If you find “old” quotes, replace them with the correct ones (“ as opening quote, ” as closing quote, ‘ and ’ as single quotes and ’ for apostrophes).
| Comment | File | Size | Author |
|---|---|---|---|
| quotes_4.patch | 148.7 KB | kkaefer |
Comments
Comment #1
morbus iffSubscribing.
Comment #2
kkaefer commentedLet’s stay with the english language…
Comment #3
webchickHm. I'm kind of "meh" about this patch.
On one hand, yes, typography matters, looks nicer, etc. Probably also negates the requirement for escaping quotes in t(), which is nice for translators.
On the other, I end up with this weird ’ stuff in my modules and patches and have to look up the keyboard shortcut for creating them (or find one and copy/paste it) in order to retain consistency with core. ' and " are just so easy.
Could this be an output filter, like "nicequotes" which handles this automatically across all of core?
Comment #4
webchickahem. all core and contrib* (and in nodes, and...)
Comment #5
morbus iffWebchick, the basic idea is:
* screw you.
If you read the URL kkaefer links to (which is from I guy I read regularly and respect, though disagree with on this issue), his feeling is "if you're not using a UTF-8 aware editor... screw you." This includes your text editor, the Drupal.org server (which currently sends all text files as not-UTF-8, but which we're in the process of fixing), and for your OS clipboard and/or receiver (in the case of copy and pasting UTF-8 content from a web browser to something else).
Now, with all that said, I'm roughly "meh" on this patch too, and don't see it being a useful or required addition to core. I am, however, ambivalent: I can change it back to regular quotes using a locale translation, just like the reverse (that users who WANT the magick quotes could use locale to affect it to). Note that the locale way, however, does have some problem, since it's relatively difficult to anticipate exactly how translated strings are used - we can't use these UTF-8 characters as is in email transmissions.
Do I want this patch in core? No.
Do I have /compelling/ reasons I'd fight strongly for (like, say, the UTF-8 ellipsis patch)? Unfortunately, no.
Comment #6
Crell commentedOK, I'll give it a formal -1 then, since everyone else seems meh. :-)
1) UTF-8 is not universally supported yet, as Moribus points out. In my case fancy quotes break all the time in Konqueror.
2) The most widely-used form of smart quotes is MS Word's. I don't think those are actually UFT-8 (although I could be wrong there), which means we're going to be encouraging the use of non-standard MS-only characters because people don't know the difference.
3) Most editing programs still don't support them unless you use a character map, and even then not everything does. Straight quotes are right on the home row on US keyboards, and I think most other layouts, too.
4) They're ugly. Maybe I've just been reading web pages for too long, but on screen I find smart quotes uglier than straight quotes.
5) They're harder to balance. When writing, I can easily move my quotes around and reformat text easily if I don't need to worry about two different directions of quote marks. If I have to keep track of "do I use left here or right?" as well, that only makes my job easier.
6) I don't even know how smart quotes interact with PHP's string handling vis a vis quotation marks.
7) In many editors, smart quotes render as straight quotes anyway. That means I can be dealing with invalid character sets (see #2) without knowing it. This bites me constantly when working with XML that includes copies and pastes from someone's Word file.
So yeah, -1 to smart quotes in Drupal. :-)
Comment #7
Steven commentedComplete nonsense.
Comment #8
dries commentedSorry but this is only complicating the life of many developers, without adding real value.
Comment #9
pere orgaIf, for some reason, Google brings you to this 14-year-old issue when searching for handling smart quotes in Drupal, note that this is solved nowadays (Drupal 9) using a text format and installing a contributed module called Typogrify. This solution will not work for entity titles, but there are workarounds available.