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.
This commit is contained in:
OlgunR
2026-02-24 11:13:46 +01:00
parent 3250f36c1f
commit 9419cb69ad

View File

@@ -135,15 +135,19 @@ namespace EnvelopeGenerator.Domain.Entities
{
get
{
if(this.IsReadAndSign())
{
return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString() + "4RaC");
}
else
{
return My.Resources.Model.ResourceManager.GetString(((Constants.EnvelopeStatus)Status).ToString());
var resourceManager = My.Resources.Model.ResourceManager;
var statusName = ((Constants.EnvelopeStatus)Status).ToString();
if (this.IsReadAndSign())
{
var statusNameRaC = statusName + "4RaC";
var translationRaC = resourceManager.GetString(statusNameRaC);
if (!string.IsNullOrEmpty(translationRaC))
return translationRaC;
}
return resourceManager.GetString(statusName);
}
}