Modify

Opened 10 years ago

Last modified 10 years ago

#9652 new enhancement

case of names

Reported by: Xapitoun Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: Cc:

Description (last modified by Don-vip)

In my country, Haiti, people use a lot uppercases letters to write the name of the amenities.
So, I will be nice if we have the option to change all the uppercases letters to have only uppercases in the first letter of the words:


Attachments (1)

name_case.png (22.1 KB ) - added by Xapitoun 10 years ago.

Download all attachments as: .zip

Change History (5)

by Xapitoun, 10 years ago

Attachment: name_case.png added

comment:1 by Don-vip, 10 years ago

Component: unspecifiedCore validator
Description: modified (diff)
Priority: minornormal

comment:2 by naoliv, 10 years ago

Here in Brazil we have the same problem.
I use this:

*[name =~ /^[A-Z0-9\s]*$/],
*["addr:street" =~ /^[A-Z0-9\s]*$/] {
        throwOther: tr("verify: {0} only with capital letters", "{0.key}");
}

The problem is that sometimes the name is indeed all uppercase (and an autofix would make it wrong)

in reply to:  2 ; comment:3 by Don-vip, 10 years ago

Replying to naoliv@…:

The problem is that sometimes the name is indeed all uppercase (and an autofix would make it wrong)

I assume it is the case for acronyms, then the presence of spaces should allow us to make the distinction ?

in reply to:  3 comment:4 by anonymous, 10 years ago

Replying to Don-vip:

I assume it is the case for acronyms, then the presence of spaces should allow us to make the distinction ?

Not on all cases (at least here). For example, people use a misc of short_name and name as name.
Instead using the full "Basic Health Care Unit The Full Name" they use "BHCU The Full Name" inside name. If we fix this it will stay as "Bhcu The Full Name".

Could the logic be improved to detect only one word in uppercase and ignore it?
Something like:

  • if only one word in name, all uppercase and no spaces (an acronym), ignore
  • if one word in uppercase and the others all in lowercase or only capitalized (first letter in uppercase), like the example above, ignore
  • if multiple uppercase words separated by space, then capitalize them

But I have one doubt: do apache.commons.lang.WordUtils (or other lib/function) identifies words that shouldn't be capitalized?
"FOO OF SOMETHING" should become "Foo of Something" instead "Foo Of Something".

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Xapitoun.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.