November Happy Hour will be moved to Thursday December 5th.

Localizable Country List in EPiServer Commerce

Vote:
 

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.
#178866
May 24, 2017 17:01
Vote:
 

Sounds to me like an update feature for DbLocalizationProvider ;)

#179022
May 30, 2017 1:32
Vote:
 

Thanks, Valdis!

Haven't heard about this library before :)

#179967
Jun 27, 2017 13:26
Vote:
 

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

#179968
Jun 27, 2017 13:28
Vote:
 

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

#179979
Jun 27, 2017 15:37
Vote:
 

I have a list of countries from the EPiCommerce:

 CountryManager.GetCountries(true).Country.Select

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:

<languages>
  <language name="English" id="en">
      <countries>
        <AF>Afghanistan</AF>
        <AX>Åland Islands</AX>
        <AL>Albania</AL>

      </countries>
  </language>
</languages>
#179989
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.