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:
@@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user