Web based family history software

Question Surnames full capitalization

  • yann64
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 10 months ago #1 by yann64
Surnames full capitalization was created by yann64
I regularly import Gedcom from different sources and sometimes surnames are fully capitalized, sometimes not.
As a matter of consistency, I try to keep all surnames fully capitalized.

It would be very handy if as an additional "Data fix" it could be possible to "Capitalize all surnames", as unless mistaken I don't think webtrees allows automating this tasks?

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #2 by fisharebest
Replied by fisharebest on topic Surnames full capitalization
You can change the display, rather than change the data.

Control panel -> Custom CSS and JS.
Add the following CSS:
Code:
<style> .SURN { text-transform: uppercase } </style>

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • hermann
  • Away
  • Elite Member
  • Elite Member
More
2 years 10 months ago #3 by hermann
Replied by hermann on topic Surnames full capitalization
The suggestion of Greg is much better than capitalizing the names. They should be written in the data in upper and lower case as usual. McNamara is ok, MCNAMARA is not ok for me.

Hermann
Designer of the custom module "Extended Family"

webtrees 2.1.21 (all custom modules installed, PHP 8.3.12, MariaDB 10.6) @ ahnen.hartenthaler.eu

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #4 by Sir Peter
Replied by Sir Peter on topic Surnames full capitalization
Hermann is correct. On page 54 GEDCOM 5.5.1 explicity says: Capitalize the name of a person or place in the conventional manner— capitalize the first letter of each part and lowercase the other letters, unless conventional usage is otherwise. For example: McMurray.

Changing all surnames to all uppercase like in MCMURRAY would elevate an error to the new standard.

@Greg, what about implementing a data fix that allows an admin to correct the all uppercase surnames - providing the admin with a list of "surname=uppercase(surname)" and corresponding checkboxes so that surnames like MCMURRAY could be excluded from the bulk change and handled manually.

Peter

Please Log in or Create an account to join the conversation.

More
2 years 10 months ago #5 by fisharebest
Replied by fisharebest on topic Surnames full capitalization
You can "fix" a single name using the search/replace datafix. e.g. "/SMITH/" => '/Smith/'.

(A more advance search would only do this on lines beginning "1 NAME")

But I can see complications trying to convert all names automatically.

We cannot convert certain letters to lowercase. For example, see en.wikipedia.org/wiki/Dotted_and_dotless_I

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 9 months ago #6 by Bogie
Replied by Bogie on topic Surnames full capitalization

It would be very handy if as an additional "Data fix" it could be possible to "Capitalize all surnames", as unless mistaken I don't think webtrees allows automating this tasks?

If you would like to find the records with capitalized surnames you could use a RegEx like
(2 SURN )([A-Z ]*$)

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #7 by WGroleau
Replied by WGroleau on topic Surnames full capitalization

If you would like to find the records with capitalized surnames you could use a RegEx like
(2 SURN )([A-Z ]*$)
That doesn’t work if, like me, you delete the completely redundant clutter of SURN (and every other subrecord of NAME except NICK and AKA).

--
Wes Groleau
UniGen.us/

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 9 months ago #8 by Bogie
Replied by Bogie on topic Surnames full capitalization
It was only meant as a means for finding surnames all capitalized which was brought up by yann64.

What are you looking for?

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #9 by WGroleau
Replied by WGroleau on topic Surnames full capitalization

… But I can see complications trying to convert all names automatically.

We cannot convert certain letters to lowercase. For example, see en.wikipedia.org/wiki/Dotted_and_dotless_I

Related: I recently encountered a large quantity of Greek text where a search function could not find word I knew were there. Eventually figured out every word that should have stated with one of the Greek letters ΕΥΙΟΚΗΑΖΧΒΝΜ instead started with the look-alike ASCII letter!

--
Wes Groleau
UniGen.us/

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #10 by WGroleau
Replied by WGroleau on topic Surnames full capitalization
The problem with the Turkish "Iiıİİ ıs a flaw ın Unicode. They use the ASCII value for Ii which means that a capitalization routine would have to look at context to decide what to do.

They should have done what they did with Greek. Using different code points for glyphs that look the same allows this to work:
Code:
~ echo "ΕΡΤΥΙΟΑΗΚΖΧΒΝΜ" | tr "[:upper:]" "[:lower:]" ερτυιοαηκζχβνμ ~ echo "ερτυιοαηκζχβνμ" | tr "[:lower:]" "[:upper:]" ΕΡΤΥΙΟΑΗΚΖΧΒΝΜ ~ echo "EPTYIOAHKZXBNM" | tr "[:upper:]" "[:lower:]" eptyioahkzxbnm

--
Wes Groleau
UniGen.us/

Please Log in or Create an account to join the conversation.

  • yann64
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 4 months ago #11 by yann64
Replied by yann64 on topic Surnames full capitalization
Sorry for reviving this old thread.

Here is the compromise I implemented on CSS:
Code:
<style> .SURN { text-transform: bolder } </style>
This way, we have a clear difference between first-names and surnames in languages where first-names can be used as surnames (like French).

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago - 1 year 7 months ago #12 by ef-five
Replied by ef-five on topic Surnames full capitalization

Sorry for reviving this old thread.

Here is the compromise I implemented on CSS:
Code:
<style> .SURN { text-transform: bolder } </style>
This way, we have a clear difference between first-names and surnames in languages where first-names can be used as surnames (like French).

I'll do you one better. Try this for bold and italics.
Code:
<style> .SURN { font-style: italic; font-weight: bold; } </style>

You could even give them a color if you wanted to like this.
Code:
<style> .SURN { font-style: italic; font-weight: bold; color: #00ff00;} </style>
Last edit: 1 year 7 months ago by ef-five.

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #13 by WGroleau
Replied by WGroleau on topic Surnames full capitalization
In the clouds theme, text-transform: bolder had no visible effect.

font-weight: bold; (without italics) was just barely visible.

--
Wes Groleau
UniGen.us/

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago - 1 year 7 months ago #14 by ef-five
Replied by ef-five on topic Surnames full capitalization
The same with the webtrees theme. With the webtrees theme there was no deference in the bold.

If you use one of those themes you could always use another color for the surnames like this.
Code:
<style> .SURN { font-style: italic; font-weight: bold; color: #0828b2;} </style>

For those that don't color codes you can do a web search for "color hex codes" and find lots of sites that list the codes.
Codes examples are like this for red #ff0000 for white #ffffff for black #000000. Always put a # before that numbers.
Last edit: 1 year 7 months ago by ef-five.

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum