Monica: Relationship naming fallback in non-gender case

Created on 17 Nov 2019  路  3Comments  路  Source: monicahq/monica

Is your feature request related to a problem? Please describe.

I just came across the following case while importing my whole extended family and defining some relationships between them. If contacts don't have a gender defined, it seems like their relationship designation always defaults to the male version (brother, father, etc.).

Describe the solution you'd like
It is super cumbersome for me to define genders of all my contacts just to not have my aunt show up as an uncle -- would it be possible for there to be a gender-neutral fallback for this case that is always correct? E.g., sibling instead of brother, parent instead of father, ..., etc.?

Not sure if this conflicts with the way it is currently implemented, but I feel like the current UI forces me to edit all my contacts one by one just to "correct" the gendered relationship for all female family members, instead of it being neutral until properly defined which is much less of a "pressure to clean up" because it's not "incorrect".

Additional context
References #287 but I felt this was slightly different in scope.

Most helpful comment

This is something that would require a bit of work behind the scenes because its using the translation files to display.

https://github.com/monicahq/monica/blob/24bd12b76d261604885ede8192c8719f03cc7441/resources/lang/en/app.php#L167-L170

This is the function that controls which version is returned:

https://github.com/monicahq/monica/blob/68ac2539711bcc1eff15e5b5c8eac11d25beee21/app/Models/Relationship/RelationshipType.php#L72-L116

So you could probably just add two lines to each gender-delineated translation group. Like:

 'relationship_type_parent' => 'parent',
 'relationship_type_parent_male' => 'father', 
 'relationship_type_parent_female' => 'mother', 
 'relationship_type_parent_with_name' => ':name鈥檚 parent', 
 'relationship_type_parent_male_with_name' => ':name鈥檚 father' 
 'relationship_type_parent_female_with_name' => ':name鈥檚 mother',

But if you want to get neutral with the translation names, it will take a lot more work, and it will impact several database tables. Also for some term's you don't have common titles (in english at least), so it could be confusing.

'relationship_type_nibling' => 'nibling',
'relationship_type_nibling_male' => 'nephew',
'relationship_type_nibling_female' => 'niece',
'relationship_type_nibling_with_name' => ':name鈥檚 nibling',
'relationship_type_nibling_male_with_name' => ':name鈥檚 nephew',
'relationship_type_nibling_female_with_name' => ':name鈥檚 niece',

So in short, possible, but it'll take a little thought to accomplish.

All 3 comments

This is something that would require a bit of work behind the scenes because its using the translation files to display.

https://github.com/monicahq/monica/blob/24bd12b76d261604885ede8192c8719f03cc7441/resources/lang/en/app.php#L167-L170

This is the function that controls which version is returned:

https://github.com/monicahq/monica/blob/68ac2539711bcc1eff15e5b5c8eac11d25beee21/app/Models/Relationship/RelationshipType.php#L72-L116

So you could probably just add two lines to each gender-delineated translation group. Like:

 'relationship_type_parent' => 'parent',
 'relationship_type_parent_male' => 'father', 
 'relationship_type_parent_female' => 'mother', 
 'relationship_type_parent_with_name' => ':name鈥檚 parent', 
 'relationship_type_parent_male_with_name' => ':name鈥檚 father' 
 'relationship_type_parent_female_with_name' => ':name鈥檚 mother',

But if you want to get neutral with the translation names, it will take a lot more work, and it will impact several database tables. Also for some term's you don't have common titles (in english at least), so it could be confusing.

'relationship_type_nibling' => 'nibling',
'relationship_type_nibling_male' => 'nephew',
'relationship_type_nibling_female' => 'niece',
'relationship_type_nibling_with_name' => ':name鈥檚 nibling',
'relationship_type_nibling_male_with_name' => ':name鈥檚 nephew',
'relationship_type_nibling_female_with_name' => ':name鈥檚 niece',

So in short, possible, but it'll take a little thought to accomplish.

Oh, and additionally, the vast majority of relationships don't have gender-specific terms, so it'll be a lot of redundancy, that may or may not be wanted.

https://github.com/monicahq/monica/blob/24bd12b76d261604885ede8192c8719f03cc7441/resources/lang/en/app.php#L119-L265

Though, this could be a good time to refactor and simplify this whole system. Which would definitely be a lot of work.

Oh, wow - I didn't expect it to have that much of an impact. :sweat_smile:

I don't expect this to be integrated just based on my suggestion above, I assumed it was going to be a potential low hanging fruit. If a major refactoring of this sort is in the making, could we just add this to the backlog for things to consider?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PM232 picture PM232  路  3Comments

Svarto picture Svarto  路  3Comments

asbiin picture asbiin  路  4Comments

TheGP picture TheGP  路  3Comments

dnykanen picture dnykanen  路  3Comments