Legacy Knowledge Base
Published Jun. 30, 2025

Unable to add new language in Liferay DXP

Written By

Anushka Tiwari

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • Set the new locale language from the available language to the current language. The below error appears on the UI.new-locale.png
  • Steps to reproduce:
  1. Add the new language to Web.xml by navigating to[LIFERAY_HOME]/tomcat<version>/webapps/ROOT/WEB-INF/ under <web-resource-name> in web.xml file.
<url-pattern>/am/c/portal/protected</url-pattern>
<url-pattern>/am-ET/c/portal/protected</url-pattern>
<url-pattern>/am_ET/c/portal/protected</url-pattern>

under the <servlet-mapping> section in web.xml file:

<servlet-mapping>
		<servlet-name>I18n Servlet</servlet-name>
		<url-pattern>/am/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>I18n Servlet</servlet-name>
		<url-pattern>/am-ET/*</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>I18n Servlet</servlet-name>
		<url-pattern>/am_ET/*</url-pattern>
	</servlet-mapping>

   2. Create or modify your portal-ext.properties file in your installation’s Liferay Home folder. Define locales in the above file.

locales=am_ET,ar_SA,fa_IR,en_US,zh_CN,ja_JP 3. 

  3. Navigate to Control Panel> Instance settings > Miscellaneous and add the new language from available to the current language.
Outcome:Error: Please enter a valid locale message appears.

Environment

  • Liferay DXP 7.1

Resolution

  • Whenever modify the portal-ext.properties file in Liferay Home folder. Note that, this file overrides the enabled default locales defined in the portal.properties file, therefore lists all the languages want to use in the portal-ext.properties file.

  • Define both locales and locales.enabled. For example:

    locales=am_ET,ar_SA,fa_IR,en_US,zh_CN,ja_JP
    locales.enabled=am_ET,ar_SA,fa_IR,en_US,zh_CN,ja_JP

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base