Issue
- Set the new locale language from the available language to the current language. The below error appears on the UI.
- Steps to reproduce:
- Add the new language to
Web.xml
by navigating to[LIFERAY_HOME]/tomcat<version>/webapps/ROOT/WEB-INF/ under<web-resource-name>
inweb.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 theportal.properties
file, therefore lists all the languages want to use in theportal-ext.properties
file. -
Define both
locales
andlocales.enabled
. For example:
Additional Information
Subscriber Exclusive Content
A Liferay Enterprise Subscription provides access to over 1,500 articles that include best practices, troubleshooting, and other valuable solutions. Sign in for full access.
Sign In