Refactor envelope status translation logic

Simplified the logic for translating envelope status by using pattern matching to directly return the "Read and Sign" translation if available, otherwise falling back to the default. Also renamed the resource manager variable (note: introduced a typo as "rescourceManager").
This commit is contained in:
OlgunR
2026-02-25 11:30:22 +01:00
parent 66c1fb3698
commit 9b70ca8ce6

View File

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