Default Language for a CMSSite
You can set the default language for a CMS site in the Backoffice Administration Cockpit.
You set the default language for a site as follows:
-
Set it for the CMSSite: Set the default language for the CMSSite instance.
-
Set it for the BaseStore: Set the default language for the BaseSore instance. This value is used as a fallback value if no default language is configured in the CMSSite.
Data Model
The CMSSite type extends the BaseSite type. It inherits all the attributes defined in the parent type, which includes the defaultLanguage attribute. The following diagram shows the data models and relations of base store, base site, and the CMSSite:
Language API and Services
SmartEdit uses a LanguageController to retrieve the list of languages configured for a specific site. The language result returns the following:
-
isocode
-
name
-
active flag
-
required flag
The LanguageController relies on the LanguageFacade to retrieve the list of all languages defined for a specific site with the active and required flags set to true. The LanguageFacade is an interface and the DefaultLanguageFacade provides the default implementation of the facade.
When a user edits a CMSItem in SmartEdit, the LocalizedPopulator provides the values for the localized fields in the Generic Editor. The populator provides the values for all localized fields defined for a CMSSite. When a user saves their changes, SmartEdit uses the LocalizedValidator to validate the localized field values. The LocalizedValidator verifies that a value is provided for the default language of the CMSSite.