News for hackers. Stuff that matters.
Re:In the Turkish locale, "INFO".lower() != "info" by asveikau on Sunday August 16, 2020 @05:44PM (#24181616)
> you can convert to title case or ... for display purposes.

I am skeptical if someone thinks they need to do this and how they will get it done.

Eg. Looping through and capitalizing the first gylph after breaking whitespace regardless of locale is not the way to go, but I guarantee you a nontrivial amount of people reading this would write exactly that if asked to solve the high level problem.

I find it annoying when software or even in some cases human typists try to enforce English language title case. Some other languages have different rules for titles and capitalization and seeing the English rules enforced out of context can be jarring.

Re:In the Turkish locale, "INFO".lower() != "info" by crazygringo on Sunday August 16, 2020 @07:14PM (#24182204)
I find it amusing you are skeptical... why so distrustful? But believe me, it's quite necessary.

I use the citation manager Zotero a lot. It's necessary to store all the titles of journal articles and books in sentence case (e.g. "Issues regarding the economy of France") because some publications require citations to use sentence style (remains unchanged) while others require title style ("Issues Regarding the Economy of France").

And obviously the solution cannot be naive, but is language-dependent, so that in English words like "the" or "in" don't get capitalized. And as the rules for titles are obviously language-dependent, so it goes without saying that the algorithm would have to be localized.

(Note that while it's relatively trivial to convert from sentence case to title case in English, it's impossible to automate in the opposite direction, because you never know if a capitalized term in the title is a proper noun or not.)

Re:In the Turkish locale, "INFO".lower() != "info" by a1369209993 on Monday August 17, 2020 @11:39AM (#24188256)
> (Note that while it's relatively trivial to convert from sentence case to title case in English[...])

Strictly speaking you can't do that either:

  "Latine et videtur".totitle = "Latine et Videtur"
  "I et some food".totitle = "I Et Some Food"
I suspect that fails less often though.
Re:In the Turkish locale, "INFO".lower() != "info" by dragonwriter on Sunday August 16, 2020 @08:14PM (#24182519)
> I am skeptical if someone thinks they need to do this and how they will get it done.

It's not an uncommon requirement, though probably not often in a locale sensitive way, so you can often get away with just doing the right thing for one locale.

To do it generally, you probably need to research appropriate handling per locale (likely, what your client wants done in the particular locale, since I'm not sure there is usually just one way; I know there are multiple variations in en-US), and then have a master function that takes the text and target locale and applies the correct locale-specific title casing rules.

Re:In the Turkish locale, "INFO".lower() != "info" by layer8 on Sunday August 16, 2020 @07:27PM (#24182283)
> I am skeptical if someone thinks they need to do this and how they will get it done

I most often use title case mappings in the context of replacements of names into diagnostic messages. I.e. you have n types of objects and m messages like “${foo} not found” or “More than one ${foo} required”, and perform title case mapping on ${foo} depending on whether it is at the start of the message (sentence) or not.

Re:In the Turkish locale, "INFO".lower() != "info" by Groxx on Sunday August 16, 2020 @07:17PM (#24182215)
While I agree it's almost always a bad idea: effectively every design team I've encountered has requested stuff like this.

So yes, it's extremely common. It's done on tons of websites, for tons of mail addresses (ever receive an all-uppercase address on a delivery? same issue.), and tons and tons and tons of emails and legal documents (woe to those with last names like McCormick).