Skip to content
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

Normalising all uppercase to capitalised #13

Open
fbittencourthersan opened this issue Jul 8, 2019 · 2 comments
Open

Normalising all uppercase to capitalised #13

fbittencourthersan opened this issue Jul 8, 2019 · 2 comments

Comments

@fbittencourthersan
Copy link

At the moment we format our contacts as follows:
Individuals: First name capitalised, last name uppercase
Organisations: All in uppercase

But so far we have been doing this formatting manually, which takes quite a lot of time, and want to change to a new formatting system where we capitalise the first letter of each word of all names. We thought the Civinormalise extension might help us do this but it doesn't seem to work to revert all uppercase names to sentence case.

Screen Shot 2019-07-08 at 15 57 05
Screen Shot 2019-07-08 at 15 57 26

@MegaphoneJon
Copy link
Contributor

@fbittencourthersan I wrote a patch for this but it wasn't accepted, and I never followed up to make it something that could be merged in. But #3 should work for you if you'd like to apply that patch.

@lkuttner
Copy link

I tried the suggested patch, but found it was negating proper case of names beginning with D', O', "Mc, etc.
As an alternative, I added a check for all-caps to existing line 152:
if ((in_array(strtolower($word), $handles)) || (ctype_upper($word))) {
$word = strtolower($word); }
This works well in the testing I have done.
I also added additional variations to existing line 124
$delimiters = array( "-", ".", "D'", "O'", "Mc", "Mac", "A'", "J'", "L'", " ",);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants