1.15. Language settings

Formats for dates in different languages can be entered in the <formats>/<date> area. If this area is missing, the standard formats specified in the code example are used. For each language for which a different format is to be used, an element with the ISO 639-1 code of the language must be entered as the name. The content of the element is the desired format pattern according to the rules of the Java SimpleDateFormat.

These date formats are used in all metadata of type datefield that do not have their own pattern attribute, as well as in all date input fields in the administration backend and in the calendar search.

<viewer>
    <formats>
        <date>
            <en>MM/dd/yyyy</en>
            <fr>dd/MM/yyyy</fr>
            <es>dd/MM/yyyy</es>
            <de>dd.MM.yyyy</de>
        </date>
    </formats>
</viewer>

In the case of initial calls via resolvers, etc., it can happen that the FacesContext is not yet available, so that the configured default language cannot be called up. In this case, a fallback to the language configured in the following switch takes place (default is en).

<viewer>
    <fallbackDefaultLanguage>en</fallbackDefaultLanguage>
</viewer>

Last updated