1

We are using Sitecore 9.2 on-premise. We have an old requirement that Europe needs to be a separate en-EU language site. so we added the custom language "en-EU" from Sitecore Control Panel -> Add Language option. After that we do see the Language "En-EU" appear on System --> Languages list. How ever, when we try to add the version of any content item, Language Dropdown from the main content Area does not show that custom language "en-EU". Any help how can we configure such custom language?

we try to add language "en-EU" into App_Config\LanguageDefinitions.config file. After that we do see the language in the main content Area dropdown, but when we try to create a Content version in "en-EU", it throws an error and not create anything.

Any assistance if there is a proper way to configure the custom language in Sitecore?

2
  • during your add language, did you choose a predefined language code? if you can include all the steps it can help people to understand where is the problem. May 13 '20 at 7:22
  • Please also add the error message to help others that may have this issue May 13 '20 at 10:07
2

The error you are likely seeing is due to en-EU not being a valid culture on the system you are using. Sitecore requires that these are real cultures as far as the Windows operating system understands it. You have a few options.

Option 1 - use a real culture already defined on the system.

If you go to the Control Panel and use the Add Language dialog it will list some of the valid languages you can add. You can find all the .NET languages here. You could for example use en-150 which is English (Europe).

Option 2 - add your culture to the system

If you are not on PaaS you can add the culture via powershell

$CultureName = 'en-EU'
$BaseCulture = [cultureinfo]::GetCultureInfo('en-GB')
$BaseRegion = New-Object System.Globalization.RegionInfo 'GB'

try
{
    # Set up CultureAndRegionInfoBuilder
    Add-Type -AssemblyName sysglobl
    $CultureBuilder = New-Object System.Globalization.CultureAndRegionInfoBuilder @($CultureName,[System.Globalization.CultureAndRegionModifiers]::None)
    $CultureBuilder.LoadDataFromCultureInfo($BaseCulture)
    $CultureBuilder.LoadDataFromRegionInfo($BaseRegion)


    # Make appropriate changes
    foreach($Property in $Changes.Keys){
        $CultureBuilder.$Property = $Changes[$Property]
    }

    # Register your new culture
    $CultureBuilder.Register()

}
catch
{
    throw
}

Option 3 - use a real culture already defined and use rewrites to "fake it"

This great post shows how to "hijack" an existing culture and use rewrite rules and a few other tricks. This is a good idea on PaaS or in some cases even on IaaS if you don't want to have to register your custom languages on every environment.

In this particular case I would recommend this method for you as you can use en-150 and then rewrite urls to use en-EU in the URL if you wish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.