IWe have a Sitecore 10.3 SXA JSS site with SXAa React frontend utilizing a headless proxy. In my Site Grouping itemThe default language, I've chosenas specified in the JSS app's Site Grouping item's language asfield, is en-caCA. NowHowever, I've written a pipeline to change mynew business requirement dictates that the site context language under certain conditions. It's working fine in my local environment, which doesn't haveshould dynamically switch to fr-CA based on the SXA Site Grouping itemuser's location (X location). However, when I moveWhile we can successfully fetch the codeuser's language, we're unable to a higher environment where SXA is enabled and en-ca is set asprogrammatically change the defaultcontext language inwithin the CDSXA site groupingbecause the Site Grouping item, it always loads the site indefaults to en-caCA.
If I send null in Our challenge is to override the default language field, the site throws a 502 error assetting and change the Sitecore context language becomes nullbased on user location using code within the SXA site.
<httpRequestBegin>
<processor type="Sitecore.Cloud.Integration.Bootload.PostStepsRunner.AbortRequestOnPackageMaintenance, Sitecore.Cloud.Integration.Bootload.PostStepsRunner" resolve="true" patch:source="Sitecore.Cloud.Integration.Bootload.PostStepsRunner.config"/>
<processor type="Sitecore.Pipelines.PreprocessRequest.CheckIgnoreFlag, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.EnsureServerUrl, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.StartMeasurements, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.IgnoreList, Sitecore.Kernel" patch:source="Sitecore.XA.Feature.Horizon.config">
<prefixes hint="list">
<prefix name="identityProcessing" patch:source="Sitecore.Owin.Authentication.config">/identity/</prefix>
<prefix name="service" patch:source="Sitecore.GraphQL.config">/sitecore/api/authoring/</prefix>
<prefix name="sxa" patch:source="Sitecore.XA.Feature.Horizon.config">/sxa/horizon/</prefix>
</prefixes>
</processor>
<processor type="Sitecore.Mvc.Pipelines.HttpRequest.DisplayFatalErrors, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.SiteResolver, Sitecore.Kernel" resolve="true"/>
<processor type="Sitecore.ExperienceEditor.Pipelines.HttpRequest.ResolveSite, Sitecore.ExperienceEditor" patch:source="Sitecore.ExperienceEditor.config"/>
<processor type="Sitecore.ItemWebApi.Pipelines.HttpRequest.SetRuntimeSettings, Sitecore.ItemWebApi" patch:source="Sitecore.ItemWebApi.config"/>
<processor type="Sitecore.ItemWebApi.Pipelines.HttpRequest.CheckMode, Sitecore.ItemWebApi" patch:source="Sitecore.ItemWebApi.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.UserResolver, Sitecore.Kernel"/>
<processor type="Sitecore.ItemWebApi.Pipelines.HttpRequest.ResolveUserFromRequest, Sitecore.ItemWebApi" patch:source="Sitecore.ItemWebApi.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.DatabaseResolver, Sitecore.Kernel"/>
<processor type="Sitecore.XA.Foundation.SiteMetadata.Pipelines.HttpRequestBegin.SxaSitemapHandler, Sitecore.XA.Foundation.SiteMetadata" resolve="true" patch:source="Sitecore.XA.Foundation.SiteMetadata.config"/>
<processor type="Sitecore.XA.Foundation.SiteMetadata.Pipelines.HttpRequestBegin.RobotsHandler, Sitecore.XA.Foundation.SiteMetadata" resolve="true" patch:source="Sitecore.XA.Foundation.SiteMetadata.config">
<CacheExpiration>720</CacheExpiration>
</processor>
<processor type="Sitecore.Pipelines.HttpRequest.BeginDiagnostics, Sitecore.Kernel"/>
<processor type="Sitecore.XA.Feature.CreativeExchange.Pipelines.HttpRequestBegin.EnableCreativeExchangeMode, Sitecore.XA.Feature.CreativeExchange" resolve="true" patch:source="Sitecore.XA.Feature.CreativeExchange.config"/>
<processor type="Sitecore.XA.Feature.Json.Pipelines.HttpRequest.ResolveJsonDevice, Sitecore.XA.Feature.Json" resolve="true" patch:source="Sitecore.XA.Feature.Json.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.DeviceResolver, Sitecore.Kernel"/>
<processor type="Sitecore.XA.Feature.DeviceResolver.Pipelines.HttpRequestBegin.MultiAgentDeviceResolver, Sitecore.XA.Feature.DeviceResolver" resolve="true" patch:source="Sitecore.XA.Feature.DeviceResolver.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.LanguageResolver, Sitecore.Kernel" resolve="true"/>
<processor type="Sitecore.ItemWebApi.Pipelines.HttpRequest.ResolveLanguage, Sitecore.ItemWebApi" patch:source="Sitecore.ItemWebApi.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.CustomHandlers, Sitecore.Kernel">
<param type="Sitecore.Pipelines.HttpRequest.HandlerMapping.DirectHandlerMapper, Sitecore.Kernel" resolve="true"/>
</processor>
<processor type="Sitecore.ItemWebApi.Pipelines.HttpRequest.HandleActionRequest, Sitecore.ItemWebApi" patch:source="Sitecore.ItemWebApi.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.QueryStringResolver, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.DynamicLinkResolver, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.AliasResolver, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.DefaultResolver, Sitecore.Kernel"/>
<processor type="Sitecore.Pipelines.HttpRequest.FileResolver, Sitecore.Kernel"/>
<processor type="Sitecore.Mvc.DeviceSimulator.Pipelines.HttpRequest.HandleSimulationRequest, Sitecore.Mvc.DeviceSimulator" patch:source="Sitecore.MVC.DeviceSimulator.config"/>
<processor type="Sitecore.Mvc.Pipelines.HttpRequest.TransferRoutedRequest, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.LayoutService.Mvc.Pipelines.HttpRequestBegin.SkipContextItemResolutionWhenLayoutServiceRequest, Sitecore.LayoutService.Mvc" resolve="true" patch:source="Sitecore.LayoutService.Mvc.config"/>
<processor type="Sitecore.Services.GraphQL.Hosting.Mvc.Pipelines.HttpRequestBegin.SkipContextItemResolutionWhenGraphQLRequest, Sitecore.Services.GraphQL.NetFxHost" resolve="true" patch:source="Sitecore.Services.GraphQL.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel" resolve="true"/>
<processor type="Sitecore.XA.Foundation.SitecoreExtensions.Pipelines.HttpRequestBegin.CultureResolver, Sitecore.XA.Foundation.SitecoreExtensions" resolve="true" patch:source="Sitecore.XA.Foundation.SitecoreExtensions.config"/>
<processor type="Sitecore.XA.Foundation.Redirects.Pipelines.HttpRequestBegin.RedirectItem, Sitecore.XA.Foundation.Redirects" resolve="true" patch:source="Sitecore.XA.Foundation.Redirects.config"/>
<processor type="Sitecore.XA.Foundation.Redirects.Pipelines.HttpRequest.RedirectMapResolver, Sitecore.XA.Foundation.Redirects" resolve="true" patch:source="Sitecore.XA.Foundation.Redirects.config">
<CacheExpiration>720</CacheExpiration>
</processor>
<processor type="Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest.LocalizableUrlItemResolver, Sitecore.XA.Foundation.Multisite" resolve="true" patch:source="Sitecore.XA.Foundation.Multisite.config">
<CacheExpiration>5</CacheExpiration>
</processor>
<processor type="Sitecore.XA.Feature.ErrorHandling.Pipelines.HttpRequestBegin.ItemNotFoundResolver, Sitecore.XA.Feature.ErrorHandling" resolve="true" patch:source="Sitecore.XA.Feature.ErrorHandling.config"/>
<processor type="Sitecore.JavaScriptServices.ViewEngine.Pipelines.HttpRequest.HeadlessSiteAccess, Sitecore.JavaScriptServices.ViewEngine" resolve="true" patch:source="Sitecore.JavaScriptServices.ViewEngine.config"/>
<processor type="Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest.ResolveContentLanguage, Sitecore.XA.Foundation.Multisite" resolve="true" patch:source="Sitecore.XA.Foundation.Multisite.config"/>
<processor type="Sitecore.ItemWebApi.Pipelines.HttpRequest.LaunchRequest, Sitecore.ItemWebApi" patch:source="Sitecore.ItemWebApi.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.DeviceSimulatorResolver, Sitecore.Kernel"/>
<processor type="Sitecore.XA.Feature.Overlays.Pipelines.HttpRequestBegin.OverlayTypeResolver, Sitecore.XA.Feature.Overlays" resolve="true" patch:source="Sitecore.XA.Feature.Overlays.config"/>
<processor type="Sitecore.XA.Foundation.Theming.Pipelines.HttpRequestBegin.AppendCompatibilityModeHeader, Sitecore.XA.Foundation.Theming" resolve="true" patch:source="Sitecore.XA.Foundation.Theming.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.LayoutResolver, Sitecore.Kernel"/>
<processor type="Sitecore.XA.Feature.ErrorHandling.Pipelines.HttpRequestBegin.LayoutNotFoundResolver, Sitecore.XA.Feature.ErrorHandling" resolve="true" patch:source="Sitecore.XA.Feature.ErrorHandling.config"/>
<processor type="Sitecore.XA.JSS.Foundation.Integration.Pipelines.HttpRequestBegin.AppPathNotFoundResolver, Sitecore.XA.JSS.Foundation.Integration" resolve="true" patch:source="Sitecore.XA.JSS.Foundation.Integration.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.PageEditorHandleNoLayout, Sitecore.ExperienceEditor" resolve="true" patch:source="Sitecore.XA.Feature.DeviceResolver.config"/>
<processor type="Sitecore.ExperienceEditor.Pipelines.HttpRequest.CheckDevice, Sitecore.ExperienceEditor" resolve="true" patch:source="Sitecore.XA.Feature.DeviceResolver.config"/>
<processor type="Sitecore.Mvc.Pipelines.HttpRequest.TransferMvcLayout, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Mvc.Pipelines.HttpRequest.TransferControllerRequest, Sitecore.Mvc" patch:source="Sitecore.Mvc.config"/>
<processor type="Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel" resolve="true"/>
</httpRequestBegin>
I'm unsure where to place my pipeline in the httpRequestBegin pipeline to override the SXA defaultCan we change context language set inof SXA site programmatically without touching the language mentioned on site grouping item. ?