From 9419cb69ad4b78756bb624bd5b81045eb305bc9e Mon Sep 17 00:00:00 2001 From: OlgunR Date: Tue, 24 Feb 2026 11:13:46 +0100 Subject: [PATCH] Refactor StatusTranslated property for better fallback logic Refactored the StatusTranslated property to first attempt fetching the translation with the "4RaC" suffix when IsReadAndSign() is true, and only use it if a translation exists. If not, or if IsReadAndSign() is false, it falls back to the standard status translation. This improves clarity and ensures a fallback translation is always provided. --- EnvelopeGenerator.Domain/Entities/Envelope.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/EnvelopeGenerator.Domain/Entities/Envelope.cs b/EnvelopeGenerator.Domain/Entities/Envelope.cs index afa5baa1..fcaad3f5 100644 --- a/EnvelopeGenerator.Domain/Entities/Envelope.cs +++ b/EnvelopeGenerator.Domain/Entities/Envelope.cs @@ -135,15 +135,19 @@ namespace EnvelopeGenerator.Domain.Entities { get { - if(this.IsReadAndSign()) - { - return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString() + "4RaC"); - } - else + var resourceManager = My.Resources.Model.ResourceManager; + var statusName = ((Constants.EnvelopeStatus)Status).ToString(); + + if (this.IsReadAndSign()) { - return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString()); + var statusNameRaC = statusName + "4RaC"; + var translationRaC = resourceManager.GetString(statusNameRaC); + if (!string.IsNullOrEmpty(translationRaC)) + return translationRaC; } + + return resourceManager.GetString(statusName); } }