Page Language Configuration - Documentation topics on: default language,languages,multilingual content,multilingual pages,page configuration,.

Page Language Configuration

Content in dotCMS, including Pages, can be created in many languages.  When a user accesses a Page using a specific language, if a version of that Page exists in the appropriate language, the appropriate language version of the Page is displayed.

However if the user attempts to access a Page using a specific language, but no version of the Page exists in that language, you must choose how to handle the request.  For example, if your Site supports English, Spanish, and French, but you have a Page which has only English and Spanish versions, you must decide how the system handles it when a user attempts to access the Page in French (since no French version of the Page exists yet).

There are two different ways to handle this:

  1. Display a 404 error, since the expected language version of the Page does not exist.
  2. Default behavior: Have the Page "fall-through" to the default language, and display the default language version of the Page instead.

This behavior is controlled by the DEFAULT_PAGE_TO_DEFAULT_LANGUAGE parameter in the dotmarketing-config.properties file:

DEFAULT_PAGE_TO_DEFAULT_LANGUAGE=true

If this property is set to true (the default value), then if there is no version of the Page in the language the user attempts to display, the default language version of the page will be displayed to the user instead.  If this property is set to false, then when a user attempt to access a page when an appropriate language version of the page doesn't exist, the user will receive a 404 error.

Make sure to use a plugin when making any changes to your system configuration.

Non-Page Content can also be set to "fall through" to the default language.  For more information see the Content Language Configuration Property documentation.