-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Title case option which also operates on uppercase words #16539
Comments
Author Name: Borys Jurgiel (@borysiasty) I wouldn't expect the title() function will convert upper case characters to lower case. It would be a regression, as you couldn't create labels like "Quantum GIS Headquarters". In your case you can simply use: title(lower(lga_name)) I'm closing the ticket, but of course feel free to reopen if you disagree or I misunderstood something.
|
Author Name: Borys Jurgiel (@borysiasty)
|
Author Name: Larry Shaffer (Larry Shaffer) Hi Nyall, The Title case used there in labeling is Qt's 'Capitalize' from "QFont enum Capitalization":http://qt-project.org/doc/qt-4.7/qfont.html#id-467833f3-6151-4157-a9f3-8dad38515ff7:
However, this differs from how page-layout programs and the 'title' function in the Expression editor work. Usually, setting "title case will convert uppercase letters to lowercase":http://grammar.about.com/od/tz/g/Title-Case.htm, as is done in the title function. I propose to rename the Title function Nyall refers to as 'Capitalize' or 'Capitalize first letter' instead, so there is no confusion.
|
Author Name: Nyall Dawson (@nyalldawson) Borys - that makes sense, but as Larry pointed out it's a bit confusing for users. My vote would be to change the wording to "Capitalize first letter", since that makes it a bit clearer that it only applies to the first letter and not the rest of the letters. |
Author Name: Nyall Dawson (@nyalldawson) Borys - after thinking about this, I'm a little puzzled what the use case is for your example. Are you saying you have a value in your table with mixed but predominantly lower-case characters ("quantum GIS headquarters")? Wouldn't it be much more common to have either all lower-case or all upper-case values in a table? Or is this function designed more for converting sentences like "Located at quantum GIS headquarters."? |
Author Name: Borys Jurgiel (@borysiasty) Maybe my example was too abstract, better one would be POI names that are sometimes acronyms. I prefer to be forced to use the two functions capitalize(lower(lga_name)) over having no way to preserve acronyms. Of course the best would be to have both capitalize() and title(). But maybe it's not so important. Usually I have the luck to work on properly prepared data, so I don't have much experience with correcting poor data at this stage. I don't insist anymore :) |
Author Name: Nyall Dawson (@nyalldawson) Lucky -- Almost all the data I work with is poorly formatted! Anyway, I think the best resolution would be renaming Title case -> Capitalize First Letter for now, and then ideally adding a proper "Title case" option after 2.0. We could even make it handle fancy things like not capitalizing "a" or "the" when they're in the middle of a string... |
Author Name: Jürgen Fischer (@jef-n)
|
Author Name: Alister Hood (@AlisterH)
|
Author Name: Giovanni Manghi (@gioman)
|
rename the confusing "Capitalize First Letter" option to "Force First Letter to Capital" This change is intended to clarify the role of the "capitalize first letter" option, and to provide an option which actually does what users expect the "capitalize first letter" option to do. Fixes qgis#16539
rename the confusing "Capitalize First Letter" option to "Force First Letter to Capital" This change is intended to clarify the role of the "capitalize first letter" option, and to provide an option which actually does what users expect the "capitalize first letter" option to do. Fixes #16539
Author Name: Nyall Dawson (@nyalldawson)
Original Redmine Issue: 7611
Redmine category:labelling
Setting a type case of "Title case" has no effect on the way labels are rendered when the text is already in upper case. For example, in the attached image "KNOX" is rendered as "KNOX", not "Knox". The other case settings (All uppercase/lowercase) work as expected.
EDIT
As discussed, "Title case" has been renamed "capitalize first letter", so this is now a feature request for a "Title case" feature, which would also lowercase subsequent letters.
Related issue(s): #16632 (relates), #17606 (relates), #20900 (duplicates)
Redmine related issue(s): 7724, 8938, 12804
The text was updated successfully, but these errors were encountered: