/// <summary>
 /// Ensures that the thread culture is set based on the back office user's culture
 /// </summary>
 /// <param name="identity"></param>
 internal static void EnsureCulture(this IIdentity identity)
 {
     if (identity is UmbracoBackOfficeIdentity umbIdentity && umbIdentity.IsAuthenticated)
     {
         Thread.CurrentThread.CurrentUICulture   =
             Thread.CurrentThread.CurrentCulture = UserCultures.GetOrAdd(umbIdentity.Culture, s => new CultureInfo(s));
     }
 }
        private void EnsureCulture(CookieValidateIdentityContext context)
        {
            var umbIdentity = context.Identity as UmbracoBackOfficeIdentity;

            if (umbIdentity != null && umbIdentity.IsAuthenticated)
            {
                Thread.CurrentThread.CurrentCulture       =
                    Thread.CurrentThread.CurrentUICulture =
                        UserCultures.GetOrAdd(umbIdentity.Culture, s => new CultureInfo(s));
            }
        }