Modify

Opened 7 years ago

Last modified 7 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 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Xapitoun

Attachment: name_case.png added

comment:1 Changed 7 years ago by Don-vip

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

comment:2 Changed 7 years ago by naoliv

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)

comment:3 in reply to:  2 ; Changed 7 years ago by Don-vip

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 ?

comment:4 in reply to:  3 Changed 7 years ago by anonymous

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.
to The owner will be changed from team to the specified user.
The owner will change to Xapitoun
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.