Culture client

The SDK provides a Cultures client to fetch cultures from Sitecore Content Hub.

Note

The client variable in the following code examples refers to the IMClient instance. When using the Web SDK, the variable name can be chosen freely, but it is also called client at instantiation in the documentation.

Get the default culture

To get the default culture from the Sitecore Content Hub:

RequestResponse
CultureInfo defaultCulture = await MClient.Cultures.GetDefaultCultureAsync();

Get all registered cultures

To get all registered cultures from the Sitecore Content Hub:

RequestResponse
IList<CultureInfo> cultures = await MClient.Cultures.GetAllCulturesAsync();

Do you have some feedback for us?

If you have suggestions for improving this article,