Add UserLanguage to IUserIdentity
This commit is contained in:
parent
e620d5d161
commit
8e2a97e39f
|
|
@ -8,4 +8,5 @@ public interface IUserIdentity
|
|||
string FirstName { get; }
|
||||
string LastName { get; }
|
||||
string FullName { get; }
|
||||
string? UserLanguage { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,4 +56,14 @@ public class UserIdentity : IUserIdentity
|
|||
return $"{FirstName} {LastName}".Trim();
|
||||
}
|
||||
}
|
||||
|
||||
[JsonPropertyName("user_language")]
|
||||
public string? UserLanguage
|
||||
{
|
||||
get
|
||||
{
|
||||
_contextAccessor.HttpContext.Request.Headers.TryGetValue("User-Language", out var languages);
|
||||
return languages.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue