Search code examples
c#localizationcultureepiserver

How to retrieve a list of all enabled languages for the EPi Server website programmatically?


I simply want to get a list of all enabled languages for the EPi Server website (enabled in the "Manage Website Languages" panel in Admin mode) and preferably also be able to retrieve the path to the flag icon and of course the culture name/ID.

I'm using EPiServer 6 R2 so if the code works for that version it would be lovely. Pointing me in the right direction would be great too.


Solution

  • In EPiServer.DataAbstraction you have LanguageBranch.ListEnabled().

    Take a look at this file to see how it's bound in Admin mode: C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Application\UI\CMS\Admin\EditLanguageBranches.aspx