There is currently a huge, monster thread on the development list @ http://lists.drupal.org/archives/development/2006-09/msg00280.html. Here's a summary which should save you a few hours of your life: ;)
1. Drupal's lowercasing of everything brings about inconsistencies in various places, for example the breadcrumbs for forums: home >> forums >> My Super Forum.
2. You have some flexibility at the theme layer to change this. You Can Use CSS to Capitalize The First Letter Of Each Word. OR CONVERT IT TO UPPERCASE. Or only the first letter. or make it all lowercase.
3. But what you can't do is: Capitalize the First Letter of Each Word, Leaving Articles Lowercased. You need server-side logic to do this (does the word match this list of words that should be lowercased in a title? is the word the first word of the title? if it is, leave it capitalized, otherwise lowercase it.) and running this on every menu/link output on every page load by Drupal comes at a performance cost.
Therefore, this patch goes through node and system modules to Proper Case Titles, except for things like "Date and Time." One big patch should be rolled against core with all the capitalization changes, which I don't have time to do (and other people committed to this already), but here is a patch to get us started anyway.
Comment | File | Size | Author |
---|---|---|---|
#81 | capitalise_combine_11.patch | 3.59 KB | RobRoy |
#79 | user_cap.patch | 1.26 KB | RobRoy |
#76 | no_ucfirst_0.patch | 1.35 KB | RobRoy |
#75 | no_ucfirst.patch | 697 bytes | RobRoy |
#70 | capitalise.patch | 4.18 KB | profix898 |
Comments
Comment #1
rkerr CreditAttribution: rkerr commentedI think this is for sure the correct thing to do... tracking this issue :)
Comment #2
drewish CreditAttribution: drewish commentedsubscribing
Comment #3
webchickGuys. ;) How about instead of subscribing, you each take a module or two? ;) Then this will actually get done much faster and we'll gave something to get committed. ;)
Comment #4
drewish CreditAttribution: drewish commentedoh, i intend to, this way i can find the link when i've got a litte time to work on it.
Comment #5
webchickAh, good stuff. :) thanks!
Comment #6
magico CreditAttribution: magico commented(subscribe)
Comment #7
Gary Feldman CreditAttribution: Gary Feldman commentedIt took me some time to figure out what you meant by "Date and Time" (and that your point had nothing to do with either dates or times in titles).
So let me be more explicit, by rewording the rule in the last paragraph at http://www.writers.com/tips_titles.html:
The words "a, an, the, at, by, for, in, of, on, to, up, and, as, but, it, or, and nor" should be in lower case, unless they're the first word in the title. All other words should be capitalized, regardless of where they appear in the title.
There are other conventions, as indicated at that link above. I don't think anyone will complain if someone happens to follow the Chicago Manual of Style or AP or whatever, nor should they, but this explicit list of words seems like the simplest rule to have here.
Comment #8
drewish CreditAttribution: drewish commentedHere's one for the watchdog module.
Comment #9
adixon CreditAttribution: adixon commentedAs someone noted in the list discussion, this also means all the translations have to be edited (since translations are case sensitive). So when you do a module, also do the .po files.
Comment #10
drewish CreditAttribution: drewish commentedI think it'd make sense to just roll up all the .po files at the end wouldn't it?
Comment #11
webchickagreed. it's tedious enough just doing the text. :P one thing at a time.
Comment #12
Wesley Tanaka CreditAttribution: Wesley Tanaka commentedhttp://drupal.org/node/53753 was marked as a duplicate of this.
subscribing.
Is it just me or does a mega patch seem like it has little chance of ever getting committed? Would it be better to commit patches as they came in?
Comment #13
webchickOn the dev list, Drumm and/or Dries (sorry, can't remember who) said it all needs to go at once. This makes sense, as otherwise we have totally inconsistent capitalization throughout core.
Comment #14
moshe weitzman CreditAttribution: moshe weitzman commented@Wesley - this patch has very little chance of ever getting written (properly, as one consistent patch). If it did, I am pretty sure it would be committed.
Comment #15
RobRoy CreditAttribution: RobRoy commentedSo we also want to get at all the fieldset and field #titles correct? So on the user edit page it will be...
Account Information
E-mail Address
Comment Settings
etc.
Just making sure. I'm 100% behind this patch. So the battle plan is to have one patch per file? So one patch for user.module, another patch for node.module, etc.? I'd like to know who is working on what so I know where to concentrate my efforts. Thanks webchick for taking charge!
Comment #16
webchick@RobRoy: the end patch needs to be one huge patch for all of core, but it's much easier to work on individual parts. So go ahead and roll one patch for user.module, etc. I (or whoever) can roll all the patches into one at the end.
Not sure about fieldsets and whatnot... the only thing we'd discussed on the dev ML was menu titles, so I guess keep it to that for now, and we can talk about other stuff in a separate patch.
Comment #17
flk CreditAttribution: flk commentedcapitalised aggregator modules menu links
there were 2 occassions where the title was
[code]
'title' => $category['title'],
[/code]
I just left those alone.
Comment #18
flk CreditAttribution: flk commentedblock.module menu capitalised.
i dont think there is a need to capitalise the theme names (only thing we can really control from block.module is the name of bluemarine) which are sub menu's thus i left them alone.
Comment #19
flk CreditAttribution: flk commentedblog.module
Comment #20
flk CreditAttribution: flk commentedblogapi.module
Comment #21
flk CreditAttribution: flk commentedbook.module
Comment #22
Zen CreditAttribution: Zen commentedCorrect / Easy on the eyes / Uncomplicated / Reads like a sentence:
"This is a Drupal title and reads like any other sentence"
Examples:
http://news.bbc.co.uk/
http://www.lemonde.fr/
http://hinduonnet.com/
http://www.torontosun.com/
http://www.theage.com.au/
http://www.iht.com/
http://www.elpais.es/
Incorrect / Overcomplicated / Tough on the eyes / A touch of Yanqui sensationalism :P :
"This is a Drupal Title and is Likely to Give You a Heart Attack"
Examples:
http://www.washingtonpost.com/
http://nytimes.com/
http://cnn.com appears to sit on the fence on this one.
My 0.10p,
-K
Comment #23
flk CreditAttribution: flk commentedjust an update
So far the following modules have been 'capitalised' :
for convenience sake i have combined the patches submitted so far into one big patch...please review those.
So for now that leaves the following modules which need to be capitalised (capitalisation of _menu):
so grab one and dig in :D
Comment #24
flk CreditAttribution: flk commentedok i think thats it for the last of the modules....
Comment #25
flk CreditAttribution: flk commentedcombined everything together...please review
Comment #26
Stefan Nagtegaal CreditAttribution: Stefan Nagtegaal commentedSimple and straightforward. Applied clean to CVS without any problems..
This is ready, so let's get this in...
Comment #27
webchickAwesome job, Shakur!!
However, there's one problem: the capitalization of the menu titles in the help text is now inconsitent; it's done in watchdog, but not in others. I'd recommend removing those portions of the patch and either make the help text fixes a separate one, or removing those links altogether frrom help if http://drupal.org/node/84414 makes it in.
Comment #28
flk CreditAttribution: flk commentedok, removed the _help msgs of watchdog and rerolled everything against head.
Comment #29
webchickTo address Zen's comments in #22:
1. Switching titles to be "This is a title" is inconsistent with core's usage of US English throughout. You'll notice that the sites you've cited are from Canada, UK, Australia, etc.
2. You can't programmatically re-create "Date and Time" without a lot of server-side processing.
3. You can, using only CSS, re-create all other formatting options such as "this is a title" and "This is a title" and "THIS IS A TITLE"
therefore, this way seems the way to go.
Comment #30
flk CreditAttribution: flk commentedhmm some people having problem using the patch. rerolled.
Comment #31
AjK CreditAttribution: AjK commentedhttp://drupal.org/node/84414 introduced a By Module tab into admin and that seems overlooked by this patch. Flk did ask me to reroll but he's off to bed and, well, I'm in the same timezone as he! Me off to bed too!
Comment #32
RobRoy CreditAttribution: RobRoy commentedHere's a re-roll for HEAD but it looks like that By Module is already taken care of.
Comment #33
Zen CreditAttribution: Zen commentedhttp://bostonherald.com/
http://www.boston.com/ [Boston globe]
http://sfgate.com/chronicle/
http://www.chicagotribune.com/
This doesn't appear to be something all American papers do.. It looks to be about 50/50. In other words, this is not a "locale" issue. It is an issue of readability, simplicity, elegance and ease of use.
Also, el jefe has an opinion on this as well.
-K
Comment #34
webchickPlease leave this for review. You've stated your opinion, that doesn't necessarily mean the patch needs work. We'll let one of the core committers chime in on which method they'd like to see and adjust the patch accordingly if need be.
PS: Yeah I know Dries said that, but it was early on in the conversation and before the discussion about the impossibility of fixing with CSS, etc. If he still feels that way, then that's cool with me.
Comment #35
AjK CreditAttribution: AjK commentedPatch in #32 fails to apply for the same reason patch in #28 fails to apply. All line ends have the Windows end of line character (^M) appended.
Comment #36
webchickUsing a utility like dos2unix should convert the line breaks in the patch for you. Otherwise, update your version of patch. patch 2.5.8 on OS X is working fine for me.
Comment #37
AjK CreditAttribution: AjK commentedPatch in #32 applied ok (after stripping ^M line ends). All seems well but I can't help an enourmous sense of "extended camel case" in the new admin/ by modules page. What do I mean, well, be exmaple:-
Why is configure permissions and get help always lower case? What's so special about Pages or Referrers that give them a capital but neither the former? The whole page looks "unbalanced". That's what I meant in my previous comment about this page, obviously didn't make myself clear.
@webchick Yep, I know about dos2unix. In fact, my Windows text editor of choice (EditPad Pro) is set to always save in Unix format. On patches that I fetch which turn out to have ^M endings I use vi :1,$! tr -d '\015' to remove the ^M. The only reason I point this out is that the Drupal handbook for HOWTO: Submit patches for Drupal is aimed at the patch maker and not at the committer (and by proxy any intermediate patch reviewer). Pointing it out is just to remind patch makers they need to make this step, not the reviewer/committer.
Comment #38
RobRoy CreditAttribution: RobRoy commentedOkay, in this patch I think I've...
- Fixed a few stragglers like get help, configure perms, log in, etc.
- Changed my doc type to Unix. Let me know if you find the ^M's in this patch.
Comment #39
AjK CreditAttribution: AjK commentedRobRoy,
Looks good. I'm assuming that the column Name in admin/build/modules is derived from the modules themselves and are therefore up to module maintainers to get correct.
Some more "stragglers":-
Under Navigation >> Create Content :-
Poll ok but the others not, likewise on the main page itself except here it's poll so they all wrong?
regards,
--AjK
Comment #40
RobRoy CreditAttribution: RobRoy commentedFixed the above. 'page' and 'story' are done in system_install() so you'll have to reinstall Drupal to see those change.
Comment #41
RobRoy CreditAttribution: RobRoy commentedKeeping up with HEAD. I also found that Search and Search Settings were mixed up, fixed that.
Can we get a big boy/girl to check this out? Looks good to me.
Comment #42
flk CreditAttribution: flk commentedlooking good guys.
reviewed it and works fine with head.
Comment #43
Dries CreditAttribution: Dries commentedLooks good. Some hunks failed to apply though. Also, what is the guideline with regard to form titles? I'd like to see some written guidelines that can be posted as soon this patch gets committed.
Comment #44
flk CreditAttribution: flk commentedrolled against head.
Comment #45
webchickWritten guidelines, which could be added to the updating modules docs:
Menu titles capitalized
All menu titles within Drupal and its modules should be capitalized according to U.S. English. All words in the title should be capitalized, apart from articles, prepositions, and conjunctions.
For example, a title such as 'edit category' should now be 'Edit Category' and 'date and time' should now be 'Date and Time.'
Here is an example of old code:
Here is an exaple of new code:
(note that the title "Story" has been captalized)
If you wish to use different capitalization rules on your site's menu items, you may use CSS in your theme."
If someone could create some examples of how to change the capitalization rules in CSS that would be a nice thing to add to this. I'm not much of a CSS person.
Comment #46
RobRoy CreditAttribution: RobRoy commented@webchick: Regarding Dries' request for guidelines for form titles (both fields and fieldset titles), do you think all form fields/fieldset titles should follow the same rules as menu items? As it is now, they are all first letter capitalized and the rest lowercase (like Project information, New comment, File attachment, etc.). Thoughts?
Comment #47
Dries CreditAttribution: Dries commentedBtw, I still think that 'Edit category' is much more elegant than 'Edit Category'.
Comment #48
Dries CreditAttribution: Dries commentedRead: I want it to read 'Edit category' (even if that means we have to use CSS for that).
Comment #49
RobRoy CreditAttribution: RobRoy commentedI agree with Dries on that, but now we can do it all with CSS for menu items at least.
For form titles, I think Capitalizing Each Form Title Would Look Pretty Bad and think we could stick to the current scheme. In other words, it isn't as pressing to change all the form titles from 'Form title' to 'Form Title' since they look alright like that and are a little more consistent with the menu items (as opposed to the all lowercase menu items).
Comment #50
RobRoy CreditAttribution: RobRoy commentedHmmm...but something just came up. If we're going to use CSS to make 'Menu Item Link' turn into 'Menu item link' then we'd need to use the same CSS to perform that change of case to the breadcrumb, page title, etc. But what about breadcrumb titles, page titles that we don't want to go lowercase or that have Proper Nouns in them or acronyms like RSS?
Comment #51
webchickD'oh! I misunderstood.
I agree that it should remain "Sentence capialization" for form fields and such. Only menu items and page titles (which are derived from menu items) should be "Proper Case Capitalized," imo.
But you're right about "RSS Aggregator"=> "Rss aggregator" with "sentence capitalization" CSS. I'm not aware of a great solution around this, apart from introducing some PHP logic. I guess we need to make a judgment call about which is harder to do... server-side logic to uncapitalize "the, and, a, for..." or server-side logic to keep capitalized "RSS, OPML..."
Zen's made the case for U.S. news sources using "Sentence type capitalization" and this is what Dries prefers, too. Grammar geeks cringe when they see it. I'm a grammar geek, but could go either way, since we have an international audience and "Sentence type capitalization" is used more often throughout the world.
But basically, we have to pick one. And people who want it a different way are going to have to do some work.
Or, we could just leave it all lowercase which ticks everyone off. ;)
Comment #52
magico CreditAttribution: magico commentedIs much easier to use server-side logic to capitalize "RSS, OPML, etc" than to uncapitalize other words.
The reason is simple: the only words that will be fully capitalized are acronyms. So it is easy (and much more correct) if all acronyms within drupal would be inside an
acronym
tag, that would be styled as needed.Comment #53
Dries CreditAttribution: Dries commentedI agree that it should remain "Sentence capialization" for form fields and such. Only menu items and page titles (which are derived from menu items) should be "Proper Case Capitalized," imo.
For me, both menu titles and form titles should consistently use "Sentence capialization".
Comment #54
webchickmagico: Oh, good call! Then we could even just use CSS to capitalize those!
Dries: So that's your final answer? :) Ok, I'll try and go through later and re-work the patch to use sentence capitalization, if Shakur doesn't beat me to it. ;)
Comment #55
RobRoy CreditAttribution: RobRoy commented@webchick: So the final answer from Dries is "Sentence capitalization" for form titles and fieldset titles, but we are still sticking with "Proper Case Capitalized" for menu items. Just making sure that was clear. I think the bulk of this patch (if not all) is covering menu items so there shouldn't be much to change, right?
Comment #56
RobRoy CreditAttribution: RobRoy commentedI'm an idiot, completely disregard my last comment.
Comment #57
webchickBtw, we can't use <abbr> ... check_plain around menu titles. Nice idea anyway though. :)
Comment #58
RobRoy CreditAttribution: RobRoy commented@Dries, what's the word on hook_link()s? Should we change those to sentence as well? For example, "Add new comment", etc. so they are consistent?
Comment #59
Dries CreditAttribution: Dries commentedI'm OK with updating links to, as long we add it to the guidelines and as long we use sentence capitalization.
Comment #60
flk CreditAttribution: flk commentedhmmm i am bit confused now...
we can do hook_link etc in another patch...but what more is need for this patch to get in?
Comment #61
RobRoy CreditAttribution: RobRoy commentedShakur, we need to change all "Capitalized Menu Items" to "Capitalized menu items". I've already started this and will take another stab at finishing it later today if I can. I've already started doing the hook_link()s in the same patch as I'm just searching for 'title' => and it's easier. Should I separate them out you think?
Comment #62
webchickIf it's just a find/replace, go ahead and do them all in one go, imo.
Comment #63
RobRoy CreditAttribution: RobRoy commentedOkay, here is the whole patch with "Sentence capitalization" for menu titles, links, etc. I think I got them all but would appreciate someone else's eyes on this.
Comment #64
profix898 CreditAttribution: profix898 commentedThe patch does no longer apply cleanly.
And shouldnt we wrap the content type menu titles (e.g. node.module line 1071/1129) in
'title' => drupal_ucfirst(t($type->name))
to make sure these titles fit into the capitalization schema?Comment #65
RobRoy CreditAttribution: RobRoy commentedHere is a re-rolled patch. Regarding content types, new content types will be renamed in their respective modules. This patch covers core content types though.
Can we get a higher up (i.e. Dries) to check this out? Should be what he requested above. Thanks!
Comment #66
RobRoy CreditAttribution: RobRoy commentedHold off, bad patch. Arg...gimme one sec.
Comment #67
RobRoy CreditAttribution: RobRoy commentedHere we go.
Comment #68
Steven CreditAttribution: Steven commentedPersonally I think the "Sentence capitalization" for menu and page titles looks rather ugly. But it's better than lowercase :P.
The last patch was missing node and user module too. I fixed that.
Committed to HEAD.
Comment #69
webernet CreditAttribution: webernet commentedMissed a few in node.module...
Comment #70
profix898 CreditAttribution: profix898 commented... some more in node.module and one in user.module ...
Comment #71
moshe weitzman CreditAttribution: moshe weitzman commentedplease document this in the upgrade guide - http://drupal.org/node/64279
Comment #72
webchickLooks good.
Comment #73
Dries CreditAttribution: Dries commentedCommitted. Marking as 'code needs work' until this is documented. See Moshe's request.
Comment #74
RobRoy CreditAttribution: RobRoy commentedDone at http://drupal.org/node/64279#sentence_capitalization.
Sorry about that re-roll, I thought the second one I put up re-included the node/user stuff. Oh, well! :P
Comment #75
RobRoy CreditAttribution: RobRoy commentedOne more minor thing, I don't think we should be doing a drupal_ucfirst() on the node type name. These types are now being defined in "Sentence capitalization" so they will come in correctly and don't need to be forced. This is documented in the aforementioned handbook page.
Comment #76
RobRoy CreditAttribution: RobRoy commentedToo hasty as usual. Found another spot where there was a ucfirst but no t() around node type. Fixed that too.
Not sure about t() around node type name, but it was already there in the first spot so I just made it consistent. Should we remove those t()s?
Comment #77
Steven CreditAttribution: Steven commentedI think this is when are using the internal node type identifier (e.g. forum) instead of the human-readable name "Forum topic". The $node->type should not be presented in the UI and never t()'d.
It seems to me this is because the module .info API is somewhat broken, as there is no easy way to retrieve a single info field for a module, without using module_rebuild_cache(). That's too heavy and potentially even destructive to call at random times IMO.
Comment #78
RobRoy CreditAttribution: RobRoy commentedOkay, in that last patch I only have t() around the node type name, not the node type type so I think it's okay. Do you agree?
Comment #79
RobRoy CreditAttribution: RobRoy commentedSome capitalization stuff got reverted in user.module. Here is a simlple patch to fix it.
Comment #80
chx CreditAttribution: chx commentedApplies. 'Works' as intended -- no code change.
Comment #81
RobRoy CreditAttribution: RobRoy commentedAdded that 'page' and 'story' type names are capitalized in system_install()... it was only in the update_X() before.
Comment #82
chx CreditAttribution: chx commentedComment #83
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #84
Dries CreditAttribution: Dries commentedComment #85
(not verified) CreditAttribution: commented