Enhance notification display and localization in MessagesDialog component

- Updated the MessagesDialog component to display notifications with titles and descriptions, improving clarity and user experience.
- Enhanced the formatBody method to support new notification structures, including extraction and formatting of parameters for better message presentation.
- Added a new formatParams method to handle various parameter types, ensuring accurate representation of values in notifications.
- Updated localization files in both German and English to include structured titles and descriptions for random events, enriching the user experience with detailed information.
This commit is contained in:
Torsten Schulz (local)
2025-12-08 14:42:17 +01:00
parent bcb0b01324
commit 791314bef2
3 changed files with 238 additions and 25 deletions

View File

@@ -33,17 +33,50 @@
"waiting": "Transport wartet"
},
"random_event": {
"windfall": "Unerwarteter Geldsegen: Du hast {amount} erhalten!",
"theft": "Diebstahl: {amount} wurde aus deinem Lager gestohlen.",
"warehouse_fire": "Lagerfeuer: Ein Feuer hat dein Lager beschädigt. Verluste: {amount}.",
"character_illness": "Krankheit: {characterName} ist erkrankt.",
"character_recovery": "Genesung: {characterName} hat sich von der Krankheit erholt.",
"character_accident": "Unfall: {characterName} hatte einen Unfall.",
"sudden_infant_death": "Tragödie: {characterName} ist plötzlich verstorben.",
"regional_storm": "Regionaler Sturm: Ein schwerer Sturm hat die Region {regionName} getroffen.",
"regional_festival": "Regionales Fest: Ein Fest findet in {regionName} statt.",
"regional_epidemic": "Regionale Epidemie: Eine Epidemie hat {regionName} getroffen.",
"earthquake": "Erdbeben: Ein Erdbeben hat die Region {regionName} erschüttert."
"windfall": {
"title": "Unerwarteter Geldsegen",
"description": "Du findest eine vergessene Geldbörse auf der Straße. Du erhältst {amount}."
},
"theft": {
"title": "Diebstahl",
"description": "Ein Dieb hat einen Teil deines Geldes gestohlen. Verlust: {amount}."
},
"warehouse_fire": {
"title": "Lagerbrand",
"description": "Ein Feuer hat Teile deines Lagers beschädigt.{damagePercent}{destructionPercent}"
},
"character_illness": {
"title": "Krankheit",
"description": "{characterName} ist erkrankt und hat {healthChange} Gesundheit verloren."
},
"character_recovery": {
"title": "Genesung",
"description": "{characterName} hat sich von einer Krankheit erholt und {healthChange} Gesundheit zurückgewonnen."
},
"character_accident": {
"title": "Unfall",
"description": "Ein schwerer Unfall hat {characterName} schwer verletzt. Gesundheit: {healthChange}."
},
"sudden_infant_death": {
"title": "Plötzlicher Kindstod",
"description": "{characterName} ist plötzlich verstorben."
},
"regional_storm": {
"title": "Sturm in der Region",
"description": "Ein schwerer Sturm hat die Region {regionName} getroffen."
},
"regional_festival": {
"title": "Regionales Fest",
"description": "Ein großes Fest findet in der Region {regionName} statt."
},
"regional_epidemic": {
"title": "Epidemie",
"description": "Eine Seuche hat die Region {regionName} erfasst."
},
"earthquake": {
"title": "Erdbeben",
"description": "Ein Erdbeben hat die Region {regionName} erschüttert."
}
}
},
"health": {

View File

@@ -24,17 +24,50 @@
"waiting": "Transport waiting"
},
"random_event": {
"windfall": "Unexpected windfall: You received {amount}!",
"theft": "Theft: {amount} was stolen from your warehouse.",
"warehouse_fire": "Warehouse Fire: A fire has damaged your warehouse. Losses: {amount}.",
"character_illness": "Illness: {characterName} has fallen ill.",
"character_recovery": "Recovery: {characterName} has recovered from the illness.",
"character_accident": "Accident: {characterName} has had an accident.",
"sudden_infant_death": "Tragedy: {characterName} has suddenly passed away.",
"regional_storm": "Regional Storm: A severe storm has hit the region {regionName}.",
"regional_festival": "Regional Festival: A festival is taking place in {regionName}.",
"regional_epidemic": "Regional Epidemic: An epidemic has struck {regionName}.",
"earthquake": "Earthquake: An earthquake has shaken the region {regionName}."
"windfall": {
"title": "Unexpected Windfall",
"description": "You find a forgotten wallet on the street. You receive {amount}."
},
"theft": {
"title": "Theft",
"description": "A thief has stolen part of your money. Loss: {amount}."
},
"warehouse_fire": {
"title": "Warehouse Fire",
"description": "A fire has damaged parts of your warehouse.{damagePercent}{destructionPercent}"
},
"character_illness": {
"title": "Illness",
"description": "{characterName} has fallen ill and lost {healthChange} health."
},
"character_recovery": {
"title": "Recovery",
"description": "{characterName} has recovered from an illness and regained {healthChange} health."
},
"character_accident": {
"title": "Accident",
"description": "A serious accident has severely injured {characterName}. Health: {healthChange}."
},
"sudden_infant_death": {
"title": "Sudden Infant Death",
"description": "{characterName} has suddenly passed away."
},
"regional_storm": {
"title": "Storm in the Region",
"description": "A severe storm has hit the region {regionName}."
},
"regional_festival": {
"title": "Regional Festival",
"description": "A large festival is taking place in the region {regionName}."
},
"regional_epidemic": {
"title": "Epidemic",
"description": "A plague has struck the region {regionName}."
},
"earthquake": {
"title": "Earthquake",
"description": "An earthquake has shaken the region {regionName}."
}
}
},
"statusbar": {