Adding Locales

Add website languages to the CMS Console with the locale package fragment installer

The LocalePackageFragmentInstaller can add another content language to the website.

It does what you can also do manually in the CMS Console: System / Languages / Add Language. With the installer, you can automate this operation, particularly, when multiple languages are needed.

Example:

<mi:Add
    installerType="Composite.Core.PackageSystem.PackageFragmentInstallers.LocalePackageFragmentInstaller, Composite"
    uninstallerType="Composite.Core.PackageSystem.PackageFragmentInstallers.LocalePackageFragmentUninstaller, Composite">
   <Locales>
        <Locale 
			name="da-DK" 
			urlMappingName="da" 
			default="false" />
   </Locales>
</mi:Add>

The <Locales /> element

The Locales element can contain one, or more Locale elements, which allow you to specify the language you want to add to your website.

The Locale element has the following attributes:

  • name: The name of the language culture (for example, "da-DK" for Danish).
  • urlMappingName: The string to be inserted into URLs of pages published in the given language.
  • default: When “true”, this language will be added as default on the website.