Liferay currently supports about 40 languages out of the box.  The full list of translated languages and their progress may be seen here:

What about adding a language to Liferay that is not one of the ones supported?  The Cherokee language was chosen for this article along with Liferay v6.1.

1. In the Liferay web.xml (webapps/ROOT/WEB-INF/web.xml) a few lines will be needed to ensure that the new language will be recognized by the server:
To add a new language, in this case Cherokee, add the following two entries to the servlet-mappings:

 <servlet-name>I18n Servlet</servlet-name>
 <servlet-name>I18n Servlet</servlet-name>

The first entry is just for Cherokee itself.  Since Cherokee is only native to the United States the second entry should not be needed and was added for demonstration only.

2. Then find the url-patterns in your web.xml and add the following entries:


These url-patterns tell liferay that the url will be – for example, or

In order to test this out, the following restrictions were added to the file:


In this way, the user would only see Arabic, English, Cherokee, Cherokee (US), and Japanese in the Language portlet added to the home page.

3. Two new properties files were added to the portlet in the resources directory:, and

4. The final step needed to display this new language, if the language is Unicode (as Cherokee is) is to add the following to the top of your portlet:

<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" %>

Here is the final code for this demonstration:

<%@ taglib prefix="spring" uri="" %>
 <%@ taglib uri="" prefix="liferay-ui" %><%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8" language="java" %>
spring:message tag -- <spring:message code="displayName"/><br/><br/>
liferay-ui:message tag -- <liferay-ui:message key="displayName" /><br/><br/>

English display


Cherokee display (with escaped unicode):

Cherokee display (with straight unicode):

Note: spring:message tags — you must use native2ascii to convert the language to escaped unicode (u+xxxx) before using them and the default ResourceBundleMessageSource and not ReloadableResourceBundleMessageSource.  However, if you are attempting to use native2ascii on Cherokee it will not work.  Your conversion will turn Cherokee into multibyte representation.

Note: liferay-ui:message tags – as stated above, as of 6.1 unicode is permitted inside the properties file (just as Grails has); before Liferay v6.1 you are still required to convert the unicode to escaped unicode (u+xxxx) before using.

See Also:

Share This