Open
Description
What would you add to the SDK?
Curently it is possible to set default language globally for the entire Head Application, see in Program.cs:
const string defaultLanguage = "en";
const string germanLanguage = "de-DE";
app.UseRequestLocalization(options =>
{
// If you add languages in Sitecore which this site / Rendering Host should support, add them here.
List<CultureInfo> supportedCultures = [new CultureInfo(defaultLanguage), new CultureInfo(germanLanguage)];
options.DefaultRequestCulture = new RequestCulture(defaultLanguage, defaultLanguage);
options.SupportedCultures = supportedCultures;
options.SupportedUICultures = supportedCultures;
options.UseSitecoreRequestLocalization();
});
Next.JS SDK has the way to configure default language per website domain/hostname, see this recipe for more information: https://developers.sitecore.com/learn/accelerate/xm-cloud/implementation/information-architecture/localization#multi-domain-routing-with-localization
This is useful functionality that allows more advanced multi-site configuration.
The scenarios like following are possible in Next.js but currently they are not possible for ASP.NET Core SDK:
- ASP.NET Core SDK app should serve 2 websites: www.test.nl and www.anothertest.de
- When visited, www.test.nl should set localization to NL so that content from layout service is delivered in NL language. No redirection or /nl-NL prefix should be used in the URL
- When visited www.anothertest.de should set localization to de-DE and the content should be delivered o de-DE version. Again, no /de-DE language prefix should be used in the URL.
Code of Conduct
- I agree to follow this project's Code of Conduct