From bfcfeb9a048db94a1644618ef302f9b66c26e6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lozano?= Date: Thu, 3 Jul 2025 00:22:39 +0200 Subject: [PATCH] Fix localization of critical failure and success --- lang/en.json | 3 ++- module/roll/roll.js | 17 ++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lang/en.json b/lang/en.json index b96332f..6c6609c 100644 --- a/lang/en.json +++ b/lang/en.json @@ -157,7 +157,8 @@ "DG.Roll.Target": "Target: ", "DG.Roll.Success": "Success", "DG.Roll.Failure": "Failure", - "DG.Roll.Critical": "Critical", + "DG.Roll.CriticalSuccess": "¡Critical Success!", + "DG.Roll.CriticalFailure": "¡Critical Failure!", "DG.Roll.Lethality": "Lethality", "DG.Roll.Lethal": "Lethal", "DG.Roll.For": "For", diff --git a/module/roll/roll.js b/module/roll/roll.js index 6aec751..a89fc87 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -319,23 +319,22 @@ export class DGPercentileRoll extends DGRoll { let resultString = ""; let styleOverride = ""; - if (this.isCritical) { - resultString = `${game.i18n.localize("DG.Roll.Critical")} `; - } if (this.isSuccess) { - resultString += `${game.i18n.localize("DG.Roll.Success")}`; - if (this.isCritical) { - resultString = `${resultString.toUpperCase()}!`; + resultString = `${game.i18n.localize("DG.Roll.CriticalSuccess")}`; + resultString = `${resultString.toUpperCase()}`; styleOverride = "color: green"; + } else { + resultString = `${game.i18n.localize("DG.Roll.Success")}`; } } else { - resultString += `${game.i18n.localize("DG.Roll.Failure")}`; - if (this.isCritical) { - resultString = `${resultString.toUpperCase()}!`; + resultString = `${game.i18n.localize("DG.Roll.CriticalFailure")}`; + resultString = `${resultString.toUpperCase()}`; styleOverride = "color: red"; + } else { + resultString = `${game.i18n.localize("DG.Roll.Failure")}`; } }