How do I get the alias of the current culture via API

Alexander Toups asked on July 6, 2015 17:42

I try to retrieve the alias name of the selected culture via API.

Recent Answers


Zach Perry answered on July 6, 2015 18:01 (last edited on July 6, 2015 18:07)

var culture = CultureInfoProvider.GetCultureInfo("en-us");
var culturealias = culture.CultureAlias;

or

var cultureAlias = LocalizationContext.CurrentCulture.CultureAlias

something along those lines should work, just have to use whichever culture code you want

1 votesVote for this answer Mark as a Correct answer

Alexander Toups answered on July 6, 2015 18:14

that's great. I'm looking for the current culture, maybe CMSPreferredCulture.

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on July 6, 2015 18:22

LocalizationContext.CurrentCulture should give you the current culture that is being used.

3 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.