Enhance FalukantWidget gender label logic and add age-based labels: Updated gender label computation to include age-based distinctions for children and adults. Added new translation key for "years" in both German and English locale files.
This commit is contained in:
@@ -44,6 +44,15 @@ export default {
|
|||||||
falukantGenderLabel() {
|
falukantGenderLabel() {
|
||||||
const g = this.falukantData?.gender;
|
const g = this.falukantData?.gender;
|
||||||
if (g == null || g === '') return '—';
|
if (g == null || g === '') return '—';
|
||||||
|
|
||||||
|
// Altersabhängige Bezeichnung (sprachlich natürlicher im Widget)
|
||||||
|
// Default: unter 18 = Junge/Mädchen, sonst Mann/Frau
|
||||||
|
const age = Number(this.falukantData?.age);
|
||||||
|
const isChild = !Number.isNaN(age) && age < 18;
|
||||||
|
if (g === 'female') return isChild ? 'Mädchen' : 'Frau';
|
||||||
|
if (g === 'male') return isChild ? 'Junge' : 'Mann';
|
||||||
|
|
||||||
|
// Fallback auf vorhandene Übersetzungen
|
||||||
const key = `falukant.create.${g}`;
|
const key = `falukant.create.${g}`;
|
||||||
const t = this.$t(key);
|
const t = this.$t(key);
|
||||||
return t === key ? this.$t(`general.gender.${g}`) || g : t;
|
return t === key ? this.$t(`general.gender.${g}`) || g : t;
|
||||||
|
|||||||
@@ -119,6 +119,7 @@
|
|||||||
"name": "Name",
|
"name": "Name",
|
||||||
"money": "Vermögen",
|
"money": "Vermögen",
|
||||||
"age": "Alter",
|
"age": "Alter",
|
||||||
|
"years": "Jahre",
|
||||||
"mainbranch": "Heimatstadt",
|
"mainbranch": "Heimatstadt",
|
||||||
"nobleTitle": "Stand"
|
"nobleTitle": "Stand"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -93,6 +93,11 @@
|
|||||||
"children": "Children",
|
"children": "Children",
|
||||||
"children_unbaptised": "Unbaptised children"
|
"children_unbaptised": "Unbaptised children"
|
||||||
},
|
},
|
||||||
|
"overview": {
|
||||||
|
"metadata": {
|
||||||
|
"years": "years"
|
||||||
|
}
|
||||||
|
},
|
||||||
"health": {
|
"health": {
|
||||||
"amazing": "Amazing",
|
"amazing": "Amazing",
|
||||||
"good": "Good",
|
"good": "Good",
|
||||||
|
|||||||
Reference in New Issue
Block a user