feat: füge Unterstützung für Lagerschaden hinzu und aktualisiere Übersetzungen in mehreren Sprachen
All checks were successful
Deploy to production / deploy (push) Successful in 2m16s
All checks were successful
Deploy to production / deploy (push) Successful in 2m16s
This commit is contained in:
@@ -184,6 +184,12 @@ export default {
|
||||
key = raw;
|
||||
}
|
||||
|
||||
// Fallback: use payload.type if present (e.g. storage_damage)
|
||||
if ((!raw || !String(raw).trim()) && payload?.type) {
|
||||
raw = String(payload.type);
|
||||
key = raw;
|
||||
}
|
||||
|
||||
// 1) JSON-Format unterstützen: {"tr":"random_event.windfall","amount":1000,"characterName":"Max"}
|
||||
if (typeof raw === 'string') {
|
||||
const trimmed = raw.trim();
|
||||
@@ -286,6 +292,24 @@ export default {
|
||||
if (params.storage_destruction_percent !== undefined) {
|
||||
formatted.destructionPercent = ` Lager zerstört: ${params.storage_destruction_percent.toFixed(1)}%.`;
|
||||
}
|
||||
// Storage damage specific numbers
|
||||
if (params.destroyed_inventory_units !== undefined) {
|
||||
formatted.destroyedInventoryUnits = new Intl.NumberFormat(navigator.language).format(Number(params.destroyed_inventory_units));
|
||||
}
|
||||
if (params.affected_stocks !== undefined) {
|
||||
formatted.affectedStocks = new Intl.NumberFormat(navigator.language).format(Number(params.affected_stocks));
|
||||
}
|
||||
if (params.destroyed_stocks !== undefined) {
|
||||
formatted.destroyedStocks = new Intl.NumberFormat(navigator.language).format(Number(params.destroyed_stocks));
|
||||
}
|
||||
if (params.stock_type !== undefined) {
|
||||
// Try to translate product type via i18n product keys if available
|
||||
const prodKey = `falukant.product.${params.stock_type}`;
|
||||
formatted.stockType = this.$te(prodKey) ? String(this.$t(prodKey)) : String(params.stock_type);
|
||||
}
|
||||
if (params.damage_reason !== undefined) {
|
||||
formatted.damageReason = String(params.damage_reason);
|
||||
}
|
||||
if (params.regionLabel) {
|
||||
formatted.regionLabel = isGerman
|
||||
? ` Ort: ${params.regionLabel}.`
|
||||
|
||||
@@ -72,6 +72,10 @@
|
||||
"title": "Sunog sa bodega",
|
||||
"description": "Ang sunog nakadaot sa bahin sa imong bodega.{damagePercent}{destructionPercent}"
|
||||
},
|
||||
"storage_damage": {
|
||||
"title": "Kadaut sa stock: {damage_reason}",
|
||||
"description": "{damage_reason}: {destroyedInventoryUnits} ka units ({stock_type}) naapektuhan sa {affectedStocks} ka stock, {destroyedStocks} ang na-destroy. {damagePercent}{destructionPercent}"
|
||||
},
|
||||
"character_illness": {
|
||||
"title": "Sakit",
|
||||
"description": "Nagsakit si {characterName} ug nawad-an og {healthChange} panglawas."
|
||||
|
||||
@@ -74,6 +74,10 @@
|
||||
"title": "Lagerbrand",
|
||||
"description": "Ein Feuer hat Teile deines Lagers beschädigt.{damagePercent}{destructionPercent}"
|
||||
},
|
||||
"storage_damage": {
|
||||
"title": "Lagerschaden: {damage_reason}",
|
||||
"description": "{damage_reason}: {destroyedInventoryUnits} Einheiten ({stock_type}) betroffen in {affectedStocks} Lager, davon {destroyedStocks} vollständig zerstört. {damagePercent}{destructionPercent}"
|
||||
},
|
||||
"character_illness": {
|
||||
"title": "Krankheit",
|
||||
"description": "{characterName} ist erkrankt und hat {healthChange} Gesundheit verloren."
|
||||
|
||||
@@ -72,6 +72,10 @@
|
||||
"title": "Warehouse Fire",
|
||||
"description": "A fire has damaged parts of your warehouse.{damagePercent}{destructionPercent}"
|
||||
},
|
||||
"storage_damage": {
|
||||
"title": "Storage damage: {damage_reason}",
|
||||
"description": "{damage_reason}: {destroyedInventoryUnits} units ({stock_type}) affected across {affectedStocks} stocks, {destroyedStocks} destroyed. {damagePercent}{destructionPercent}"
|
||||
},
|
||||
"character_illness": {
|
||||
"title": "Illness",
|
||||
"description": "{characterName} has fallen ill and lost {healthChange} health."
|
||||
|
||||
@@ -74,6 +74,10 @@
|
||||
"title": "Incendio en el almacén",
|
||||
"description": "Un incendio ha dañado partes de tu almacén.{damagePercent}{destructionPercent}"
|
||||
},
|
||||
"storage_damage": {
|
||||
"title": "Daño de almacenamiento: {damage_reason}",
|
||||
"description": "{damage_reason}: {destroyedInventoryUnits} unidades ({stock_type}) afectadas en {affectedStocks} depósitos, {destroyedStocks} destruidos. {damagePercent}{destructionPercent}"
|
||||
},
|
||||
"character_illness": {
|
||||
"title": "Enfermedad",
|
||||
"description": "{characterName} ha enfermado y ha perdido {healthChange} de salud."
|
||||
|
||||
@@ -74,6 +74,10 @@
|
||||
"title": "Incendie d'entrepôt",
|
||||
"description": "Un incendie a endommagé des parties de votre entrepôt.{damagePercent}{destructionPercent}"
|
||||
},
|
||||
"storage_damage": {
|
||||
"title": "Dommage de stockage : {damage_reason}",
|
||||
"description": "{damage_reason} : {destroyedInventoryUnits} unités ({stock_type}) touchées sur {affectedStocks} stocks, dont {destroyedStocks} détruits. {damagePercent}{destructionPercent}"
|
||||
},
|
||||
"character_illness": {
|
||||
"title": "Maladie",
|
||||
"description": "{characterName} est malade et a perdu la santé de {healthChange}."
|
||||
|
||||
Reference in New Issue
Block a user