Using Liferay's Language Settings

For a given locale, you can override Liferay’s core UI messages. Modifying Language key values in Liferay provides a lot of localization flexibility in itself, but we’re always looking for new ways to give you more control. There are language settings in Liferay’s files that give you even more localization options.

  • In the add and edit user forms, configure the name fields that are displayed and the field values available in select fields. For example, leave out the middle name field if you want, or alter the prefix selections.

  • Control the directionality of content and messages in Liferay (left to right or right to left).

To see how these settings are configured, open Liferay’s core file in one of two ways:

  1. From Liferay’s source code, navigate to

  2. From a Liferay bundle’s portal-impl.jar.

     [Liferay Home]/tomcat-[version]/webapps/ROOT/WEB-INF/lib/portal-impl.jar

    Just open the content folder in the Jar to find the language files.

The first section in the file is labeled Language settings:

## Language settings


The user name properties are used to customize certain fields of the add and edit user forms based on a user’s locale.

Localizing User Names

Liferay’s customers come from all over the world, and we recognize that naming conventions are different between locales. Liferay’s engineers have made several of the user name fields configurable in Liferay where user name information is entered or edited.

  • Remove certain name fields and make others appear more than once. Some locale’s need more than one last name, for example.,first-name,middle-name,last-name,suffix
  • Change the prefix and suffix values for a locale.,Mr,Ms,Mrs,III,IV,Jr,Phd,Sr
  • Specify which fields are required.

The properties for changing user name settings are those that begin with in the language settings section of a locale’s language properties file.

For most of the [locales enabled by default]( and Time Zones) the user name properties are specifically tailored to that location.


For example, these are the English ( properties for setting user name fields:,first-name,middle-name,last-name,suffix,Mr,Ms,Mrs,III,IV,Jr,Phd,Sr

Figure 1: The user name settings impact the way user information and forms appear in Liferay.

Figure 1: The user name settings impact the way user information and forms appear in Liferay.

Compare those to the Spanish ( settings:,first-name,last-name,Sra,Sta,Dr,Dra

Figure 2: The Spanish user name settings omit the suffix and middle name fields entirely.

Figure 2: The Spanish user name settings omit the suffix and middle name fields entirely.

The biggest difference between the English and Spanish form fields in the images above is that the middle name and suffix fields are omitted in the Spanish configuration. Other differences include the specific prefix values.

¡Muy excelente! Localizing the forms for adding and editing users is accomplished using the same method by which Liferay’s UI messages are localized: by overriding one of Liferay’s files.

Right to Left or Left to Right?

The first three properties in the language settings section are used for changing the direction in which the language’s characters are displayed. Most languages are read from left to right, but other languages are meant to be read from right to left (Arabic, Hebrew, and Persian, for example). It can also be changed for languages that have been traditionally displayed left to right (like English) as a funny practical joke. Just don’t tell anyone that you got the idea here.

Here’s what the relevant language properties look like for a language that should be displayed from right to left:


With these customizations yo can transform Liferay’s UI into a user-friendly environment no matter where your users are from.

« Automatically Generating Language FilesIntroduction to WYSIWYG Editors »
Este artigo foi útil?
Utilizadores que acharam útil: 0 de 0