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

fix: check male translation and fall back to generic #6039

Merged

Conversation

codemonkeysoftware
Copy link

@codemonkeysoftware codemonkeysoftware commented Mar 3, 2022

Right now relationship type strings do not display a male version (eg. instead of "father" it displays parent). This is because the RelationshipType's getLocalizedName() code gets the female translation for female relationship types, but the generic translation for male relationship types. To complicate matters, only 13/28 relationship types include a male entry in the translation file.

This change has RelationshipType.getLocalizedName() return the male translation for the male version and adds the missing male translations for English. Because I don't want this change to break if the other translations don't get updated with the new keys immediately, it also includes a fallback that recognizes Laravel's default return for missing keys (which is the requested key name) and instead returns the generic translations. This fallback can be removed as soon as the male translation entries get added.

Fix #5956

@codemonkeysoftware codemonkeysoftware changed the title 5956 check male translation and fall back to generic fix: 5956 check male translation and fall back to generic Mar 3, 2022
Copy link
Member

@asbiin asbiin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

app/Models/Relationship/RelationshipType.php Outdated Show resolved Hide resolved
app/Models/Relationship/RelationshipType.php Outdated Show resolved Hide resolved
@asbiin asbiin changed the title fix: 5956 check male translation and fall back to generic fix: check male translation and fall back to generic Mar 11, 2022
@J4NS-R
Copy link

J4NS-R commented Apr 6, 2022

@asbiin @codemonkeysoftware What's the hold-up here? StyleCI has a small whitespace issue, but other than that this bugfix looks good to go

app/Models/Relationship/RelationshipType.php Outdated Show resolved Hide resolved
@asbiin asbiin merged commit 4ba9062 into monicahq:main May 6, 2022
@asbiin
Copy link
Member

asbiin commented May 6, 2022

Thank you @codemonkeysoftware !

@shaliru
Copy link

shaliru commented Aug 17, 2022

Sorry for stupid question, but how do I go about applying this fix to my installation? I'm on the latest version (v3.7.0) which was released in February - before this fix was was merged. Do I just drop the two changed files into my install directory?

@Bodge-IT
Copy link

Bodge-IT commented Dec 23, 2022

I'm 3.7.0 too, finding it difficult if I can't create proper relationships. I can exec into the container but have no edit tools in there and no clue how to mod an image.

EDIT:
OK, manually applied these changes to my docker container and it had no impact on dropdown options for male relationships.

What am I missing?

@github-actions
Copy link

🎉 This PR is included in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Feb 1, 2024

This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Male genders are not displayed correctly
5 participants