Try our conversational search powered by Generative AI!

Localizable Country List in EPiServer Commerce


I need a drop down control showing all the list of Countries (it should be a part of Billing address form).

I could the contries list from Epi Commerce (like this code from Quicksilver project):

countryManager.GetCountries().Country.Select(x => new CountryViewModel { Code = x.Code, Name = x.Name });

However, here I will have the Names in English. And theses names have to be localizable. I wonder if there is some in-build nice solution for such cases.

At the moment I was reviewing certain technical solutions, but none looks very good for me:

  1. Having a key-value pair for each country code - This one already failed as EpiServer doesn't work well with a huge key-value pair list. I was not able to update page's properties in Edit mode.
  2. Using .Net in-build solution with CultureInfo/Region. This option covers around 50% of the list for me, so it would be just confusing for the user especially if there is non-latin alphabet
  3. Using translation links @Html.Translate("") for each country iso code. This is going to be an option. But it would be really horrible for the content editors to work in such way. It would be a better option if I could create aftergenerated list of translation objects.
May 24, 2017 17:01

Sounds to me like an update feature for DbLocalizationProvider ;)

May 30, 2017 1:32

Thanks, Valdis!

Haven't heard about this library before :)

Jun 27, 2017 13:26

As a solution I have used standard EPiServer translation mechanism and auto-generated XML files with translations.

Jun 27, 2017 13:28

What exactly solution looks like when it comes to multiple languages and code how you localize them. That would give me more background of support to be added to the package.. thx

Jun 27, 2017 15:37

I have a list of countries from the EPiCommerce:


I am applying the localization by the country ISO code if it is possible:

LocalizationService.Current.TryGetString($"/mytranslationpath/{code}", out translation)

I generate the xml files with translations from the Excel document I have from customer:

  <language name="English" id="en">
        <AX>Åland Islands</AX>

Jun 27, 2017 16:29
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.