From 5df265beddafe06db8709094ec29154e0a234a63 Mon Sep 17 00:00:00 2001 From: Hisham Bin Ateya Date: Tue, 16 Jan 2024 00:22:50 +0300 Subject: [PATCH] ^ This is a combination of 11 commits. ^ This is the 1st commit message: Add GetCulture() extension method ^ This is the commit message #2: Cleanup ISmsService (#15142) ^ This is the commit message #3: Fix TheAdminTheme layout margin and padding (#15143) ^ This is the commit message #4: Fix SectionDisplayDriver prefix (#15123) ^ This is the commit message #5: Prefill template name when creating a template. (#15145) ^ This is the commit message #6: Set the User Localization feature priority ^ This is the commit message #7: Fix issue with default culture not selected When currentUserCulture is null or supportedCulture doesn't contain currentUserCulture. ^ This is the commit message #8: Update the height of the admin content (#15153) ^ This is the commit message #9: Eliminate the anti-discovery pattern in Elasticsearch (#15134) ^ This is the commit message #10: Renaming and cleaning up search services (#15156) ^ This is the commit message #11: mkdocs-material 9.5.5 --- .../Localization/Extensions/ClaimsPrincipleExtensions.cs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/OrchardCore.Modules/OrchardCore.Users/Localization/Extensions/ClaimsPrincipleExtensions.cs diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Localization/Extensions/ClaimsPrincipleExtensions.cs b/src/OrchardCore.Modules/OrchardCore.Users/Localization/Extensions/ClaimsPrincipleExtensions.cs new file mode 100644 index 00000000000..0282cf17e44 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Users/Localization/Extensions/ClaimsPrincipleExtensions.cs @@ -0,0 +1,9 @@ +using OrchardCore.Users.Localization.Providers; + +namespace System.Security.Claims; + +public static class ClaimsPrincipleExtensions +{ + public static string GetCulture(this ClaimsPrincipal principal) + => principal.FindFirstValue(UserLocalizationClaimsProvider.CultureClaimType); +}