AI agents: the content index is at /llms.txt. Every page is also available as Markdown — send the request header Accept: text/markdown, or append .md to the page URL.
Xperience Docs

Cookie consent

We use necessary cookies (opens in a new tab) to run our website and improve your experience while browsing. Additional cookies are only used with your consent. You may revoke your consent on the Cookies Policy (opens in a new tab) page or in your browser at any time.

Configure (opens in a new tab)
  • Documentation
    InstallationUsing the Xperience interfaceDeveloping websitesConfiguring XperienceManaging usersSecuring websitesDeploying websitesManaging website contentMultilingual websitesMacro expressionsExternal utilitiesIntegrating 3rd party systemsCustom developmentE-commerce featuresOn-line marketing featuresRelease notes - Xperience 13Xperience terminology glossary
  • Tutorial
    Using the Xperience interfaceDeveloper tutorialBusiness tutorialResource hub for marketers
  • API Examples
    ConfigurationContent managementDevelopmentE-commerceOn-line marketingSocial media
  1. Home
  2. Configuration
  3. Localization

Localization


Was this page helpful?

Send us feedback Go back to top
  • Community Questions & Answers (opens in a new tab)
  • Contact support (opens in a new tab)

List of examples:

  • Cultures
    • Creating a new culture
    • Updating a culture
    • Updating multiple cultures
    • Assigning a culture to a site
    • Removing a culture from a site
    • Deleting a culture

Cultures

Creating a new culture

C#
// Creates a new culture object
CultureInfo newCulture = new CultureInfo();

// Sets the culture properties
newCulture.CultureName = "New culture";
newCulture.CultureCode = "nw-cu";
newCulture.CultureShortName = "Culture";

// Saves the new culture to the database
CultureInfo.Provider.Set(newCulture);
> Back to list of examples

Updating a culture

C#
// Gets the culture using the culture code
CultureInfo updateCulture = CultureInfo.Provider.Get("nw-cu");

if (updateCulture != null)
{
    // Updates the culture properties
    updateCulture.CultureName = updateCulture.CultureName.ToLower();

    // Saves the modified culture to the database
    CultureInfo.Provider.Set(updateCulture);
}
> Back to list of examples

Updating multiple cultures

C#
// Prepares a where condition for loading all cultures whose code starts with 'nw'
string where = "CultureCode LIKE N'nw%'";

// Get all cultures that fulfill the condition
InfoDataSet<CultureInfo> cultures = CultureInfoProvider.GetCultures(where, null);

// Loops through individual cultures
foreach (CultureInfo culture in cultures)
{
    // Updates the culture properties
    culture.CultureName = culture.CultureName.ToUpper();

    // Saves the updated culture to the database
    CultureInfo.Provider.Set(culture);
}
> Back to list of examples

Assigning a culture to a site

C#
// Gets the culture using the culture code
CultureInfo culture = CultureInfo.Provider.Get("nw-cu");

if (culture != null)
{
    // Assigns the culture to the current site
    CultureSiteInfo.Provider.Add(culture.CultureID, SiteContext.CurrentSiteID);
}
> Back to list of examples

Removing a culture from a site

C#
// Gets the culture using the culture code
CultureInfo removeCulture = CultureInfo.Provider.Get("nw-cu");

if (removeCulture != null)
{
    // Gets the object representing the relationship between the culture and the current site
    CultureSiteInfo cultureSite = CultureSiteInfo.Provider.Get(removeCulture.CultureID, SiteContext.CurrentSiteID);

    if (cultureSite != null)
    {
        // Removes the culture from the current site
        CultureSiteInfo.Provider.Delete(cultureSite);
    }
}
> Back to list of examples

Deleting a culture

C#
// Gets the culture using the culture code
CultureInfo deleteCulture = CultureInfo.Provider.Get("nw-cu");

if (deleteCulture != null)
{
    // Deletes the culture
    CultureInfo.Provider.Delete(deleteCulture);
}
> Back to list of examples