Adjust translation logic for gender in vue components

This commit is contained in:
2024-10-01 13:35:06 +02:00
parent 5fce9ee9fb
commit a47c8d916b
9 changed files with 13 additions and 44 deletions

View File

@@ -39,7 +39,7 @@
<p v-if="options.addInfo === true" class="moreinfo">
<gender-icon-render-box v-if="person.gender" :gender="person.gender"></gender-icon-render-box>
<time v-if="person.birthdate && !person.deathdate" :datetime="person.birthdate" :title="birthdate">
{{ $t(getGenderTranslation) + ' ' + $d(birthdate, 'text') }}
{{ $t(`renderbox.birthday.${person.gender.genderTranslation}`) + ' ' + $d(birthdate, 'text') }}
</time>
<time v-else-if="person.birthdate && person.deathdate" :datetime="person.deathdate"
@@ -223,15 +223,6 @@ export default {
return false
}
},
/* getGenderIcon: function () {
return this.person.gender === 'woman' ? 'fa-venus' : this.person.gender === 'man' ? 'fa-mars' : this.person.gender === 'both' ? 'fa-neuter' : 'fa-genderless';
},*/
getGenderTranslation: function () {
return this.person.gender === 'woman' ? 'renderbox.birthday.woman' : 'renderbox.birthday.man';
},
getGender() {
return this.person.gender === 'woman' ? 'person.gender.woman' : this.person.gender === 'man' ? 'person.gender.man' : this.person.gender === 'both' ? 'person.gender.both' : 'person.gender.undefined';
},
birthdate: function () {
if (this.person.birthdate !== null || this.person.birthdate === "undefined") {
return ISOToDate(this.person.birthdate.datetime);

View File

@@ -300,13 +300,13 @@ export default {
}
},
genderTranslation() {
switch (this.person.gender) {
switch (this.person.gender.genderTranslation) {
case 'woman':
return 'person.gender.woman';
case 'man':
return 'person.gender.man';
case 'both':
return 'person.gender.both';
case 'neutral':
return 'person.gender.neutral';
case 'unknown':
return 'person.gender.unknown';
default: