Add localization for marriage gift, lover maintenance, and household order: Update German, English, and Spanish translation files to include new terms related to marriage and household management. Enhance MoneyHistoryView to improve activity translation handling with additional candidate formats.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -95,17 +95,31 @@ export default {
|
||||
}
|
||||
},
|
||||
translateActivity(activity) {
|
||||
// Handle nested keys like "health.pill" -> "health.pill"
|
||||
const key = `falukant.moneyHistory.activities.${activity}`;
|
||||
const candidates = [activity];
|
||||
|
||||
if (typeof activity === 'string') {
|
||||
candidates.push(activity.replaceAll('_', ' '));
|
||||
candidates.push(activity.replaceAll(' ', '_'));
|
||||
}
|
||||
|
||||
for (const candidate of candidates) {
|
||||
const key = `falukant.moneyHistory.activities.${candidate}`;
|
||||
const translation = this.$t(key);
|
||||
// If translation is the same as key, try nested structure
|
||||
if (translation === key && activity.includes('.')) {
|
||||
const parts = activity.split('.');
|
||||
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);
|
||||
return nestedTranslation !== nestedKey ? nestedTranslation : activity;
|
||||
if (nestedTranslation !== nestedKey) {
|
||||
return nestedTranslation;
|
||||
}
|
||||
return translation !== key ? translation : activity;
|
||||
}
|
||||
}
|
||||
|
||||
return activity;
|
||||
},
|
||||
openGraphDialog() {
|
||||
this.$refs.graphDialog.open();
|
||||
|
||||
Reference in New Issue
Block a user