Question

I'm looking for a way to set the default language for visitors comming to a site built in EPiServer for the first time. Not just administrators/editors in the backend, people comming to the public site.

Was it helpful?

Solution

Depends on your setup.

If the site languages is to change under different domains you can do this. Add to configuration -> configSections nodes in web.config:

<sectionGroup name="episerver">
  <section name="domainLanguageMappings" allowDefinition="MachineToApplication" allowLocation="false" type="EPiServer.Util.DomainLanguageConfigurationHandler,EPiServer" />

..and add this to episerver node in web.config:

  <domainLanguageMappings>
    <map domain="site.com" language="EN" />
    <map domain="site.se" language="SV" />
  </domainLanguageMappings>

Otherwhise you can do something like this. Add to appSettings in web.config:

<add name="EPsDefaultLanguageBranch" key="EN"/>

OTHER TIPS

I have this on EPiServer CMS5:

<globalization culture="sv-SE" uiCulture="sv" requestEncoding="utf-8" responseEncoding="utf-8" resourceProviderFactoryType="EPiServer.Resources.XmlResourceProviderFactory, EPiServer" />

In EPiServer CMS 5, add the following setting to your web.config:

<site description="Example Site">
    <siteHosts>
         <add name="www.site.se" language="sv" />
         <add name="www.site.no" language="no" />
         <add name="www.site.co.uk" language="en-GB" />
         <add name="*" />
    </siteHosts>

The language choosen for the start page is depending on the host header in the request.

If you set attribute pageUseBrowserLanguagePreferences="true" in your siteSettings tag in web.config the browsers request may be used to select language for the startpage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top