Table of Contents

Customize application cultures

Neos cluster languages configuration

A Neos cluster has a languages configuration. This configuration is used by Neos Studio to show which translations need to be completed.

Example :

Languages:
  - en
  - fr

When the web application is opened, by default the language used to display the application is the web browser language.

If the web browser language is not found in the Neos cluster languages, then the default Neos application language (the first in the list) is used to display the application.

When a UI view contains a LocalizableString form field, the user needs to input all Neos application languages. This behavior is not always desired. This is problematic when the user expects to input data using a single language.

Single-language application

To get single-language application, you can customize by code the application culture by setting up :

  • OnTenantResolvedResult.ApplicationCulture to specify the language used by localizable labels and texts of the application.
  • OnTenantResolvedResult.InputCultures to specify a single input language. Localizable string form fields will appear as standard text form fields.

Application with several languages to enter

By default, if application culture is not specified, then input languages are all input languages of the Neos cluster.

If you need to customize this list (for example : from logger user information), you can customize it by code using OnTenantResolvedResult.InputCultures.

Warning

If you customize input cultures and want the input language to be the same as the application language, set the first input culture with the same value as the application culture.

See code example in the multitenant documentation.