Füge Debug-Logs für Alters- und Geschlechtsbezeichnungen in FalukantWidget hinzu
This commit is contained in:
@@ -48,9 +48,28 @@ export default {
|
|||||||
// Altersabhängige, (auf Wunsch) altertümlichere Bezeichnungen
|
// Altersabhängige, (auf Wunsch) altertümlichere Bezeichnungen
|
||||||
const years = this._ageYearsFromWidgetValue(this.falukantData?.age);
|
const years = this._ageYearsFromWidgetValue(this.falukantData?.age);
|
||||||
const group = years == null ? null : this._getAgeGroupKey(years);
|
const group = years == null ? null : this._getAgeGroupKey(years);
|
||||||
|
|
||||||
|
// Debug: Zeige, ob age->years->group korrekt ist und ob i18n keys aufgelöst werden
|
||||||
|
try {
|
||||||
|
const cfg = this.$t('falukant.genderAge.ageGroups');
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('[FalukantWidget] genderAge', {
|
||||||
|
locale: this?.$i18n?.locale,
|
||||||
|
rawAge: this.falukantData?.age,
|
||||||
|
years,
|
||||||
|
group,
|
||||||
|
gender: g,
|
||||||
|
ageGroups: cfg
|
||||||
|
});
|
||||||
|
} catch (_) {}
|
||||||
|
|
||||||
if (group && (g === 'female' || g === 'male')) {
|
if (group && (g === 'female' || g === 'male')) {
|
||||||
const key = `falukant.genderAge.${g}.${group}`;
|
const key = `falukant.genderAge.${g}.${group}`;
|
||||||
const t = this.$t(key);
|
const t = this.$t(key);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('[FalukantWidget] gender label lookup', { key, resolved: t });
|
||||||
|
|
||||||
if (t !== key) return t;
|
if (t !== key) return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +83,15 @@ export default {
|
|||||||
if (ageValue == null) return '—';
|
if (ageValue == null) return '—';
|
||||||
const years = this._ageYearsFromWidgetValue(ageValue);
|
const years = this._ageYearsFromWidgetValue(ageValue);
|
||||||
if (years == null) return '—';
|
if (years == null) return '—';
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('[FalukantWidget] age label', {
|
||||||
|
locale: this?.$i18n?.locale,
|
||||||
|
rawAge: ageValue,
|
||||||
|
years,
|
||||||
|
yearsLabel: this.$t('falukant.overview.metadata.years')
|
||||||
|
});
|
||||||
|
|
||||||
return `${years} ${this.$t('falukant.overview.metadata.years')}`;
|
return `${years} ${this.$t('falukant.overview.metadata.years')}`;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user