diff --git a/frontend/src/i18n/locales/de/falukant.json b/frontend/src/i18n/locales/de/falukant.json index 012e5a8..3866b6c 100644 --- a/frontend/src/i18n/locales/de/falukant.json +++ b/frontend/src/i18n/locales/de/falukant.json @@ -753,7 +753,12 @@ "build_vehicles": "Transportmittel gebaut", "transport": "Transport", "Marriage cost": "Heiratskosten", + "marriage_gift": "Geschenk an Ehepartner", "Gift cost": "Geschenk-Kosten", + "lover maintenance": "Unterhalt für Liebschaft", + "servants_monthly": "Dienerschaft bezahlt", + "servants_hired": "Diener eingestellt", + "household_order": "Haus geordnet", "housebuy": "Hauskauf", "Baptism": "Taufe", "credit taken": "Kredit aufgenommen", diff --git a/frontend/src/i18n/locales/en/falukant.json b/frontend/src/i18n/locales/en/falukant.json index 4fef96e..df4ac1c 100644 --- a/frontend/src/i18n/locales/en/falukant.json +++ b/frontend/src/i18n/locales/en/falukant.json @@ -171,7 +171,12 @@ "build_vehicles": "Transport vehicles built", "transport": "Transport", "Marriage cost": "Marriage cost", + "marriage_gift": "Gift for spouse", "Gift cost": "Gift cost", + "lover maintenance": "Lover maintenance", + "servants_monthly": "Servants paid", + "servants_hired": "Servants hired", + "household_order": "Household ordered", "housebuy": "House purchase", "Baptism": "Baptism", "credit taken": "Credit taken", diff --git a/frontend/src/i18n/locales/es/falukant.json b/frontend/src/i18n/locales/es/falukant.json index 19e56ca..1f69336 100644 --- a/frontend/src/i18n/locales/es/falukant.json +++ b/frontend/src/i18n/locales/es/falukant.json @@ -720,7 +720,12 @@ "build_vehicles": "Medios de transporte construidos", "transport": "Transporte", "Marriage cost": "Costes de matrimonio", + "marriage_gift": "Regalo para el cónyuge", "Gift cost": "Coste de regalo", + "lover maintenance": "Manutención de amante", + "servants_monthly": "Pago de servidumbre", + "servants_hired": "Contratación de sirvientes", + "household_order": "Orden del hogar", "housebuy": "Compra de casa", "Baptism": "Bautizo", "credit taken": "Crédito solicitado", diff --git a/frontend/src/views/falukant/MoneyHistoryView.vue b/frontend/src/views/falukant/MoneyHistoryView.vue index bc939ad..04c6dbb 100644 --- a/frontend/src/views/falukant/MoneyHistoryView.vue +++ b/frontend/src/views/falukant/MoneyHistoryView.vue @@ -95,17 +95,31 @@ export default { } }, translateActivity(activity) { - // Handle nested keys like "health.pill" -> "health.pill" - const key = `falukant.moneyHistory.activities.${activity}`; - const translation = this.$t(key); - // If translation is the same as key, try nested structure - if (translation === key && activity.includes('.')) { - const parts = activity.split('.'); - const nestedKey = `falukant.moneyHistory.activities.${parts[0]}.${parts[1]}`; - const nestedTranslation = this.$t(nestedKey); - return nestedTranslation !== nestedKey ? nestedTranslation : activity; + const candidates = [activity]; + + if (typeof activity === 'string') { + candidates.push(activity.replaceAll('_', ' ')); + candidates.push(activity.replaceAll(' ', '_')); } - return translation !== key ? translation : activity; + + for (const candidate of candidates) { + const key = `falukant.moneyHistory.activities.${candidate}`; + const translation = this.$t(key); + if (translation !== key) { + return translation; + } + + if (candidate.includes('.')) { + const parts = candidate.split('.'); + const nestedKey = `falukant.moneyHistory.activities.${parts[0]}.${parts[1]}`; + const nestedTranslation = this.$t(nestedKey); + if (nestedTranslation !== nestedKey) { + return nestedTranslation; + } + } + } + + return activity; }, openGraphDialog() { this.$refs.graphDialog.open(); @@ -150,4 +164,4 @@ h2 { overflow: auto; height: 100%; } - \ No newline at end of file +