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() {
|
||||
const g = this.falukantData?.gender;
|
||||
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 t = this.$t(key);
|
||||
return t === key ? this.$t(`general.gender.${g}`) || g : t;
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
"name": "Name",
|
||||
"money": "Vermögen",
|
||||
"age": "Alter",
|
||||
"years": "Jahre",
|
||||
"mainbranch": "Heimatstadt",
|
||||
"nobleTitle": "Stand"
|
||||
},
|
||||
|
||||
@@ -93,6 +93,11 @@
|
||||
"children": "Children",
|
||||
"children_unbaptised": "Unbaptised children"
|
||||
},
|
||||
"overview": {
|
||||
"metadata": {
|
||||
"years": "years"
|
||||
}
|
||||
},
|
||||
"health": {
|
||||
"amazing": "Amazing",
|
||||
"good": "Good",
|
||||
|
||||
Reference in New Issue
Block a user