Unable to add new language in Liferay DXP

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

Was this article helpful?
0 out of 0 found this helpful