Neriderc / GVExport

Repository for GVExport module for Webtrees
GNU General Public License v2.0
15 stars 6 forks source link

Add option for short versions of names #158

Closed Neriderc closed 2 years ago

Neriderc commented 2 years ago

We could add an option to abbreviate names. This would work much like the current option to abbreviate place names.

Options we could have:

Neriderc commented 2 years ago

I have updated the description to use the terminology "Given names" and "Surnames" instead of "First names" and "Last names" to match the language used in webtrees (and because the meaning of first/last becomes less clear in cultures that put names in a different order)

hartenthaler commented 2 years ago

From my point of view this is now the most important issue. To hide everything besides a very short name (and maybe the image) would generate very dense diagrams, we have never seen before in webtrees (maybe beside TAM and LIN).

But name processing is a non-trivial task. I had a similar problem in my module "extended family". There is an option in my module to use a short name for the proband of the extended family (instead of the full, long name). The functions can be found in https://github.com/hartenthaler/hh_extended_family/blob/main/src/Factory/Objects/ProbandName.php. Maybe this can be helpful for this issue.

Neriderc commented 2 years ago

Thanks! I had not even considered that we may need to have some prioritisation between the first word of the given names, the preferred name, and the nick name. My plan was to simply use the first word of the given names.

We probably need more clarity on what we think each option should show.

  • Initials

Are nick names included in initials? I would expect not. So for example if someone had the name 'Frank John "Johnny" Smith', their initials would be "FJS" (or "F.J.S."?)?

  • Given name initials and last name

For the above example, this would be "FJ Smith"?

  • First given name only

Would this be just the first word of the given names, and perhaps add another option called something like "Prioritised first name" that would be the nickname, or if no nickname then the first preferred name (or all preferred names?), or if no preferred names then the first word of their given names?

  • Given name and middle names

I imagined this to be everything in the "Given names" field, but should we be stripping out nick names here?

  • Surname only

No given names, I hope this is straight forward.

  • Don't show names

No names, straight forward.

Any thoughts?

hartenthaler commented 2 years ago

I had not even considered that we may need to have some prioritisation between the first word of the given names, the preferred name, and the nick name. My plan was to simply use the first word of the given names.

It was my idea to find a nice short name for the proband in the extended family. I don't expect that you will follow it. The reason behind this was, that sometimes there are no given names or no surnames or even no names at all or there is more than one name. Then you have to decide what to do. If there is a preferred first name (like a German Rufname) then it would be better to use this instead of the first given name. So my decision for my module was to allow the admin to select "nice name/full name" and do all the logic to find a nice short name algorithmically. This is not a general solution for GVExport, but could maybe be considered as an additional option besides the others.

I found some information at https://en.wikipedia.org/wiki/Middle_name.

First decision: if there is more than one NAME tag for a person, use the first name only.

Second decision: what about NAME tags like "/surname/ given names" like in Chinese names? I don't know.

Initials: Are nick names included in initials? I would expect not. So for example if someone had the name 'Frank John "Johnny" Smith', their initials would be "FJS" (or "F.J.S."?)?

Yes, no nicknames, no Rufname, not more than the first two given names. No dots; like JFK for John Fitzgerald Kennedy). If the first given name is a compound name, like in "Hans-Jürgen Müller-Lüdenscheid", use those for the initials, ie HJML. If the surname has more than one word, like in "José García Pérez", ie "JGP". Use the first two surnames only. So the initials can be "", "A", "AB", "ABC", "ABCD".

Given name initials and last name: For the above example, this would be "FJ Smith"?

No, I would prefer in this case dots. so it would be "F. J. Smith". Again not more than the first two given names, but the surname as it is in the NAME tag. Another example "H.-J. Müller-Lüdenscheid".

First given name only: Would this be just the first word of the given names, and perhaps add another option called something like "Prioritised first name" that would be the nickname, or if no nickname then the first preferred name (or all preferred names?), or if no preferred names then the first word of their given names?

Yes. Good idea: option (strictly first given name) and sub-option (if there is a preferred given name or a nickname then use that instead).

Given name and middle names: I imagined this to be everything in the "Given names" field, but should we be stripping out nick names here?

Yes, strip out nicknames marked by ", ie 'Josef "Sepp" Schindler' should become 'Josef'. No other manipulation of given or middle names. Keep preferred given names, ie "Maria Magda Baur" becomes "Maria Magda" and would be displayed as "Maria Magda" with underlined Magda.

Surname only: No given names, I hope this is straight forward.

Yes. But it should be plural: "Surnames". Keep from the NAME tag only the part between the two "/", ie "1 NAME José /García Pérez/" becomes "García Pérez".

Don't show names: No names, straight forward.

Yes.

Neriderc commented 2 years ago

Great. This will be a bit of work and especially trial and error getting things how we want. I won't put in the next release (which I'm almost ready for) but will work on this for the following one.

Neriderc commented 2 years ago

I have completed this and pushed to the main branch, though as always with this sort of thing, I am sure we will want to make refinements.

hartenthaler commented 2 years ago

I am sure we will want to make refinements.

This is a big step to have very dense diagrams. I like it!

I have only three points:

Neriderc commented 2 years ago

if there is no given name, @P.N. is shown; if there is no surname, @N.N. is shown; as initial in those cases @ is used; I would prefer to show the unique character "..." (ellipsis?) instead.

Ok that should be easy enough to do.

if you switch off everything (no name, no birth, no death information) in order to see only photos, the photos are not shown.

I'll take a look at this. I imagine it's easy enough to fix.

if you switch off everything there are small boxes, but between the arrows and the boxes, there are too big gaps.

I had a bit of a play at the time but I didn't find an easy way to do this. In theory, this should be the nodesep and ranksep values (which we renamed to space between individuals/generations). But these seem to have some minimum value that it won't go below. It probably require a bit more research in the DOT format, but the answer may be to make the squares bigger then scale everything down. I'll look more into options.

Neriderc commented 2 years ago

I've made these changes in a pull request I've merged into the main branch.

For the last one, I have increased the size of the boxes, and to help with the display in the browser I've changed the zoom setting to let you zoom out more.

For output files, you can change the DPI if it's too high resolution.